/* Котките от квартала — стилове */

@font-face { font-family: "Sofia Sans"; font-weight: 400; font-display: swap; src: url(../fonts/sofia-sans-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Sofia Sans"; font-weight: 400; font-display: swap; src: url(../fonts/sofia-sans-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Sofia Sans"; font-weight: 600; font-display: swap; src: url(../fonts/sofia-sans-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Sofia Sans"; font-weight: 600; font-display: swap; src: url(../fonts/sofia-sans-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Sofia Sans"; font-weight: 700; font-display: swap; src: url(../fonts/sofia-sans-cyrillic-700-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Sofia Sans"; font-weight: 700; font-display: swap; src: url(../fonts/sofia-sans-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Sofia Sans XC"; font-weight: 800; font-display: swap; src: url(../fonts/sofia-sans-extra-condensed-cyrillic-800-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Sofia Sans XC"; font-weight: 800; font-display: swap; src: url(../fonts/sofia-sans-extra-condensed-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --paper: #f2f4f1;
  --surface: #ffffff;
  --ink: #1c2333;
  --muted: #5d6574;
  --line: #d9ded8;
  --blue: #2547a8;
  --blue-soft: #e4e9f6;
  --red: #c3302b;
  --red-soft: #f8e4e2;
  --green: #2d7a4e;
  --green-soft: #e1efe6;
  --amber: #b8730f;
  --amber-soft: #f7ecd9;

  --font: "Sofia Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Sofia Sans XC", "Sofia Sans", "Arial Narrow", sans-serif;

  --r-photo: 14px;
  --r-ctl: 10px;
  --nav-h: 64px;
  --wrap: 1120px;
  --blue-hover: #1c3a8f;
  --on-accent: #ffffff;
  --ph: #e3e7e2;
  --ph-ink: #9aa39b;
  --map-bg: #e8ebe7;
  color-scheme: light;
}

/* тъмен режим: по избор (бутон) или според настройката на телефона */
:root[data-theme="dark"] {
  --paper: #11151d;
  --surface: #1a202b;
  --ink: #e6e9ef;
  --muted: #a2a9b6;
  --line: #2c3442;
  --blue: #8ea8f3;
  --blue-hover: #a9bdf6;
  --blue-soft: #1f2b4a;
  --red: #f07a73;
  --red-soft: #3a1d1e;
  --green: #66c290;
  --green-soft: #17301f;
  --amber: #e5a84c;
  --amber-soft: #352919;
  --on-accent: #0f1420;
  --ph: #252c38;
  --ph-ink: #5d6778;
  --map-bg: #1d232d;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #11151d;
    --surface: #1a202b;
    --ink: #e6e9ef;
    --muted: #a2a9b6;
    --line: #2c3442;
    --blue: #8ea8f3;
    --blue-hover: #a9bdf6;
    --blue-soft: #1f2b4a;
    --red: #f07a73;
    --red-soft: #3a1d1e;
    --green: #66c290;
    --green-soft: #17301f;
    --amber: #e5a84c;
    --amber-soft: #352919;
    --on-accent: #0f1420;
    --ph: #252c38;
    --ph-ink: #5d6778;
    --map-bg: #1d232d;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.5 var(--font);
  font-feature-settings: "locl";
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.1; }
p { margin: 0 0 .8em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ шапка и навигация */
.top {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 900;
}
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand img { width: 48px; height: 28px; flex: none; }
.brand b { font: 800 27px/1 var(--display); letter-spacing: .005em; }
.top-user { display: flex; align-items: center; gap: 8px; }

.nav { display: flex; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 12px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 16px;
}
.nav a svg { width: 20px; height: 20px; }
.nav a[aria-current="page"] { color: var(--blue); background: var(--blue-soft); }
.nav a:hover { color: var(--ink); }

@media (max-width: 760px) {
  body { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 950;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around; gap: 0;
  }
  .nav a { flex-direction: column; gap: 2px; padding: 6px 8px; font-size: 12.5px; border-radius: 12px; min-width: 64px; }
  .nav a svg { width: 23px; height: 23px; }
  .top .wrap { min-height: 54px; }
  .brand b { font-size: 24px; }
  .brand img { width: 42px; height: 24px; }
}

/* ------------------------------------------------------------ бутони и полета */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .1s;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: var(--on-accent); }
.btn.primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.btn.red { background: var(--red); border-color: var(--red); color: var(--on-accent); }
.btn.green { background: var(--green); border-color: var(--green); color: var(--on-accent); }
.btn.on { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 15px; }
.btn.icon { width: 46px; padding: 0; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.block { width: 100%; }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > span { font-weight: 700; font-size: 15px; }
.field small { color: var(--muted); font-size: 14px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 12px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-ctl);
}
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px var(--blue-soft); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1 1 180px; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 600;
}
.seg input:checked + span { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.seg input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }

.check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--blue); flex: none; }

/* ------------------------------------------------------------ печати */
.stamps { display: flex; flex-wrap: wrap; gap: 6px; }
.stamp {
  --c: var(--blue);
  display: inline-block;
  padding: 3px 9px 2px;
  font: 800 17px/1.1 var(--display);
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--c);
  border: 2.5px solid var(--c);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1.5px var(--surface), inset 0 0 0 3px var(--c);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  transform: rotate(var(--tilt, -3deg));
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.75'/%3E%3C/filter%3E%3Crect width='120' height='60' filter='url(%23n)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.75'/%3E%3C/filter%3E%3Crect width='120' height='60' filter='url(%23n)'/%3E%3C/svg%3E");
  -webkit-mask-size: 120px 60px; mask-size: 120px 60px;
  white-space: nowrap;
}
.stamp:nth-child(2n) { --tilt: 2deg; }
.stamp:nth-child(3n) { --tilt: -1.5deg; }
.stamp.blue { --c: var(--blue); }
.stamp.red { --c: var(--red); }
.stamp.green { --c: var(--green); }
.stamp.amber { --c: var(--amber); }
.stamp.grey { --c: var(--muted); }
.stamp.big { font-size: 24px; padding: 4px 12px 3px; border-width: 3px; }

/* ------------------------------------------------------------ каталог */
.page { padding-top: 22px; padding-bottom: 40px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font: 800 44px/0.95 var(--display); }
.lede { color: var(--muted); max-width: 60ch; margin-top: 8px; }

.urgent-box {
  border: 2px solid var(--red); background: var(--red-soft);
  border-radius: var(--r-photo); padding: 14px; margin-bottom: 22px;
}
.urgent-box h2 { font: 800 26px/1 var(--display); color: var(--red); margin-bottom: 10px; }
.urgent-list { display: grid; gap: 10px; }
.urgent-item { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); }
.urgent-item img, .urgent-item .ph { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; }
.urgent-item b { font: 800 22px/1 var(--display); display: block; }
.urgent-item span { font-size: 15px; }

.tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.search { flex: 1 1 220px; position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; translate: 0 -50%; width: 20px; height: 20px; color: var(--muted); }
.search input { padding-left: 40px; border-radius: 999px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px; margin: 0 -16px 18px; padding: 2px 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip .n { color: var(--muted); font-weight: 400; margin-left: 4px; }
.chip[aria-pressed="true"] .n { color: var(--paper); opacity: .7; }

.grid { display: grid; gap: 26px 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr 1fr; gap: 20px 12px; } }

.card { color: var(--ink); text-decoration: none; display: block; }
.card .pic { position: relative; aspect-ratio: 1; border-radius: var(--r-photo); overflow: hidden; background: var(--line); }
.card .pic img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .pic img { transform: scale(1.03); }
.card .pic .stamps { position: absolute; left: 8px; bottom: 10px; right: 8px; gap: 5px; }
.card .pic .stamp { font-size: 15px; }
.card h3 { font: 800 30px/1 var(--display); margin: 10px 0 2px; }
.card .facts { font-size: 15px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0 10px; }
.card .seen { font-size: 15px; margin-top: 3px; display: flex; align-items: flex-start; gap: 6px; }
.card .seen .dot { margin-top: .5em; }
.card.dim .pic { filter: grayscale(.85); }
@media (max-width: 520px) {
  .card h3 { font-size: 25px; }
  .card .pic .stamp { font-size: 13px; padding: 2px 6px 1px; border-width: 2px; }
  .card .facts, .card .seen { font-size: 14px; }
}

.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex: none; }
.dot.amber { background: #e2a336; }
.dot.red { background: var(--red); }
.dot.grey { background: #a1a7b1; }

.ph { display: grid; place-items: center; background: var(--ph); color: var(--ph-ink); width: 100%; height: 100%; }
.ph svg { width: 42%; height: 42%; }

.empty { text-align: left; padding: 40px 0; max-width: 46ch; }
.empty h2 { font: 800 32px/1 var(--display); margin-bottom: 8px; }

.fab {
  position: fixed; right: 18px; bottom: 22px; z-index: 940;
  box-shadow: 0 6px 18px rgba(28, 35, 51, .25);
}
@media (max-width: 760px) { .fab { bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); } }

/* ------------------------------------------------------------ профил на котка */
.profile { display: grid; gap: 28px; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; padding-top: 22px; }
@media (min-width: 861px) { .profile > :first-child { position: sticky; top: 84px; } }
@media (max-width: 860px) { .profile { grid-template-columns: 1fr; gap: 18px; padding-top: 0; } }

.gallery { position: relative; }
.gallery .track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--r-photo);
  scrollbar-width: none; background: var(--line);
}
.gallery .track::-webkit-scrollbar { display: none; }
.gallery .track > * { flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 1; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery .count { position: absolute; right: 10px; top: 10px; background: rgba(28,35,51,.7); color: #fff; font-size: 14px; padding: 2px 9px; border-radius: 999px; }
.gallery .stamps { position: absolute; left: 12px; bottom: 14px; right: 12px; }
.thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.thumbs button { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; width: 60px; height: 60px; flex: none; cursor: pointer; background: none; }
.thumbs button[aria-current="true"] { border-color: var(--blue); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) {
  .gallery { margin: 0 -16px; }
  .gallery .track { border-radius: 0; }
  .thumbs { display: none; }
}

.cat-name { font: 800 64px/.9 var(--display); letter-spacing: -.005em; }
@media (max-width: 520px) { .cat-name { font-size: 52px; } }
.cat-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); margin: 10px 0 14px; }
.cat-facts span { display: inline-flex; align-items: center; gap: 5px; }
.cat-facts svg { width: 17px; height: 17px; }

.alert { border-left: 5px solid var(--red); background: var(--red-soft); padding: 12px 14px; border-radius: 0 10px 10px 0; margin: 0 0 16px; }
.alert b { color: var(--red); }

.lastseen { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.lastseen .when { font-weight: 700; font-size: 19px; display: flex; align-items: center; gap: 8px; }
.lastseen .where { color: var(--muted); font-size: 15px; grid-column: 1; }
.lastseen .btn { grid-row: 1 / span 2; grid-column: 2; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 22px; }
.actions .wide { grid-column: 1 / -1; }

.section { margin-top: 26px; }
.section h2 { font: 800 30px/1 var(--display); margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.prose { white-space: pre-line; max-width: 62ch; }

.need { padding: 14px 0; border-top: 1px solid var(--line); }
.need:last-child { border-bottom: 1px solid var(--line); }
.need h3 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 8px 0 4px; }
.bar i { display: block; height: 100%; background: var(--green); border-radius: 999px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.timeline .ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.timeline .ico svg { width: 18px; height: 18px; }
.timeline .ico.red { background: var(--red-soft); color: var(--red); }
.timeline .ico.green { background: var(--green-soft); color: var(--green); }
.timeline .ico.amber { background: var(--amber-soft); color: var(--amber); }
.timeline .meta { font-size: 14.5px; color: var(--muted); }
.timeline .meta b { color: var(--ink); font-weight: 700; }
.timeline .txt { margin-top: 2px; white-space: pre-line; }
.timeline img { margin-top: 8px; border-radius: 10px; max-width: 260px; aspect-ratio: 1; object-fit: cover; }

.minimap { height: 180px; border-radius: var(--r-photo); overflow: hidden; border: 1px solid var(--line); }

/* ------------------------------------------------------------ карта */
.mapwrap { position: relative; height: calc(100vh - 61px); height: calc(100dvh - 61px); }
@media (max-width: 760px) { .mapwrap { height: calc(100dvh - 55px - var(--nav-h) - env(safe-area-inset-bottom)); } }
#map, .map { width: 100%; height: 100%; }
.leaflet-container { font: inherit; background: var(--map-bg); }
.tiles-soft { filter: saturate(.55) contrast(.95) brightness(1.03); }
.map-note {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 500; max-width: 420px;
  background: var(--surface); border-radius: 12px; padding: 10px 14px; font-size: 14.5px;
  box-shadow: 0 2px 10px rgba(28,35,51,.15);
}
.map-tools { position: absolute; right: 12px; top: 12px; z-index: 500; display: grid; gap: 8px; }
.map-tools .btn { box-shadow: 0 2px 10px rgba(28,35,51,.15); }
.catpin { display: grid; justify-items: center; }
.catpin .face {
  width: 46px; height: 46px; border-radius: 50%; overflow: hidden; border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.3); background: #e3e7e2;
}
.catpin.urgent .face { border-color: var(--red); }
.catpin .face img { width: 100%; height: 100%; object-fit: cover; }
.catpin .label { margin-top: 2px; background: #fff; color: #1c2333; padding: 0 6px; border-radius: 6px; font: 800 15px/1.3 var(--display); box-shadow: 0 1px 3px rgba(0,0,0,.2); white-space: nowrap; }
.catpin.exact { height: 84px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.catpin.exact .label { margin: 0 0 2px; }
.catpin .tip { display: block; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 9px solid #fff; margin-top: -1px; filter: drop-shadow(0 2px 1px rgba(0,0,0,.25)); }
.catpin.urgent .tip { border-top-color: var(--red); }
.map-toggle { background: #fff; border: 2px solid rgba(0,0,0,.2); border-radius: 8px; padding: 6px 12px; font: 700 14px/1.2 var(--font); color: #1c2333; cursor: pointer; }
.map-toggle:hover { background: #f4f4f4; }
.mt-logo img { display: block; }

/* избор на място: игла в центъра */
.picker { position: relative; height: 320px; }
.picker-map { position: absolute; inset: 0; }
.picker-pin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); z-index: 600; pointer-events: none; filter: drop-shadow(0 3px 3px rgba(0,0,0,.35)); }
.picker-pin svg { display: block; }
.picker::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: rgba(28,35,51,.55); z-index: 590; pointer-events: none; }
.picker-badge { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 600; background: var(--surface); padding: 7px 11px; border-radius: 10px; font-size: 14px; line-height: 1.35; box-shadow: 0 2px 8px rgba(28,35,51,.18); pointer-events: none; }
.minimap-link { display: inline-flex; margin-top: 8px; }

.leaflet-popup-content { margin: 12px 14px; font-size: 15px; line-height: 1.4; }
.leaflet-popup-content b.n { font: 800 24px/1 var(--display); display: block; margin-bottom: 2px; }
.leaflet-popup-content-wrapper { border-radius: 12px; }

/* ------------------------------------------------------------ диалози и съобщения */
dialog.sheet {
  border: 0; padding: 0; width: min(560px, 100%); max-height: min(92vh, 900px);
  border-radius: 18px; background: var(--paper); color: var(--ink);
  box-shadow: 0 20px 60px rgba(28,35,51,.35);
}
dialog.sheet::backdrop { background: rgba(28,35,51,.5); }
dialog.sheet .sheet-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 8px 20px; position: sticky; top: 0; background: var(--paper); z-index: 2; }
dialog.sheet .sheet-head h2 { font: 800 32px/1 var(--display); margin-right: auto; }
dialog.sheet .sheet-body { padding: 8px 20px 22px; overflow: auto; }
@media (max-width: 600px) {
  dialog.sheet { margin: auto 0 0; max-width: 100%; width: 100%; border-radius: 18px 18px 0 0; max-height: 94dvh; }
}
dialog.sheet[open] { animation: rise .22s ease-out; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  dialog.sheet[open] { animation: none; }
  .card .pic img { transition: none; }
}

.toast {
  position: fixed; left: 50%; bottom: 24px; translate: -50% 0; z-index: 2000;
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 12px; max-width: calc(100% - 32px);
  box-shadow: 0 8px 24px rgba(0,0,0,.25); font-weight: 600;
}
.toast.err { background: var(--red); color: var(--on-accent); }
@media (max-width: 760px) { .toast { bottom: calc(var(--nav-h) + 16px); } }

.copyline { display: flex; gap: 8px; align-items: center; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-ctl); padding: 6px 6px 6px 12px; margin-bottom: 10px; }
.copyline code { font: 700 17px/1.3 var(--font); letter-spacing: .02em; flex: 1; overflow-wrap: anywhere; }
.paybox { display: grid; gap: 4px; margin-bottom: 14px; }
.paybox > span { font-weight: 700; font-size: 15px; }

.picker { border-radius: var(--r-ctl); overflow: hidden; border: 1.5px solid var(--line); margin-bottom: 8px; }

.photos-edit { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.photos-edit figure { position: relative; margin: 0; width: 88px; height: 88px; border-radius: 10px; overflow: hidden; }
.photos-edit img { width: 100%; height: 100%; object-fit: cover; }
.photos-edit button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(28,35,51,.8); color: #fff; cursor: pointer; display: grid; place-items: center; }
.photos-edit button svg { width: 16px; height: 16px; }
.photos-edit figure.new::after { content: "нова"; position: absolute; left: 4px; bottom: 4px; background: var(--blue); color: #fff; font-size: 12px; padding: 0 6px; border-radius: 6px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-photo); padding: 18px; margin-bottom: 16px; }
.panel h2 { font: 800 28px/1 var(--display); margin-bottom: 12px; }
.narrow { max-width: 640px; }

.feedrow { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 18px; }
.feedrow a { flex: none; width: 84px; text-decoration: none; color: var(--ink); text-align: center; }
.feedrow img, .feedrow .ph { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; }
.feedrow b { font: 800 19px/1.1 var(--display); display: block; margin-top: 4px; }

.req { padding: 14px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.req h3 { font-size: 18px; }

.foot { color: var(--muted); font-size: 14.5px; padding: 30px 0 40px; }
.foot a { color: var(--muted); }

.spinner { padding: 60px 0; display: grid; place-items: center; color: var(--muted); }
.spinner::before { content: ""; width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ тъмен режим: детайли */
.logo-dark { display: none !important; }
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }
:root[data-theme="dark"] .tiles-soft { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.45); }
:root[data-theme="dark"] .leaflet-popup-content-wrapper, :root[data-theme="dark"] .leaflet-popup-tip { background: var(--surface); color: var(--ink); }
:root[data-theme="dark"] .leaflet-popup-content a { color: var(--blue); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none !important; }
  :root:not([data-theme="light"]) .logo-dark { display: block !important; }
  :root:not([data-theme="light"]) .tiles-soft { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.45); }
  :root:not([data-theme="light"]) .leaflet-popup-content-wrapper, :root:not([data-theme="light"]) .leaflet-popup-tip { background: var(--surface); color: var(--ink); }
  :root:not([data-theme="light"]) .leaflet-popup-content a { color: var(--blue); }
}
.theme-btn { flex: none; }
