@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 ---------- */

#pull-refresh {
  position: fixed;
  z-index: 40;
  left: 50%;
  top: calc(var(--safe-t) + 6px);
  transform: translate(-50%, -130%);
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--glass);
  box-shadow: var(--float);
  backdrop-filter: blur(16px);
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-2);
  pointer-events: none;
  white-space: nowrap;
}
#pull-refresh.is-show { transform: translate(-50%, var(--pull, 0px)); }
#pull-refresh.is-go { color: var(--ink); }
.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: 48px; }
.search-pill.picked .search-text { font-weight: 650; }
.pill-clear { position: absolute; right: 58px; 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; }
.atlas-tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 19;
  pointer-events: none;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--float);
  font-size: 13px;
  line-height: 1.35;
  min-width: 190px;
  max-width: 260px;
}
.atlas-tip[hidden] { display: none; }
.atlas-tip strong { display: block; font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.tip-row { display: flex; align-items: center; gap: 10px; }
.tip-row b { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.tip-row small { display: block; color: var(--muted); font-size: 12px; }
.tip-empty { color: var(--muted); }
.atlas-key { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 12.5px; color: var(--ink-2); }
.atlas-key li { display: flex; align-items: center; gap: 8px; }
.atlas-key i { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(17, 20, 24, 0.08); }
.atlas-key b { margin-left: auto; padding-left: 12px; color: var(--ink); font-weight: 700; }
.tip-key { list-style: none; margin: 10px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line); display: grid; gap: 4px; font-size: 12px; color: var(--ink-2); }
.tip-key li { display: flex; align-items: center; gap: 7px; }
.tip-key i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tip-key b { margin-left: auto; padding-left: 10px; color: var(--ink); }
.atlas-key.wide { gap: 8px; font-size: 14px; }
.atlas-key.wide i { width: 12px; height: 12px; }

.atlas-card {
  position: fixed;
  right: 12px;
  bottom: 28px;
  z-index: 4;
  width: 236px;
  padding: 10px 12px 12px;
  border-radius: 18px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--float);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.atlas-seg { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 11px; background: var(--surface-2); }
.atlas-seg button { height: 28px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); transition: background 0.15s, color 0.15s; }
.atlas-seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(17, 20, 24, 0.1); }
.atlas-card-note { margin: 0; font-size: 11.5px; line-height: 1.35; color: var(--muted); }
.atlas-sync-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.atlas-sync-note .ico { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.72; }
.atlas-sync-note time { font-variant-numeric: tabular-nums; }
.atlas-card-progress { display: grid; gap: 5px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }
.atlas-card-progress b { color: var(--ink); }
.atlas-card-progress small { font-size: 11.5px; color: var(--muted); }
.atlas-card-progress .bar { display: block; height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.atlas-card-progress .bar i { display: block; height: 100%; border-radius: 2px; background: var(--ink); transition: width 0.6s var(--ease); }

.atlas-mix { margin-top: 16px; display: grid; gap: 12px; }
.atlas-mix-bar { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; }
.atlas-mix-bar i { min-width: 3px; }
.atlas-filter { padding: 4px 18px 6px; gap: 5px; }
.atlas-sq-search { margin: 10px 18px 6px; }
.chips.atlas-filter > button:not(.chip-t) { flex: 1 1 auto; padding: 0 8px; white-space: nowrap; }
@media (max-width: 420px) {
  .chips.atlas-filter > button:not(.chip-t) { padding: 0 6px; }
  .atlas-filter span { display: none; }
}
.atlas-filter span { margin-left: 3px; opacity: 0.6; font-weight: 500; }
.atlas-row .row-text small.atlas-when { margin-top: 2px; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atlas-row .row-meta { gap: 4px; }
.st-pill { min-width: 26px; height: 22px; padding: 0 6px; border-radius: 7px; display: inline-grid; grid-auto-flow: column; place-items: center; font-size: 12px; font-weight: 750; line-height: 1; color: var(--ink); }
.st-pill:not(.st-wx) { position: relative; top: -1.5px; }
.st-pills { display: flex; gap: 4px; justify-content: flex-end; }
.st-pill.st-wx { min-width: 22px; padding: 0 4px; background: #e3edfb; color: #2d5fcf; }
.st-pill.st-wx svg { width: 13px; height: 13px; }
.st-pill.inline { height: 18px; min-width: 18px; vertical-align: -4px; }
.st-pill.st-D { background: #e2462f; color: #fff; }
.st-pill.st-C { background: #f58b3c; color: #fff; }
.st-pill.st-B { background: #f7c94b; }
.st-pill.st-A { background: #f6e9b0; }
.st-pill.st-M { background: #c5d8f5; color: #1e4a8f; }
.st-pill.st-W { background: #9fc8ec; color: #1e4a8f; }
.atlas-square-panel .note { margin: 16px 18px 24px; }
.atlas-square-panel .note b { color: var(--ink-2); }
.atlas-sq-legend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.atlas-sq-legend-list > li { display: grid; grid-template-columns: 2.25rem 1fr; gap: 10px; align-items: start; line-height: 1.45; }
.atlas-sq-legend-k { display: flex; justify-content: center; align-items: center; min-height: 22px; }
.atlas-sq-legend-foot { margin: 14px 0 0; line-height: 1.45; }
.atlas-sheet-intro { padding: 14px 18px 8px; display: grid; gap: 14px; color: var(--ink-2); font-size: 14px; }
.atlas-sheet-intro .atlas-mix { margin-top: 0; }
.atlas-top .atlas-top-pie { background: var(--surface-2); }
.atlas-top.on { background: var(--surface-2); }
@media (min-width: 900px) {
  .atlas-mobile-key { display: none; }
}
@media (max-width: 899px) {
  .atlas-card {
    top: calc(var(--safe-t) + 62px);
    bottom: auto;
    left: 64px;
    right: 64px;
    width: auto;
    padding: 8px 8px 10px;
    gap: 8px;
  }
  .atlas-card .atlas-key, .atlas-card .atlas-card-note:not(:last-child) { display: none; }
  .atlas-card .atlas-card-note { padding: 0 4px; font-size: 12px; }
  .atlas-card .atlas-card-progress { margin-top: 0; padding-top: 7px; }
}
#atlas-squares-toggle,
#photo-toggle,
#sound-toggle { color: var(--muted); }
#atlas-squares-toggle.picked,
#atlas-squares-toggle[aria-pressed="true"],
#photo-toggle[aria-pressed="true"],
#sound-toggle[aria-pressed="true"] { background: var(--coral); color: #fff; }

.top.atlas-map .periods { display: none; }
.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; }
.round-btn.has-tip { position: relative; }
.round-btn.has-tip::after {
  content: attr(data-tip);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) scale(0.96);
  padding: 7px 11px;
  border-radius: 10px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--float);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s var(--ease), transform 0.15s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .round-btn.has-tip:hover::after,
  .round-btn.has-tip:focus-visible::after {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
}
html.is-touch .round-btn.has-tip::after { content: none; }

/* ---------- 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; user-select: 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; user-select: none; }
.sheet-head .src { user-select: text; }
.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); }
.src-help { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-left: 6px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); vertical-align: -3px; }
.src-help .ico { width: 16px; height: 16px; }
.src-help[aria-expanded="true"] { color: var(--ink); }
.src { display: block; margin: 6px 0 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.src a { color: var(--ink); text-underline-offset: 2px; }

#news { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px 16px calc(16px + var(--safe-b)); }
#news[hidden] { display: none; }
.news-backdrop { position: absolute; inset: 0; background: rgba(17, 20, 24, 0.28); }
.news-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  max-height: min(78vh, 640px);
  overflow: hidden;
  padding: 18px 18px 16px;
  border-radius: 22px;
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--lift);
}
.news-scroll { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.news-card > .btn { flex: none; margin-top: 14px; }
.news-card h2 { margin: 2px 0 14px; font-size: 22px; letter-spacing: -0.03em; }
.news-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.news-list li { display: grid; gap: 3px; }
.news-list time { font-size: 12px; font-weight: 650; color: var(--muted); }
.news-list li.is-new time { color: var(--coral); }
.news-list strong { font-size: 15px; letter-spacing: -0.01em; }
.news-list p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.about-news-fold { margin: 14px 0 18px; }
.about-news-fold .about-feedback-sum::after { margin-top: 0; transform: translateY(-2px) rotate(45deg); }
.about-news-fold[open] > .about-feedback-sum::after { margin-top: 0; transform: translateY(2px) rotate(-135deg); }
.about-news-fold .news-list { margin: 0; }
.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-taxon + .src { margin-top: 8px; }
.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 minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 8px 18px;
  text-align: left;
  position: relative;
  content-visibility: auto;
  contain-intrinsic-size: auto 72px;
  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; gap: 1px; }
.row-text strong {
  position: relative;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.28;
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: break-word;
}
.row-text em {
  font-style: italic;
  font-size: 13px;
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row.is-rare .row-text strong { padding-left: 14px; }
.row.is-rare .row-text strong::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.42em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
}
.row-meta { display: flex; flex-direction: column; align-items: flex-end; text-align: right; flex: none; }
.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(--ink-2); }
.badge.book::before { display: none; }
.badge.book .st-mark { width: 16px; height: 16px; flex: none; }
.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-x: clip; 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; }
.chips > button.st { width: 30px; padding: 0; background: transparent; border-radius: 50%; display: grid; place-items: center; }
.chips > button.st .st-mark { width: 22px; height: 22px; display: block; }
.chips > button.st.on { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink); }
.book-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.3; }
.book-legend span { display: inline-flex; align-items: center; gap: 6px; }
.book-legend .st-mark { width: 16px; height: 16px; flex: none; }
.book-legend button { color: var(--ink-2); font-size: 12.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

.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; }
.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-text strong .st-mark { width: 16px; height: 16px; flex: none; }
.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-pick { display: block; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.day-pick h1 { 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:has(> .hscroll) { overflow: hidden; }
.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; scroll-padding-inline: 16px; margin: 0 -16px -17px; padding: 2px 16px 25px; scrollbar-width: none; -ms-overflow-style: none; }
.hscroll::-webkit-scrollbar { display: none; width: 0; height: 0; }
.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; }
.rc-photo .no-photo { color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 13px; }
.rc-photo .no-photo .ico { width: 36px; height: 36px; }
.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, .people .who { display: flex; align-items: center; gap: 12px; padding: 12px 0; color: var(--ink); }
.people a::before, .people .who::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; }
.audio-list { display: grid; gap: 6px; }
.audio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-2);
  text-align: left;
}
.audio-row .ico { width: 18px; height: 18px; color: var(--ink-2); flex: none; }
.audio-row span { display: flex; flex-direction: column; min-width: 0; }
.audio-row b { font-size: 14px; font-weight: 650; }
.audio-row small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.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: 5; 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); touch-action: manipulation; }
.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; }
.carousel.is-plate { background: var(--surface-2); }
.carousel .plate-stage { aspect-ratio: 16 / 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.carousel .plate-stage img { width: auto; height: 68%; max-width: 70%; }
.carousel .plate-stage .ico { width: 56px; height: 56px; opacity: 0.5; }
.carousel .plate-stage span { font-size: 13px; font-weight: 600; letter-spacing: 0.01em; }
.obs-note { margin: 12px 0 4px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); font-size: 14px; line-height: 1.45; white-space: pre-line; }
.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-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 6px 12px 6px 6px;
  border-radius: 16px;
  background: var(--surface-2);
  box-sizing: border-box;
}
.audio-bar audio { display: none; }
.audio-play {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 12px;
  background: var(--ink);
  color: var(--surface);
  display: grid;
  place-items: center;
}
.audio-play .ico { width: 16px; height: 16px; }
.audio-play.on { display: flex; align-items: center; justify-content: center; gap: 3px; }
.audio-play.on .ico { display: none; }
.audio-play.on::before,
.audio-play.on::after {
  content: "";
  width: 3px;
  height: 12px;
  border-radius: 1px;
  background: currentColor;
}
.audio-time, .audio-dur {
  flex: none;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-2);
  min-width: 2.6em;
}
.audio-dur { text-align: right; color: var(--muted); }
.audio-seek {
  flex: 1;
  min-width: 0;
  height: 4px;
  margin: 0;
  accent-color: var(--ink);
  cursor: pointer;
}
.obs-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.obs-actions .btn.primary { flex: 1; }
.obs-actions .btn.wide { flex: 1 1 100%; }
.obs-actions .btn:not(.primary):not(.wide) { 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; }
#work-veil {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.55);
  pointer-events: all;
}
#work-veil[hidden] { display: none; }
#work-veil p { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-2); }
@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; }
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-right: 0;
  cursor: pointer;
  background: center / 14px 14px no-repeat url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6 6l12 12M18 6 6 18' fill='none' stroke='%23111418' stroke-width='2.2' stroke-linecap='round'/></svg>");
}
.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, .cal-title { font-weight: 700; font-size: 17px; letter-spacing: -0.02em; white-space: nowrap; }
.cal-title { width: auto; height: auto; padding: 6px 10px; border-radius: 12px; background: transparent; display: block; }
.cal-years { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cal-years .cal-day { height: 48px; }
.cal-years .n { width: auto; min-width: 64px; padding: 0 8px; }
.cal-nav button:not(.cal-title) {
  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-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.about-logo { width: 56px; height: 56px; flex: none; }
.about h2 { font-weight: 700; font-size: 32px; letter-spacing: -0.035em; margin: 0; }
.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-synced { display: flex; align-items: center; gap: 7px; margin: 12px 0 16px; }
.about-synced .ico { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.72; }
.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.mark { height: 44px; width: 44px; object-fit: contain; }
.partners img.mark.round { border-radius: 50%; object-fit: cover; }
.partners img.mark.wide-logo { width: auto; height: 56px; max-width: min(72vw, 220px); }
.partners a span { min-width: 0; line-height: 1.25; }
.about-tg-packs {
  margin-top: 18px;
  padding: 16px 14px;
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(255, 90, 54, 0.07), rgba(17, 20, 24, 0.02));
  box-shadow: inset 0 0 0 1px var(--line);
}
.about-tg-kicker {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.about-tg-group + .about-tg-group { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.about-tg-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.about-tg-links { display: grid; gap: 8px; }
.about-tg-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s var(--ease), transform 0.15s var(--ease);
}
.about-tg-links a:active { transform: scale(0.99); background: var(--surface-2); }
.about-tg-links img.mark { width: 36px; height: 36px; flex: none; padding: 6px; border-radius: 10px; background: #2aabee; box-sizing: border-box; }
.about-tg-links span { min-width: 0; line-height: 1.25; }
.about-donate {
  margin-top: 22px;
  padding: 18px 16px 16px;
  border-radius: 18px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.about-donate strong { font-size: 16px; font-weight: 650; letter-spacing: -0.02em; }
.about-donate img {
  width: min(168px, 52vw);
  height: auto;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.about-donate span { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.about-copy { margin-top: 22px; color: var(--muted); font-size: 13px; }
.about-copy.about-map-attrib { margin-top: 6px; }
.about-notes { margin-top: 14px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.about-notes span { display: block; }
.about-notes span + span { margin-top: 6px; }
.about sup { font-size: 0.7em; }
.about-feedback-fold { margin: 26px 0 8px; border-radius: 14px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.about-feedback-fold > summary { list-style: none; cursor: pointer; }
.about-feedback-fold > summary::-webkit-details-marker { display: none; }
.about-feedback-sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  user-select: none;
}
.about-feedback-sum-text { display: grid; gap: 4px; min-width: 0; text-align: left; }
.about-feedback-sum strong { font-size: 17px; font-weight: 700; color: var(--ink); }
.about-feedback-sum small { font-size: 13px; font-weight: 450; color: var(--muted); line-height: 1.35; }
.about-feedback-sum::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s var(--ease);
}
.about-feedback-fold[open] > .about-feedback-sum::after { transform: rotate(-135deg); margin-top: 8px; }
.about-feedback-body { padding: 0 16px 16px; }
.about-feedback-fold[open] .about-feedback-body { padding-top: 2px; }
.about-feedback { display: grid; gap: 12px; }
.about-field { display: grid; gap: 6px; font-size: 13px; font-weight: 550; color: var(--ink-2); }
.about-field input,
.about-field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: none;
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-2);
  resize: vertical;
  min-height: 48px;
}
.about-field input::placeholder,
.about-field textarea::placeholder { color: var(--muted); }
.about-field textarea { min-height: 120px; line-height: 1.45; }
.about-field input:focus-visible,
.about-field textarea:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--ink);
}
.about-feedback-err { margin: 0; font-size: 13px; color: #c63; }
.about-feedback-ok {
  margin: 4px 0 18px;
  padding: 16px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 14px;
  color: var(--ink-2);
}
.about-feedback-ok strong { color: var(--ink); }
.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); }
#splash-pct { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--muted); }
.splash-birds { display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 46px; }
.splash.has-birds #splash-pct { display: none; }
.splash-bird { position: relative; width: 32px; height: 44px; flex: none; }
.splash-bird img { position: absolute; left: 0; bottom: 0; width: 32px; height: 44px; object-fit: contain; object-position: center bottom; }
.splash-bird .dim { filter: grayscale(1); opacity: 0.28; }
.splash-bird i { position: absolute; left: 0; bottom: 0; height: 100%; width: 0; overflow: hidden; }
.splash-bar { width: min(240px, 70vw); height: 4px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.splash.has-birds .splash-bar { display: none; }
.splash-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--ink); transition: width 0.35s var(--ease); }
.splash.is-creep .splash-bar i { transition: width 0.12s linear; }
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: var(--sheet-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; }
}
