:root {
  --paper: #efe7d6;
  --paper-2: #f6f1e6;
  --ink: #26241f;
  --ink-2: #4a463d;
  --muted: #7d7464;
  --line: rgba(38, 36, 31, .12);
  --wine: #b23a2e;
  --wine-2: #8f2b22;
  --glow: #ffcf6e;
  --panel-w: 360px;
  --serif: "Cormorant Garamond", "Georgia", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* windows: fade in / fade out (design.md «Окна»; the screen swap in js/modal.js waits .16s) */
  --modal-in: .22s;
  --modal-out: .18s;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  /* the site is a map, not a document: a stray drag or double-click must not paint text blue */
  -webkit-user-select: none;
  user-select: none;
}
input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; }
/* text fields in focus: no outline or highlight, the caret shows where you type (design.md «Поля ввода») */
textarea:focus, input:is(:not([type]), [type="text"], [type="email"], [type="search"], [type="time"], [type="date"]):focus { outline: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }

/* ------------------------------------------------------------ hero / map */
.hero { position: relative; height: 100vh; height: 100dvh; overflow: hidden; }
.map { position: absolute; inset: 0; z-index: 0; } /* own stacking context: pins stay under the panel */
.map canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; }
.map.is-region canvas { cursor: pointer; }
.map.is-dragging canvas { cursor: grabbing; }
.map-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.map-layer > * { position: absolute; left: 0; top: 0; will-change: transform; }

/* title: top centre of the map area (left of the panel) */
.map-title {
  position: absolute;
  left: 24px;
  right: calc(var(--panel-w) + 44px);
  top: 22px;
  z-index: 14;
  text-align: center;
  pointer-events: none;
  transition: opacity .6s;
}
.map-title h1 {
  --mark: 34px;
  --gap: 12px;
  display: inline-flex;
  align-items: center;
  gap: var(--gap);
  margin: 0;
  /* centre the words, not words + mountain mark, so the subtitle sits right under them */
  position: relative;
  left: calc((var(--mark) + var(--gap)) / -2);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 46px;
  line-height: 1;
  letter-spacing: -.01em;
  color: var(--ink);
  text-shadow: 0 0 18px rgba(246, 241, 230, .9), 0 0 4px rgba(246, 241, 230, .8);
}
.map-title .brand-mark { width: var(--mark); height: var(--mark); flex: none; color: var(--ink); filter: drop-shadow(0 0 6px rgba(246, 241, 230, .9)); }
.lead {
  margin: 8px 0 0;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-shadow: 0 0 10px rgba(246, 241, 230, .95), 0 0 3px rgba(246, 241, 230, .9);
}

/* ------------------------------------------------------------ cities */
.city {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 12.5px;
  color: #1f1d19;
  white-space: nowrap;
  text-shadow:
    0 0 2px rgba(255, 253, 247, .95), 0 0 4px rgba(255, 253, 247, .9),
    0 0 8px rgba(255, 253, 247, .7);
  transition: opacity .25s;
}
.city i {
  flex: none;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #1f1d19;
  box-shadow: 0 0 0 1.5px rgba(255,255,255,.8);
}
.city.rank-2 { font-weight: 600; font-size: 11.5px; color: #2f2c26; }
.city.rank-2 i { width: 6px; height: 6px; border-width: 1.5px; }
.city.rank-0 { font-size: 15px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.city.rank-0 i {
  width: 16px; height: 16px;
  background: #1f1d19;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
  display: grid; place-items: center;
}
.city.rank-0 i::after {
  content: "";
  width: 8px; height: 8px;
  background: #fff;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.city.anchor-l { flex-direction: row-reverse; }
.city.anchor-b { flex-direction: column; gap: 2px; }
.city.anchor-t { flex-direction: column-reverse; gap: 2px; }
/* a region is selected: labels outside it dim with the map, its own stay at full strength (applyHighlight) */
.is-focus .city:not(.in-region) { opacity: .55; }

.peak {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #1f1d19;
  white-space: nowrap;
  text-shadow:
    0 0 2px rgba(255, 253, 247, .95), 0 0 4px rgba(255, 253, 247, .9),
    0 0 8px rgba(255, 253, 247, .7);
  transition: opacity .25s;
}
.peak i {
  flex: none;
  width: 9px; height: 8px;
  background: #1f1d19;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  filter: drop-shadow(0 0 1px #fff);
}
.peak small { margin-left: 4px; font-size: 10px; font-weight: 600; color: #6c645a; }
.peak.anchor-l { flex-direction: row-reverse; }
.peak.anchor-t { flex-direction: column-reverse; align-items: center; gap: 1px; }
/* summit markers only appear once zoomed in (main peaks first, minor ones closer still) */
.peak { opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s; }
.map.peaks-1 .peak.rank-1, .map.peaks-2 .peak.rank-2 { opacity: 1; visibility: visible; transition: opacity .3s; }
.map.is-focus.peaks-1 .peak.rank-1:not(.in-region), .map.is-focus.peaks-2 .peak.rank-2:not(.in-region) { opacity: .55; }

/* place names around the hikes: only close in, placed and thinned out by updatePlaces (js/main.js) */
.place {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: #322d25;
  white-space: nowrap;
  text-shadow:
    0 0 2px rgba(255, 253, 247, .95), 0 0 4px rgba(255, 253, 247, .85),
    0 0 7px rgba(255, 253, 247, .6);
  opacity: 0; visibility: hidden;
  transition: opacity .3s, visibility 0s .3s;
}
.place.is-on { opacity: 1; visibility: visible; transition: opacity .3s; }
.map.is-focus .place.is-on:not(.in-region) { opacity: .55; }
.place i {
  flex: none;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid #4a4237;
}
.place.anchor-l { flex-direction: row-reverse; }
/* a pass: the map sign ")(" */
.place.kind-pass i {
  width: 9px; height: 10px;
  border: 0; border-radius: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 10'%3E%3Cpath d='M1.5 1Q4 5 1.5 9M7.5 1Q5 5 7.5 9' fill='none' stroke='%233d372e' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 0 1px #fff);
}
.place.kind-lake, .place.kind-valley, .place.kind-park { font-style: italic; }
.place.kind-lake { color: #2a5b80; }
.place.kind-valley { color: #5a4a33; letter-spacing: .03em; }
.place.kind-park { color: #3d6634; white-space: pre-line; text-align: center; }

.terrain-label {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: .06em;
  color: rgba(255, 252, 244, .96);
  text-shadow: 0 1px 3px rgba(40, 28, 16, .55), 0 0 10px rgba(40, 28, 16, .35);
  white-space: nowrap;
  transform-origin: 0 0;
}
.terrain-label.small { font-size: 16px; }
.is-focus .terrain-label { opacity: .4; }

/* ------------------------------------------------------------ pins */
/* pinch over pins / tags must not zoom the page on touch screens (one-finger pans still work) */
.map-layer > *, .map-tag { touch-action: pan-x pan-y; }
.pin {
  pointer-events: auto;
  width: 0; height: 0;
  border: 0; padding: 0; background: none;
  cursor: pointer;
}
.pin-dot {
  position: absolute;
  left: -6px; top: -6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--rc, var(--wine));
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.35), 0 0 0 0 rgba(255, 207, 110, 0);
  transition: transform .2s cubic-bezier(.3,1.6,.5,1), background .2s, box-shadow .25s, opacity .25s;
}
.pin::before { /* bigger hit area */
  content: "";
  position: absolute;
  left: -11px; top: -11px;
  width: 22px; height: 22px;
  border-radius: 50%;
}
.pin-label {
  position: absolute;
  left: 13px; top: 0;
  transform: translateY(-50%) translateX(-4px);
  padding: 5px 10px 5px 9px;
  border-radius: 8px;
  background: rgba(255, 252, 245, .94);
  border: 1px solid rgba(38, 36, 31, .1);
  box-shadow: 0 4px 14px rgba(38, 30, 18, .18);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s, background .18s, color .18s;
}
.pin.side-l .pin-label { left: auto; right: 13px; transform: translateY(-50%) translateX(4px); }
.pin-label .emo { margin-right: 6px; }
.pin-label .emo .ico { width: 17px; height: 17px; vertical-align: -3.5px; }
.ico { display: block; }
.pin-label .ico { display: inline-block; }
/* photo card: the name row stays level with the dot, the photo sits above it */
.pin-label.has-photo {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 5px 5px 6px;
  width: 232px;
  white-space: normal;
  transform: translateY(calc(-100% + 15px)) translateX(-4px);
}
.pin.side-l .pin-label.has-photo { transform: translateY(calc(-100% + 15px)) translateX(4px); }
.pin.is-active .pin-label.has-photo { transform: translateY(calc(-100% + 15px)); }
.pin.card-below .pin-label.has-photo { transform: translateY(-15px); }
.pin.card-below .pin-name { order: -1; }
.pin.is-active .pin-label { pointer-events: auto; cursor: pointer; }
.pin.is-active .pin-label:hover .pin-photo img { transform: scale(1.04); }
/* invisible bridge between the dot and the card, so the pointer can travel into it */
.pin-label::after { content: ""; position: absolute; top: 0; bottom: 0; left: -16px; width: 16px; }
.pin.side-l .pin-label::after { left: auto; right: -16px; }
.hike-go { margin-left: auto; font-weight: 800; color: var(--wine); }
.hike:hover .hike-go, .hike.is-active .hike-go { color: var(--glow); }
.pin-photo {
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: 5px;
  overflow: hidden;
  background: #3a362e;
}
.pin-photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.pin-name { display: flex; align-items: center; padding: 0 5px; text-align: left; white-space: nowrap; }
.pin-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pin-km { flex: none; margin-left: auto; padding-left: 12px; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; opacity: .62; }
.is-focus .pin:not(.in-region):not(.is-active) .pin-dot { opacity: .45; transform: scale(.8); }
.pin.in-region .pin-dot {
  transform: scale(1.18);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--rc, var(--glow)) 38%, transparent), 0 1px 3px rgba(0,0,0,.35);
}
.pin.is-active { z-index: 1000 !important; }
.pin.is-active .pin-dot {
  transform: scale(1.4);
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--ink), 0 0 0 7px color-mix(in srgb, var(--rc, var(--glow)) 40%, transparent), 0 2px 6px rgba(0,0,0,.35);
}
/* a highlighted hike in the list: dark, but in its region's colour (dark burgundy, dark blue…); the pin card stays ink */
.region { --rc-dark: color-mix(in srgb, var(--rc, var(--ink)) 45%, #17130e); }
.pin.is-active .pin-label {
  opacity: 1;
  transform: translateY(-50%);
  background: var(--ink);
  color: #fff8e8;
  border-color: var(--ink);
}

.map-tag {
  position: absolute;
  left: 0; top: 0;
  z-index: 5;
  padding: 7px 12px 8px;
  border-radius: 10px;
  background: rgba(38, 36, 31, .9);
  color: #fff8e8;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(38, 30, 18, .25);
  transform: translate(-200px, -200px);
}
.map-tag .tag-text { display: block; }
.map-focus {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 9px 14px;
  pointer-events: auto;
  border-left: 4px solid var(--rc, var(--glow));
  z-index: 6;
}
.map-focus[hidden] { display: none; }
.map-focus .tag-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 248, 232, .12);
  color: #fff8e8;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.map-focus .tag-close:hover { background: rgba(255, 248, 232, .26); transform: rotate(90deg); }
.map-focus .tag-close svg { width: 14px; height: 14px; }
.map-tag small {
  display: block;
  margin-top: 4px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--glow);
}

/* ------------------------------------------------------------ panel */
.panel {
  position: absolute;
  right: 20px;
  top: 20px;
  bottom: 20px;
  z-index: 20;
  width: var(--panel-w);
  display: flex;
  flex-direction: column;
  background: rgba(252, 249, 241, .78);
  border: 1px solid rgba(38, 36, 31, .1);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(60, 45, 25, .14);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 12px 20px;
  border-bottom: 1px solid var(--line);
}
.panel-kicker { font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.about-link {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.about-link:hover { background: rgba(38, 36, 31, .07); color: var(--ink); }
.region-list {
  list-style: none;
  margin: 0;
  padding: 6px 10px 14px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(38,36,31,.25) transparent;
}
.region { padding: 4px 0; border-bottom: 1px dashed rgba(38, 36, 31, .12); border-radius: 12px; transition: background .2s, box-shadow .2s; }
.region:last-child { border-bottom: 0; }
/* "Сообщить о неточности" at the end of the list; the button itself is shared with the hike page */
.region-list .report { padding: 16px 0 4px; text-align: center; }
.report-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .45);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.report-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.report-btn:hover { color: var(--wine); border-color: color-mix(in srgb, var(--wine) 40%, transparent); background: #fff; }
.region-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  text-align: left;
  cursor: pointer;
  transition: background .2s;
}
.region-name {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.1;
}
.region-name::before {
  content: "";
  flex: none;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--rc);
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px color-mix(in srgb, var(--rc) 45%, transparent);
}
.region-head:hover { background: color-mix(in srgb, var(--rc) 9%, transparent); }
.region.is-active, .region.is-focus { border-bottom-color: transparent; background: color-mix(in srgb, var(--rc) 15%, rgba(255, 255, 255, .45)); }
.region.is-active .region-head, .region.is-focus .region-head { background: none; }
.region.is-active .region-name, .region.is-focus .region-name { color: color-mix(in srgb, var(--rc) 72%, var(--ink)); }
/* the region we flew to stays marked (left bar) while the pointer explores other regions */
.region.is-focus { box-shadow: inset 3px 0 0 var(--rc); }

.hike-list { list-style: none; margin: 0 0 4px; padding: 0; }
.hike {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 5px 10px 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.hike-emo { flex: none; display: flex; width: 18px; align-self: center; }
.hike-emo .ico { width: 18px; height: 18px; }
.hike-name { flex: 1; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.hike:hover, .hike.is-active { background: var(--rc-dark); }
.hike:hover .hike-name, .hike.is-active .hike-name { color: #fff8e8; }

/* ------------------------------------------------------------ map ui */
.map-ui {
  position: absolute;
  right: calc(var(--panel-w) + 44px);
  bottom: 24px;
  z-index: 15;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}
.compass { position: relative; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; color: inherit; font: inherit; }
.compass:hover svg circle { fill: rgba(255, 255, 255, .9); }
.compass:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 50%; }
.compass svg { width: 100%; height: 100%; transition: transform .1s linear; }
.compass span {
  position: absolute; left: 50%; top: -15px;
  transform: translateX(-50%);
  font-size: 11px; font-weight: 800; color: var(--ink-2);
}
.zoom {
  display: flex;
  overflow: hidden;
  background: rgba(255, 252, 245, .78);
  border: 1px solid var(--line);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.zoom button {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 0;
  background: none;
  font-size: 20px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.zoom button + button { border-left: 1px solid var(--line); }
.zoom button:hover { background: rgba(38, 36, 31, .07); }
.zoom svg { width: 16px; height: 16px; }
.zoom button:focus-visible { outline: 2px solid var(--ink); outline-offset: -3px; border-radius: 9px; }

/* ↻ «Сброс» (js/mapcontrols.js): its own button left of − +, shown only once the map has left its start view. It
   fades in and out in place and keeps its room while hidden, so nothing in the row moves */
.map-reset {
  height: 40px;
  display: flex; align-items: center; gap: 6px;
  padding: 0 13px 0 11px;
  background: rgba(255, 252, 245, .78);
  border: 1px solid var(--line);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font: inherit; font-size: 13px; font-weight: 600; color: var(--ink);
  white-space: nowrap;
  cursor: pointer;
  opacity: 0; visibility: hidden;
  transition: opacity .25s, visibility 0s .25s, background .15s;
}
.map-reset.is-shown { opacity: 1; visibility: visible; transition: opacity .25s, background .15s; }
.map-reset:hover { background: rgba(255, 252, 245, .95); }
.map-reset:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.map-reset svg { width: 16px; height: 16px; flex: none; }
@media (prefers-reduced-motion: reduce) { .map-reset, .map-reset.is-shown { transition: none; } }

/* the buttons' names on hover: a small card above the button (js/mapcontrols.js, mountTips) */
.map-tip {
  position: absolute; left: 0; top: 0; z-index: 2;
  padding: 6px 10px;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 3px 12px rgba(38, 36, 31, .14);
  font-size: 12.5px; font-weight: 600; line-height: 1.2; color: var(--ink);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 6px));
  transition: opacity .12s;
}
.map-tip::after {                          /* the little arrow down to the button */
  content: ''; position: absolute; left: 50%; bottom: -5px;
  width: 8px; height: 8px; margin-left: -4px;
  background: inherit; border: inherit; border-width: 0 1px 1px 0;
  transform: rotate(45deg);
}
.map-tip.is-on { opacity: 1; transform: translate(-50%, calc(-100% - 10px)); transition: opacity .12s, transform .12s; }

/* the empty room in the row passes the wheel and drags on to the map */
.map-ui { pointer-events: none; }
.map-ui > * { pointer-events: auto; }
.map-ui > .map-tip { pointer-events: none; }

/* hike routes up close: on / off (main.js, ROUTES_KEY) */
.routes-toggle {
  height: 40px;
  display: flex; align-items: center; gap: 7px;
  padding: 0 10px 0 9px;
  background: rgba(255, 252, 245, .78);
  border: 1px solid var(--line);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2);
  cursor: pointer;
  transition: background .15s;
}
.routes-toggle[hidden] { display: none; }      /* only with ?routes=1 on a test address or localhost (main.js) */
.routes-toggle:hover { background: rgba(255, 252, 245, .95); }
.routes-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.routes-toggle svg { width: 18px; height: 18px; color: #c4372b; }
.routes-toggle i {                         /* the switch */
  position: relative; width: 26px; height: 15px; border-radius: 8px;
  background: rgba(38, 36, 31, .2); transition: background .2s;
}
.routes-toggle i::after {
  content: ''; position: absolute; left: 2px; top: 2px; width: 11px; height: 11px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .2s;
}
.routes-toggle[aria-pressed="true"] i { background: #c4372b; }
.routes-toggle[aria-pressed="true"] i::after { transform: translateX(11px); }
.routes-toggle[aria-pressed="false"] svg { color: var(--ink-3, #8a857a); }

.map-note {
  position: absolute;
  left: 32px;
  bottom: 16px;
  z-index: 15;
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

.map-note a { color: inherit; text-decoration: none; }
/* the big map's © OpenStreetMap, faint and printed into the map: multiply darkens whatever lies under the letters a
   little — on the paper it is #a39a88 (2.3:1, below the usual 3:1, Max's choice at his own risk, 20.11), over the
   relief a shade darker than the relief. A paper halo instead turned into a blurry smudge over dark relief (Max) */
.map-credit { color: #aeaaa2; mix-blend-mode: multiply; }
.map-note a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
/* «Карта и источники»: the inner screen of «О проекте» (js/about.js) */
/* two columns: what (as wide as the longest label) and where from */
.credits-data { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; list-style: none; margin: 14px 0 0; padding: 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.credits-data li { display: contents; }
.credits-data b { font-weight: 700; color: var(--ink); }
.credits-sub { margin: 4px 0 14px; font-size: 12.5px; color: var(--muted); }
.credits-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.credits-list li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 6px 0;
  border-top: 1px solid rgba(38, 36, 31, .08);
}
.credits-list .cr-name { font-weight: 600; }
.credits-list a { color: var(--muted); text-align: right; text-decoration: none; }
.credits-list a:hover { color: var(--wine); text-decoration: underline; }

/* ------------------------------------------------------------ loader */
.loader {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: var(--paper);
  transition: opacity .8s ease .1s, visibility 0s linear .9s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader-inner { text-align: center; color: var(--ink-2); }
.loader-ridge { width: 120px; color: var(--wine); }
.loader-ridge path { stroke-dasharray: 220; stroke-dashoffset: 220; animation: ridge 1.6s ease-in-out infinite alternate; }
.loader p { margin: 10px 0 0; font-family: var(--serif); font-size: 20px; font-style: italic; }
@keyframes ridge { to { stroke-dashoffset: 0; } }
.loader.is-error .loader-ridge { display: none; }

.noscript { position: fixed; inset: auto 0 0 0; padding: 16px; text-align: center; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  :root { --panel-w: 310px; }
  .map-title h1 { font-size: 38px; }
}

@media (max-width: 980px) {
  body { overflow: auto; }
  .hero { height: auto; overflow: visible; }
  .map { position: relative; height: 74vh; height: 74svh; min-height: 420px; }
  .panel {
    position: relative;
    inset: auto;
    width: auto;
    margin: -24px 16px 16px;
    border-radius: 16px;
  }
  .region-list { overflow: visible; }
  .map-ui { right: 16px; bottom: auto; top: calc(74svh - 64px); }
  .map-note { left: 20px; bottom: auto; top: calc(74svh - 50px); }   /* the map's corner, level with .map-ui */
  .loader { position: fixed; }
  .map-title { right: 16px; left: 16px; top: 14px; }
  .map-title h1 { font-size: 32px; --mark: 26px; --gap: 9px; }
  :lang(ka) .map-title h1 { font-size: clamp(18px, 5.6vw, 22px); }        /* «ლაშქრობა საქართველოში» is wider: one line, next to the mark */
  .lead { font-size: 12.5px; }
}

@media (max-width: 760px) {
  .map { height: 62vh; height: 62svh; min-height: 380px; }
  .map-ui { top: calc(62svh - 60px); }
  .panel { margin: -20px 12px 16px; }
  .map-note { left: 16px; top: calc(62svh - 46px); }
  .city { font-size: 10.5px; gap: 4px; }
  .city.rank-0 { font-size: 12px; }
  .city.rank-0 i { width: 12px; height: 12px; }
  .city.rank-0 i::after { width: 6px; height: 6px; }
  .city.rank-2 { display: none; }
  .pin-dot { left: -5px; top: -5px; width: 10px; height: 10px; border-width: 2px; }
  .terrain-label { font-size: 13px; }
  .map-tag { font-size: 16px; }
}

@media (max-width: 480px) {
  .map-note { top: calc(62svh - 82px); }   /* .map-ui spans the width here: the credit goes above the «Маршруты» toggle */
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}

/* ------------------------------------------------------------ cloud transition */
.cloud-veil { position: fixed; inset: 0; z-index: 200; pointer-events: none; visibility: hidden; overflow: hidden; }
.cloud-veil.is-in, .cloud-veil.is-out { visibility: visible; }
.cloud-veil.is-covered { pointer-events: auto; }
.cloud-base {
  position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 45%, #fffefb 0%, #f6f2ea 60%, #ece5d8 100%);
  opacity: 0;
  transition: opacity calc(var(--dur, 900ms) * .7) ease-in calc(var(--dur, 900ms) * .3);
}
.cloud-veil.is-in .cloud-base { opacity: 1; }
.cloud-veil.is-out .cloud-base { opacity: 0; transition: opacity calc(var(--dur, 1400ms) * .55) ease-out; }
.cloud-layer {
  position: absolute; inset: -40%;
  background-repeat: repeat;
  opacity: 0;
  transform: scale(.55);
  transition: opacity var(--dur, 900ms) ease, transform var(--dur, 900ms) cubic-bezier(.3, .55, .35, 1);
  animation: cloud-drift 60s linear infinite;
}
.cloud-layer.l0 { background-size: 62vmax 62vmax; }
.cloud-layer.l1 { background-size: 96vmax 96vmax; animation-duration: 90s; animation-direction: reverse; }
.cloud-layer.l2 { background-size: 140vmax 140vmax; animation-duration: 120s; }
.cloud-veil.is-in .cloud-layer { opacity: 1; transform: scale(1); }
.cloud-veil.is-out .cloud-layer { opacity: 0; transform: scale(2.6); transition-timing-function: ease-in, cubic-bezier(.45, 0, .7, .4); }
.cloud-veil.is-out .cloud-layer.l2 { transform: scale(3.4); }
.cloud-veil.no-anim, .cloud-veil.no-anim * { transition: none !important; }
@keyframes cloud-drift { from { background-position: 0 0; } to { background-position: 100vmax 30vmax; } }

/* hand-off snapshot */
.handoff-shot { position: absolute; inset: 0; z-index: 6; background-size: 100% 100%; pointer-events: none; }
body.is-diving .map-layer, body.is-diving .map-tag, body.is-diving .map-title, body.is-diving .map-ui, body.is-diving .map-note { opacity: 0; transition: opacity .45s; }
body.is-diving .panel { opacity: 0; transform: translateX(14px); transition: opacity .5s, transform .5s; }
body.is-arriving .map-layer, body.is-arriving .map-title, body.is-arriving .map-ui, body.is-arriving .map-note { opacity: 0; }
body.is-arriving .panel { opacity: 0; transform: translateX(14px); }
.map-layer, .map-ui, .map-note, .panel { transition: opacity .6s, transform .6s; }
body.is-arriving .loader { display: none; }

/* ------------------------------------------------------------ about / feedback sheets */
.sheet {
  width: min(560px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 48px));
  padding: 22px 24px 22px;
  border: 0;
  border-radius: 18px;
  background: var(--paper-2);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(38, 30, 18, .3);
  overflow-y: auto;
  scrollbar-width: thin;
}
.sheet::backdrop { background: rgba(38, 36, 31, .38); backdrop-filter: blur(2px); }
.sheet-head { position: relative; display: flex; align-items: center; gap: 16px; padding-right: 40px; }
.sheet h2 { margin: 0; font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1; }
.sheet-close {
  position: absolute; right: -4px; top: -4px;
  width: 34px; height: 34px;
  border: 0; border-radius: 50%;
  background: rgba(38, 36, 31, .07);
  font-size: 20px; line-height: 1; color: var(--ink);
  cursor: pointer;
}
.sheet-close:hover { background: rgba(38, 36, 31, .14); }
.about-photo {
  flex: none;
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 30%;
  box-shadow: 0 0 0 3px #fff, 0 6px 18px rgba(38, 30, 18, .22);
}
.about-by { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.about-text { margin-top: 18px; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.about-text p { margin: 0 0 10px; }
.about-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.about-block h3 {
  display: block;
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--wine);
}
.about-note { margin: 6px 0 12px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.about-stats { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3, var(--ink-2)); }
/* the short link at the bottom of «О проекте» to its inner screen «Карта и источники», and the way back */
.about-foot { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.about-more, .sheet-back {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px 0;
  border: 0; background: none;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--muted);
  cursor: pointer;
  transition: color .15s;
}
.about-more:hover, .sheet-back:hover { color: var(--wine); }
.about-more svg, .sheet-back svg { width: 14px; height: 14px; flex: none; }
.sheet-back { margin-left: -3px; min-height: 30px; }
.about-sources h2 { margin-top: 10px; }
.about-sources .about-note { margin-top: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.chip:hover { border-color: rgba(38, 36, 31, .3); transform: translateY(-1px); }
.chip svg { width: 15px; height: 15px; flex: none; }
.chip-main { background: var(--ink); border-color: var(--ink); color: #fff8e8; }
.chip-main:hover { background: #000; }
.req { list-style: none; margin: 0; padding: 0; }
.req li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
}
.req li + li { margin-top: 6px; }
.req-k { font-size: 12px; color: var(--muted); }
.req-v { grid-row: 2; font-size: 15px; font-weight: 700; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.req .chip { grid-row: 1 / 3; grid-column: 2; }
.req-empty { margin: 0; padding: 12px 14px; border-radius: 12px; border: 1px dashed rgba(38, 36, 31, .22); font-size: 13px; color: var(--muted); }
/* «Напишите мне» (js/about.js): mailbox + title, the text, «Хочу получить ответ» opens the contact field, send */
.fb-head { gap: 12px; padding-right: 44px; }
.fb-hero { flex: none; width: 76px; height: 76px; margin: -6px 0 -6px -6px; }
.sheet textarea, .sheet .fb-contact input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(38, 36, 31, .18);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
}
.sheet textarea { margin-top: 18px; resize: vertical; }
.fb-check {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; margin-top: 8px;
  font-size: 14px; font-weight: 600; color: var(--ink);
  cursor: pointer;
}
.fb-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); cursor: pointer; }
/* the contact field slides open under the checkbox */
.fb-contact { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .22s ease, opacity .22s ease; }
.fb-contact > div { overflow: hidden; padding: 0 3px; margin: 0 -3px; }
.fb-contact.is-open { grid-template-rows: 1fr; opacity: 1; }
.fb-contact.is-open > div { padding-bottom: 3px; }
.fb-contact input { margin-top: 4px; }
.fb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.fb-error { margin: 10px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--wine); }
.fb-actions { display: flex; margin-top: 14px; }
.fb-send, .fb-done {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 26px;
  border: 0; border-radius: 999px;
  background: var(--ink);
  font: inherit; font-size: 14.5px; font-weight: 800; color: #fff8e8;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}
.fb-send:hover, .fb-done:hover { background: #000; }
.fb-send:focus-visible, .fb-done:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.fb-send svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fb-send.is-busy { opacity: .6; cursor: progress; }
.fb-send.is-busy svg { animation: fb-fly .8s ease-in-out infinite alternate; }
@keyframes fb-fly { to { transform: translateX(4px); } }
.fb-sent { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 26px; text-align: center; }
.fb-sent[hidden], .fb-form[hidden] { display: none; }
.fb-scene { display: block; width: 100%; height: auto; }
.fb-sent h2 { margin-top: 14px; }
.fb-sent p { max-width: 400px; margin: 10px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.fb-done { min-width: 140px; margin-top: 22px; }
/* phone: the form rises from the bottom edge, the button takes the full width */
@media (max-width: 560px) {
  .sheet.feedback {
    width: 100%; max-width: 100%;
    margin: auto 0 0;
    max-height: calc(100dvh - 24px);
    padding: 18px 18px calc(24px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
  }
  .fb-hero { width: 68px; height: 68px; }
  .fb-send { flex: 1 1 100%; }
}
.toast {
  position: fixed;
  left: 50%; bottom: 28px;
  z-index: 300;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff8e8;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Windows (design.md «Окна»): every <dialog class="modal"> — О проекте, Источники, Напишите мне, the trip planner —
   fades in together with its dimmed backdrop and fades out on closing (js/modal.js). Screens inside a window swap with
   the same fade. One look for all of them: change it here, not per window. */
.modal[open], .modal[open]::backdrop { animation: modal-in var(--modal-in) ease-out; }
.modal.is-closing, .modal.is-closing::backdrop { animation: modal-out var(--modal-out) ease-in forwards; }
.screen-out { animation: modal-out .16s ease-in forwards; }
.screen-in { animation: modal-in var(--modal-in) ease-out; }
@keyframes modal-in { from { opacity: 0; } }
@keyframes modal-out { to { opacity: 0; } }

/* hidden comparison panel for the close-up relief (?compare=1 on the test address or localhost, js/compare.js) */
.compare {
  position: absolute;
  left: 24px;
  bottom: 40px;
  z-index: 15;
  width: 262px;
  padding: 12px 12px 10px;
  background: rgba(255, 252, 245, .86);
  border: 1px solid var(--line);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(38, 36, 31, .08);
  font-size: 12px;
  color: var(--ink-2);
}
.compare-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; }
.compare-head b { font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--ink); }
.compare-head span { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.compare-all { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 4px; }
.compare-all button {
  padding: 7px 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .6);
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.compare-all button:hover { background: rgba(255, 255, 255, .95); }
.compare-all button[aria-pressed="true"] { border-color: var(--wine); color: var(--wine); background: rgba(255, 255, 255, .95); }
.compare-row { display: grid; grid-template-columns: 62px 1fr; align-items: center; gap: 8px; margin-top: 6px; }
.seg { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 255, 255, .5); }
.seg button {
  flex: 1;
  padding: 6px 4px;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { background: rgba(38, 36, 31, .06); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper-2); }
.seg button:disabled { color: var(--muted); opacity: .45; cursor: not-allowed; background: none; }
.compare button:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.compare-hint { margin: 9px 0 0; font-size: 10.5px; color: var(--muted); }
.compare-stat { margin: 9px 0 0; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.compare-hint kbd { padding: 0 4px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255, 255, 255, .7); font: inherit; font-weight: 700; color: var(--ink-2); }
body.is-diving .compare { opacity: 0; transition: opacity .45s; }
body.is-arriving .compare { opacity: 0; }

/* ---- languages (js/i18n.js) */
.i18n-wait [data-t] { visibility: hidden; }        /* static texts wait a moment for their translation */
.panel-head .about-link, .panel-top .about-link { margin-left: auto; white-space: nowrap; }
.panel-top .back-link, .lang-btn { white-space: nowrap; }
.lang { position: relative; margin-left: -8px; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px 5px 9px;
  border: 0; border-radius: 999px;
  background: none;
  font: 800 12px/1.2 var(--sans);
  letter-spacing: .03em;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.lang-btn:hover, .lang-btn[aria-expanded="true"] { background: rgba(38, 36, 31, .07); color: var(--ink); }
.lang-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.flag { flex: none; display: block; width: 18px; height: 12px; border-radius: 2px; overflow: hidden; box-shadow: 0 0 0 1px rgba(38, 36, 31, .16); }
.flag svg { display: block; width: 100%; height: 100%; }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  min-width: 170px;
  margin: 0; padding: 5px;
  list-style: none;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(40, 30, 15, .22);
  animation: lang-in .16s ease-out;
}
.lang-menu[hidden] { display: none; }
@keyframes lang-in { from { opacity: 0; transform: translateY(-4px); } }
.lang-menu a { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; outline: none; }
.lang-menu a b { width: 22px; font-weight: 800; letter-spacing: .02em; }
.lang-menu a span { color: var(--ink-2); }
.lang-menu a[aria-current] span { color: rgba(255, 248, 232, .75); }
.lang-menu a:hover, .lang-menu a:focus { background: rgba(38, 36, 31, .07); }
.lang-menu a[aria-current] { background: var(--ink); color: #fff8e8; }
/* Georgian has no capitals: text-transform would leave it as it is in one browser and turn it into Mtavruli in
   another — the small-caps labels stay plain lower case, with less of the spacing made for capitals */
:lang(ka) * { text-transform: none !important; }
:lang(ka) :is(.panel-kicker, .city.rank-0, .about-block h3, .stat-k, .stop-name small, .stop-tag em,
  .trip-kicker, .trip-field span, .ts-k) { letter-spacing: .02em; }

/* hidden zoom slider of the hike map (?zoom=1 on the test address or localhost, js/zoomtune.js); the card is .compare's */
.tune { width: 260px; }
.tune-value { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.tune-value b { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.tune-value i { font-style: normal; color: var(--muted); }
.tune input[type="range"] { width: 100%; margin: 0; accent-color: var(--ink); cursor: pointer; }
.tune-ends { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); }
.tune .compare-hint b { color: var(--ink); font-variant-numeric: tabular-nums; }
.hike-page .tune { top: 24px; bottom: auto; }          /* the legend sits bottom left */
/* hidden routes' look panel on the big map (?routelook=1 on the test address or localhost, js/routetune.js) */
.route-tune { width: 270px; }
.tune-row { display: block; margin-top: 9px; }
.tune-row span { display: flex; justify-content: space-between; margin-bottom: 2px; }
.tune-row b { font-variant-numeric: tabular-nums; color: var(--ink); }
.route-tune .compare-row { grid-template-columns: 48px 1fr; }
