@font-face { font-family: "Onest"; src: url("/assets/fonts/onest-cyrillic.woff2") format("woff2"); font-weight: 400 800; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; src: url("/assets/fonts/onest-latin.woff2") format("woff2"); font-weight: 400 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #f4f5f6;
  --surface: #ffffff;
  --surface-2: #eff1f2;
  --plate: #eceff1;
  --ink: #111418;
  --ink-2: #4c535a;
  --muted: #8b9198;
  --line: rgba(17, 20, 24, 0.07);
  --line-2: rgba(17, 20, 24, 0.13);
  --coral: #ff5a36;
  --coral-ink: #d9431f;
  --blue: #2563d8;
  --glass: rgba(255, 255, 255, 0.88);
  --float: 0 1px 2px rgba(17, 20, 24, 0.06), 0 6px 20px rgba(17, 20, 24, 0.08);
  --lift: 0 2px 8px rgba(17, 20, 24, 0.06), 0 24px 60px rgba(17, 20, 24, 0.14);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tabs-h: calc(58px + var(--safe-b));
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font: 450 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  font-feature-settings: "tnum" 1;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; opacity: 0.3; }
a { color: var(--blue); text-decoration: none; }
img { display: block; }
h1, h2, h3, h4, p { margin: 0; }
input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 10px; }
.ico { width: 20px; height: 20px; flex: none; }
.ico.big { width: 36px; height: 36px; color: var(--muted); opacity: 0.6; }
.muted { color: var(--muted); }
.note { color: var(--muted); font-size: 13px; line-height: 1.5; }
.note.center { text-align: center; margin: 22px auto 8px; max-width: 520px; }
.kicker { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- map ---------- */

.map { position: fixed; inset: 0; background: #f5f6f5; }
.map .maplibregl-canvas { outline: none; }
.maplibregl-ctrl-bottom-right { bottom: calc(var(--tabs-h) + 4px); opacity: 0.7; }
body[data-view="map"] .maplibregl-ctrl-bottom-right { bottom: calc(var(--tabs-h) + 110px); }
.maplibregl-ctrl-attrib.maplibregl-compact { background: rgba(255, 255, 255, 0.85); font-size: 11px; }

/* ---------- top bar ---------- */

.top { position: fixed; z-index: 20; top: 0; left: 0; right: 0; padding: calc(var(--safe-t) + 10px) 0 0; pointer-events: none; }
.top-ui { pointer-events: auto; width: 100%; max-width: 100%; min-width: 0; }
.top-row { display: flex; align-items: center; gap: 8px; padding: 0 12px; position: relative; }
.brand { width: 44px; height: 44px; flex: none; border-radius: 50%; box-shadow: var(--float); }
.brand svg { width: 44px; height: 44px; }
.search-pill {
  flex: 1;
  min-width: 0;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-radius: 14px;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  box-shadow: var(--float);
  color: var(--muted);
  text-align: left;
}
.search-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.search-pill.picked { color: var(--ink); padding-right: 42px; }
.search-pill.picked .search-text { font-weight: 650; }
.pill-clear { position: absolute; right: 64px; top: 6px; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); }
.pill-clear .ico { width: 15px; height: 15px; }
.round-btn {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--float);
  color: var(--ink);
  transition: transform 0.15s var(--ease), background 0.2s, color 0.2s;
}
.round-btn:active { transform: scale(0.94); }
.round-btn.flat { box-shadow: none; background: transparent; backdrop-filter: none; }
.rare-btn { color: var(--muted); }
.rare-btn[aria-pressed="true"] { background: var(--coral); color: #fff; }

.periods {
  display: flex;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  scrollbar-width: none;
  padding: 8px 12px 6px;
  scroll-padding-inline: 12px;
}
.periods::-webkit-scrollbar { display: none; }
.periods .chip { touch-action: pan-x; }
.chip {
  flex: none;
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 13px;
  border-radius: 10px;
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 2px rgba(17, 20, 24, 0.08);
  font-size: 13.5px;
  font-weight: 550;
  color: var(--ink-2);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.chip .ico { width: 15px; height: 15px; }
.chip.on { background: var(--ink); color: #fff; }
.periods.inline { margin: 0 -16px; padding: 0 16px; width: calc(100% + 32px); max-width: none; }
.periods.inline .chip { background: var(--surface-2); box-shadow: none; backdrop-filter: none; }
.periods.inline .chip.on { background: var(--ink); }

.map-tools { position: fixed; z-index: 15; right: 12px; top: calc(var(--safe-t) + 108px); display: flex; flex-direction: column; gap: 8px; }
.map-tools .round-btn { width: 40px; height: 40px; border-radius: 12px; }

/* ---------- explore sheet ---------- */

.sheet {
  position: fixed;
  z-index: 18;
  left: 0;
  right: 0;
  bottom: var(--tabs-h);
  height: calc(100dvh - var(--tabs-h) - var(--safe-t) - 116px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -1px 0 var(--line), 0 -12px 32px rgba(17, 20, 24, 0.07);
  transform: translateY(calc(100% - 120px));
  will-change: transform;
  touch-action: pan-y;
}
.sheet.animate { transition: transform 0.38s var(--ease); }
.sheet-grip { flex: none; height: 20px; display: grid; place-items: center; cursor: grab; touch-action: none; }
.sheet-grip i, .grip { display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--line-2); }
.sheet-head { flex: none; padding: 0 18px 14px; touch-action: none; cursor: grab; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 0 calc(20px + var(--safe-b)); border-top: 1px solid var(--line); }
.sh-summary p { margin-top: 2px; font-size: 15px; color: var(--ink-2); }
.sh-summary b { font-weight: 700; font-size: 22px; color: var(--ink); letter-spacing: -0.02em; }
.rare-n { display: inline-flex; align-items: center; gap: 7px; margin-top: 4px; font-size: 13px; font-weight: 500; color: var(--coral-ink); }
.rare-n i { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }
.sh-taxon { display: flex; align-items: center; gap: 12px; }
.sh-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sh-text strong { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-text .sub { color: var(--ink-2); font-size: 13.5px; }
.taxon-actions { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; }

.sec { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink); padding: 18px 18px 6px; }
.sec span { color: var(--muted); font-weight: 500; }
.sec.rare::before, .day-sec h3.rare::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }

.rows { display: flex; flex-direction: column; }
.row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 8px 18px;
  text-align: left;
  position: relative;
  content-visibility: auto;
  contain-intrinsic-size: auto 64px;
  transition: background 0.15s;
}
.row + .row::after { content: ""; position: absolute; top: 0; left: 80px; right: 18px; height: 1px; background: var(--line); }
.row:active, .row:hover { background: var(--surface-2); }
.row-text { min-width: 0; display: flex; flex-direction: column; }
.row-text strong { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 15.5px; line-height: 1.3; min-width: 0; }
.row-text strong, .row-text em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-text em { font-style: italic; font-size: 13px; color: var(--muted); }
.row.is-rare .row-text strong::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }
.row-meta { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.row-meta b { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.row.is-rare .row-meta b { color: var(--coral-ink); }
.row-meta b.dim { color: var(--muted); font-weight: 600; }
.row-meta small { font-size: 12px; color: var(--muted); white-space: nowrap; }
.row-meta small.first { color: var(--blue); font-weight: 550; }
.row.all .thumb { background: var(--ink); color: #fff; }

.thumb { width: 48px; height: 48px; border-radius: 12px; background: var(--plate); display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; color: var(--muted); }
.thumb img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.thumb .ico { width: 22px; height: 22px; opacity: 0.55; }
.thumb.mono { display: grid; place-items: center; }
.thumb.lg { width: 54px; height: 54px; border-radius: 14px; }
.thumb.xl { width: 100%; height: 100%; border-radius: 0; }
.thumb.xs { width: 24px; height: 24px; border-radius: 7px; }
.thumb.xs .ico { width: 14px; height: 14px; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 36px 24px; color: var(--ink-2); }
.empty p { max-width: 340px; }
.empty.wide { padding: 60px 24px; }

/* ---------- buttons, labels ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-2);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  white-space: nowrap;
  transition: transform 0.15s var(--ease), background 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--ink); color: #fff; box-shadow: none; }
.btn.primary:hover { background: #2a2f35; }
.btn.sm { min-height: 36px; padding: 0 13px; font-size: 13.5px; border-radius: 11px; }
.btn.wide { width: 100%; }
.badges { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.badge.rare { color: var(--coral-ink); }
.badge.rare::before { background: var(--coral); }
.badge.book { color: var(--blue); }
.badge.book::before { background: var(--blue); }
.badge.ok::before { background: #1f9d6a; }
.badge.sm { font-size: 12px; }

/* ---------- tabs ---------- */

.tabs {
  position: fixed;
  z-index: 30;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--tabs-h);
  padding-bottom: var(--safe-b);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-top: 1px solid var(--line);
}
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11.5px; font-weight: 550; position: relative; }
.tabs a .ico { width: 23px; height: 23px; }
.tabs a.on { color: var(--ink); }
.tabs a.on::before { content: ""; position: absolute; top: -1px; width: 28px; height: 2px; border-radius: 0 0 2px 2px; background: var(--ink); }

/* ---------- pages ---------- */

.page { position: fixed; z-index: 25; inset: 0 0 var(--tabs-h) 0; overflow-y: auto; overscroll-behavior: contain; background: var(--surface); -webkit-overflow-scrolling: touch; }
body[data-view="atlas"] .top, body[data-view="day"] .top,
body[data-view="atlas"] .sheet, body[data-view="day"] .sheet,
body[data-view="atlas"] .map-tools, body[data-view="day"] .map-tools { visibility: hidden; }
.page-inner { max-width: 1080px; margin: 0 auto; padding: calc(var(--safe-t) + 24px) 16px 32px; }
.page-head h1 { font-weight: 700; font-size: clamp(28px, 8vw, 44px); line-height: 1.05; letter-spacing: -0.035em; margin: 6px 0 8px; }
.lead { color: var(--ink-2); font-size: 15px; }

.atlas-tools { position: sticky; top: 0; z-index: 2; margin: 14px -16px 16px; padding: 10px 16px 10px; background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; border-radius: 14px; background: var(--surface-2); color: var(--muted); }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 16px; font-weight: 500; color: var(--ink); }
.seg { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin: 0 -16px; padding: 0 16px; }
.seg button { position: relative; height: 38px; font-size: 14.5px; font-weight: 550; color: var(--muted); }
.seg button.on { color: var(--ink); }
.seg button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--ink); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chips > button:not(.chip-t) { height: 30px; padding: 0 12px; border-radius: 9px; font-size: 13px; font-weight: 550; color: var(--ink-2); background: var(--surface-2); flex: none; }
.chips > button.on { background: var(--ink); color: #fff; }

.atlas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px 12px; }
.card { position: relative; display: flex; flex-direction: column; text-align: left; content-visibility: auto; contain-intrinsic-size: auto 240px; }
.plate { position: relative; overflow: hidden; aspect-ratio: 1; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: var(--plate); }
.plate img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.card:active .plate { transform: scale(0.98); }
.plate .mono { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); opacity: 0.35; pointer-events: none; }
.plate .mono .ico { width: 48px; height: 48px; }
.plate img.cover { object-fit: cover; }
.card-text { padding: 9px 2px 0; display: flex; flex-direction: column; min-width: 0; }
.card-text strong { display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 600; line-height: 1.25; }
.card.is-rare .card-text strong::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }
.card-text em { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-text small { margin-top: 3px; font-size: 12.5px; color: var(--ink-2); }

/* ---------- day ---------- */

.day-head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; text-align: center; touch-action: pan-y; }
.day-head .round-btn { background: var(--surface-2); box-shadow: none; backdrop-filter: none; }
.day-title h1 { font-weight: 700; font-size: clamp(32px, 9vw, 52px); letter-spacing: -0.04em; line-height: 1; margin: 6px 0 4px; }
.day-title .sub { color: var(--ink-2); }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); margin: 26px 0 18px; border-top: 1px solid var(--line); }
.stat { padding: 14px 4px 14px 0; display: flex; flex-direction: column; min-width: 0; border-bottom: 1px solid var(--line); }
.stat:nth-child(odd) { padding-right: 14px; border-right: 1px solid var(--line); }
.stat:nth-child(even) { padding-left: 16px; }
.stat b { font-weight: 700; font-size: 38px; line-height: 1.05; letter-spacing: -0.04em; }
.stat span { color: var(--ink-2); font-size: 13.5px; }
.stat small { margin-top: 3px; font-size: 12px; font-weight: 550; }
.stat small.up { color: #1f9d6a; }
.stat small.down { color: var(--muted); }
.stat.rare b { color: var(--coral-ink); }
.day-actions { display: flex; gap: 8px; margin-bottom: 20px; }
.day-actions .btn.primary { flex: 1; }
.day-actions a.btn { width: 46px; padding: 0; }
.day-sec { margin: 28px 0; }
.day-sec h3 { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 12px; }
.day-sec h3 .count { color: var(--muted); font-weight: 500; }
.day .rows { margin: 0 -18px; }
.day-map { display: block; width: 100%; padding: 8px; border-radius: 20px; background: var(--bg); }
.region-svg { width: 100%; height: auto; display: block; }
.region-svg .rg-water { fill: #6f95ab; font: italic 500 19px var(--font); }
.region-svg .rg-city { fill: #4c535a; font: 600 15px var(--font); }
.hscroll { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 8px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.rare-card { flex: 0 0 168px; scroll-snap-align: start; text-align: left; display: flex; flex-direction: column; gap: 1px; }
.rc-photo { display: grid; place-items: center; width: 168px; height: 200px; border-radius: 16px; overflow: hidden; background: var(--plate); margin-bottom: 8px; }
.rc-photo img { max-width: 92%; max-height: 92%; width: auto; height: auto; object-fit: contain; object-position: center; }
.rare-card strong { display: flex; align-items: center; gap: 7px; font-weight: 600; line-height: 1.25; }
.rare-card strong::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }
.rare-card small { color: var(--muted); font-size: 12.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chip-t { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 6px; border-radius: 11px; background: var(--surface-2); font-weight: 550; font-size: 14px; }
.people { list-style: none; margin: 0; padding: 0; counter-reset: p; display: grid; }
.people li { counter-increment: p; border-bottom: 1px solid var(--line); }
.people a { display: flex; align-items: center; gap: 12px; padding: 12px 0; color: var(--ink); }
.people a::before { content: counter(p); font-weight: 600; color: var(--muted); width: 20px; }
.people span { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.people small { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.day-skeleton { display: grid; gap: 14px; }
.day-skeleton i, .skeleton-grid i { display: block; border-radius: 16px; background: linear-gradient(90deg, var(--surface-2) 25%, #f7f8f9 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
.day-skeleton i:nth-child(1) { height: 90px; }
.day-skeleton i:nth-child(2) { height: 170px; }
.day-skeleton i:nth-child(3) { height: 320px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- photos ---------- */

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.photo-grid.big { grid-template-columns: repeat(2, 1fr); gap: 6px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--plate); display: grid; place-items: center; }
.ph img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; object-position: center; }
.ph:hover img { transform: scale(1.04); }
.ph span { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 9px 7px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.62)); color: #fff; font-size: 12px; font-weight: 550; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skeleton-grid { display: contents; }
.skeleton-grid i { aspect-ratio: 1; border-radius: 12px; }

/* ---------- panels ---------- */

.layer { position: relative; z-index: 50; }
.scrim { position: fixed; inset: 0; background: rgba(17, 20, 24, 0.32); opacity: 0; transition: opacity 0.3s; z-index: 50; }
.scrim.on { opacity: 1; }
.scrim-full { background: var(--surface); }
.panel { position: fixed; z-index: 51; background: var(--surface); outline: none; display: flex; flex-direction: column; }
.panel-sheet, .panel-viewer {
  left: 0;
  right: 0;
  bottom: 0;
  max-height: calc(100dvh - var(--safe-t) - 12px);
  border-radius: 20px 20px 0 0;
  box-shadow: var(--lift);
  transform: translateY(104%);
  transition: transform 0.4s var(--ease);
}
.panel-viewer { height: calc(100dvh - var(--safe-t) - 12px); }
.panel.on { transform: none; }
.panel.dragging { transition: none; }
.panel > .grip { position: absolute; z-index: 3; top: 8px; left: 50%; margin-left: -18px; }
.panel-viewer > .grip { background: rgba(255, 255, 255, 0.6); }
.panel-x { position: absolute; z-index: 3; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.92); box-shadow: 0 1px 4px rgba(17, 20, 24, 0.12); color: var(--ink); }
.panel-x .ico { width: 17px; height: 17px; }
.panel-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(20px + var(--safe-b)); border-radius: inherit; scrollbar-width: none; -ms-overflow-style: none; }
.panel-scroll::-webkit-scrollbar { display: none; width: 0; height: 0; }
.panel-head { padding: 30px 18px 12px; }
.panel-head h2 { font-weight: 700; font-size: 28px; letter-spacing: -0.03em; margin-top: 4px; }
.panel-head .sub { color: var(--ink-2); }
.panel-full { inset: 0; background: var(--surface); opacity: 0; transform: translateY(14px); transition: opacity 0.22s, transform 0.3s var(--ease); }
.panel-full.on { opacity: 1; transform: none; }

/* species — квадрат во всю ширину шторки (как раньше), птица по центру */
.sp-hero { position: relative; width: 100%; aspect-ratio: 1; margin: 0; flex: none; display: flex; align-items: center; justify-content: center; background: var(--plate); border-radius: 20px 20px 0 0; overflow: hidden; box-sizing: border-box; }
.sp-hero-pic { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; margin: 0; }
.sp-hero-pic img { max-width: 88%; max-height: 88%; width: auto; height: auto; object-fit: contain; object-position: center; animation: rise 0.6s var(--ease) both; }
.sp-hero > img { max-width: 88%; max-height: 88%; width: auto; height: auto; object-fit: contain; object-position: center; }
.sp-hero-mono { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); opacity: 0.3; pointer-events: none; }
.sp-hero-mono .ico { width: 64px; height: 64px; }
.sp-hero img.sp-hero-photo { position: relative; z-index: 1; max-width: 88%; max-height: 88%; width: auto; height: auto; object-fit: contain; }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
.sp-body { padding: 20px 18px 8px; }
.sp-title h2 { font-weight: 700; font-size: clamp(28px, 8vw, 36px); line-height: 1.05; letter-spacing: -0.035em; }
.sp-title .la { font-style: italic; color: var(--ink-2); margin: 6px 0 12px; }
.sp-title .la span { font-style: normal; color: var(--muted); }
.sp-stats { display: grid; grid-template-columns: 1fr 1fr; margin: 20px 0; border-top: 1px solid var(--line); }
.sp-stats div { padding: 12px 0; display: flex; flex-direction: column; border-bottom: 1px solid var(--line); }
.sp-stats div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
.sp-stats b { font-weight: 700; font-size: 24px; letter-spacing: -0.03em; }
.sp-stats span { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.sp-actions { display: flex; gap: 8px; }
.sp-actions .btn.primary { flex: 1; }
.sp-actions .btn:not(.primary) { width: 46px; padding: 0; }
.sp-section { margin-top: 30px; }
.sp-section h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 14px; }
.season { display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px; height: 110px; align-items: end; }
.season .bar { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.season .bar i { display: block; width: 100%; border-radius: 5px; background: #d5dade; min-height: 2px; }
.season .bar.now i { background: var(--ink); }
.season .bar span { font-size: 11px; font-weight: 550; color: var(--muted); }
.season .bar.now span { color: var(--ink); }
.season + .note { margin-top: 10px; }
.links { display: flex; flex-direction: column; margin: 24px 0 6px; border-top: 1px solid var(--line); }
.links a { display: flex; align-items: center; gap: 10px; font-weight: 550; padding: 13px 0; border-bottom: 1px solid var(--line); }
.links .ico { width: 17px; height: 17px; }

/* viewer */
.panel-viewer .panel-scroll { overflow-x: hidden; min-width: 0; }
.photo-stage { position: relative; }
.photo-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.photo-nav.prev { left: 10px; }
.photo-nav.next { right: 10px; }
.photo-nav .ico { width: 20px; height: 20px; }
.photo-nav:disabled { opacity: 0; pointer-events: none; }
.carousel {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  touch-action: pan-y;
  scrollbar-width: none;
  background: #0b0c0d;
  border-radius: 20px 20px 0 0;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel figure {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  margin: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  aspect-ratio: 4 / 3.3;
  max-height: 56vh;
  display: grid;
  place-items: center;
}
.carousel img { width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none; user-select: none; pointer-events: none; }
.carousel .no-photo { color: #8b9198; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.carousel .no-photo .ico { width: 40px; height: 40px; }
.dots { display: flex; justify-content: center; gap: 6px; padding: 12px 0 0; }
.dots button { width: 8px; height: 8px; padding: 0; border-radius: 50%; background: var(--line-2); transition: background 0.2s, transform 0.2s; }
.dots button.on { background: var(--ink); transform: scale(1.25); }
.obs-body { padding: 14px 18px 6px; display: flex; flex-direction: column; gap: 14px; }
.obs-species { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; }
.obs-species span { display: flex; flex-direction: column; }
.obs-species strong { font-weight: 700; font-size: 25px; letter-spacing: -0.03em; line-height: 1.12; }
.obs-species em { color: var(--ink-2); }
.obs-species > .ico { color: var(--muted); }
.facts { margin: 0; display: grid; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; padding: 11px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); padding-top: 1px; }
.facts dt .ico { width: 18px; height: 18px; }
.facts dd { margin: 0; color: var(--ink); line-height: 1.45; word-break: break-word; }
audio { width: 100%; height: 40px; }
.obs-actions { display: flex; gap: 8px; margin-top: 4px; }
.obs-actions .btn.primary { flex: 1; }
.obs-actions .btn:not(.primary) { width: 46px; padding: 0; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 14px 0 4px; font-weight: 600; color: var(--ink-2); }
.stepper button { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); }
.viewer-loading { height: 50vh; display: grid; place-items: center; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid var(--surface-2); border-top-color: var(--ink); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-note { padding: 60px 24px; text-align: center; color: var(--ink-2); }

/* search */
.search-bar { flex: none; display: flex; align-items: center; gap: 6px; padding: calc(var(--safe-t) + 10px) 12px 10px; border-bottom: 1px solid var(--line); }
.search-bar input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border: 0; border-radius: 14px; background: var(--surface-2); font-size: 16px; font-weight: 500; outline: none; }
.search-bar input:focus { box-shadow: inset 0 0 0 1.5px var(--ink); background: var(--surface); }
.panel-full .panel-scroll { padding: 0 0 calc(24px + var(--safe-b)); }

/* range calendar */
.range-form { padding: 2px 18px 10px; display: grid; gap: 14px; }
.cal-ends { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cal-end {
  text-align: left;
  padding: 10px 12px 11px;
  border-radius: 14px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.cal-end.on { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--ink); }
.cal-end span { font-size: 12px; font-weight: 550; color: var(--muted); }
.cal-end b { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-hint { margin: -6px 0 0; font-size: 13px; color: var(--muted); }
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cal-nav strong { font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.cal-nav button {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--ink);
}
.cal-nav button .ico { width: 18px; height: 18px; }
.cal-wd, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-wd { margin-bottom: 4px; }
.cal-wd span { text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 0; }
.cal-grid { row-gap: 2px; }
.cal-pad { height: 42px; }
.cal-day {
  position: relative;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-weight: 550;
  font-size: 15px;
  background: none;
}
.cal-day .n {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
}
.cal-day.in::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  right: 0;
  background: var(--surface-2);
}
.cal-day.cap-l::before { border-radius: 12px 0 0 12px; }
.cal-day.cap-r::before { border-radius: 0 12px 12px 0; }
.cal-day.cap-l.cap-r::before { border-radius: 12px; }
.cal-day.edge-a::before { left: 22%; }
.cal-day.edge-b::before { right: 22%; }
.cal-day.edge-a.edge-b::before { display: none; }
.cal-day.edge-a .n, .cal-day.edge-b .n { background: var(--ink); color: #fff; }
.cal-day.today .n { box-shadow: inset 0 0 0 1.5px var(--line-2); }
.cal-day.we:not(.edge-a):not(.edge-b) { color: var(--ink-2); }
.cal-day:disabled { color: var(--muted); opacity: 0.28; }
.cal-day:disabled.in::before { display: none; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick .chip { background: var(--surface-2); box-shadow: none; backdrop-filter: none; }

/* about */
.about { padding: 34px 20px 10px; }
.about-logo { width: 56px; height: 56px; }
.about h2 { font-weight: 700; font-size: 32px; letter-spacing: -0.035em; margin: 14px 0 4px; }
.about .lead { margin-bottom: 14px; font-weight: 500; color: var(--ink); }
.about p { margin-bottom: 12px; color: var(--ink-2); }
.about h3 { font-size: 17px; font-weight: 700; margin: 26px 0 12px; }
.about-stats { display: grid; grid-template-columns: 1fr 1fr; margin: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.about-stats div { padding: 12px 0; display: flex; flex-direction: column; }
.about-stats div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.about-stats b { font-weight: 700; font-size: 28px; letter-spacing: -0.03em; }
.about-stats span { font-size: 13px; color: var(--ink-2); }
.partners { display: flex; flex-direction: column; gap: 8px; }
.partners a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 650;
}
.partners img { height: 28px; width: auto; }
.partners img.bubo { height: 44px; width: 44px; object-fit: contain; }
.about-copy { margin-top: 22px; color: var(--muted); font-size: 13px; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; color: var(--ink-2); }
.legend li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; }
.lg-ring { width: 34px; height: 34px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 2px var(--ink); }
.lg-ring.rare { box-shadow: 0 0 0 2px var(--coral), 0 0 0 8px rgba(255, 90, 54, 0.18); }
.lg-num { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-style: normal; font-weight: 700; font-size: 11.5px; display: grid; place-items: center; margin-left: 5px; }

/* toast, splash */
.toast { position: fixed; z-index: 80; left: 50%; bottom: calc(var(--tabs-h) + 140px); transform: translate(-50%, 10px); padding: 11px 16px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 550; font-size: 14px; opacity: 0; transition: opacity 0.2s, transform 0.25s var(--ease); pointer-events: none; max-width: calc(100vw - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.splash { position: fixed; z-index: 100; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: var(--surface); transition: opacity 0.45s, visibility 0.45s; }
.splash svg { width: 64px; height: 64px; animation: pulse 1.6s ease-in-out infinite; }
.splash strong { font-weight: 700; font-size: 26px; letter-spacing: -0.03em; }
.splash span { color: var(--muted); }
body.ready .splash { opacity: 0; visibility: hidden; }
@keyframes pulse { 50% { transform: scale(0.94); } }

/* ---------- desktop ---------- */

@media (min-width: 900px) {
  :root { --tabs-h: 0px; }
  .top { left: 16px; right: auto; width: 400px; padding-top: 16px; }
  .top-row { padding: 0; }
  .periods { padding: 10px 0 4px; }
  .sheet {
    left: 16px;
    right: auto;
    top: 124px;
    bottom: 16px;
    width: 400px;
    height: auto;
    border-radius: 20px;
    transform: none !important;
    box-shadow: var(--lift);
  }
  .sheet-grip { display: none; }
  .sheet-head { padding-top: 16px; cursor: default; }
  .tabs {
    top: 16px;
    right: 16px;
    left: auto;
    bottom: auto;
    width: 340px;
    height: 44px;
    padding: 4px;
    border-radius: 14px;
    border: 0;
    box-shadow: var(--float);
  }
  .tabs a { flex-direction: row; gap: 7px; font-size: 13.5px; border-radius: 10px; }
  .tabs a .ico { width: 18px; height: 18px; }
  .tabs a.on { background: var(--ink); color: #fff; }
  .tabs a.on::before { display: none; }
  .map-tools { top: 72px; right: 16px; }
  .maplibregl-ctrl-bottom-right, body[data-view="map"] .maplibregl-ctrl-bottom-right { bottom: 4px; }
  .page { inset: 0; }
  .page-inner { padding: 84px 32px 48px; }
  .atlas-tools { flex-direction: row; flex-wrap: wrap; align-items: center; margin: 18px -32px 22px; padding: 12px 32px; }
  .atlas-tools .field { flex: 1 1 260px; }
  .atlas-tools .periods.inline { flex: 1 1 100%; order: 3; margin: 0; padding: 0; }
  .atlas-tools .seg { flex: 0 0 auto; margin: 0; padding: 0; border: 0; }
  .atlas-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 26px 16px; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .stat, .stat:nth-child(odd), .stat:nth-child(even) { padding: 16px 18px; border-right: 1px solid var(--line); }
  .stat:first-child { padding-left: 0; }
  .stat:last-child { border-right: 0; }
  .photo-grid.big { grid-template-columns: repeat(4, 1fr); }
  .day .rows { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
  .people { grid-template-columns: 1fr 1fr; column-gap: 32px; }
  .panel-sheet, .panel-viewer {
    left: auto;
    top: 12px;
    right: 12px;
    bottom: 12px;
    width: 470px;
    height: auto;
    max-height: none;
    border-radius: 20px;
    transform: translateX(calc(100% + 24px));
  }
  .panel.on { transform: none; }
  .panel > .grip { display: none; }
  .panel-full { inset: 0 auto 0 0; width: 432px; box-shadow: var(--lift); }
  .scrim-full { background: rgba(17, 20, 24, 0.18); }
  .toast { bottom: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
