:root {
  --bg: #f6f3ee;
  --card: #ffffff;
  --ink: #1d2327;
  --muted: #6b7478;
  --line: #e6e1d8;
  --sea: #0b7a83;
  --sea-dark: #075c63;
  --coral: #ff6b4a;
  --coral-soft: #ffe4dc;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(20, 30, 35, .12);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--sea); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px; max-width: 1280px; margin: 0 auto;
}
.brand { font-weight: 800; text-decoration: none; color: var(--ink); letter-spacing: -.01em; }
.tg-link { font-weight: 600; text-decoration: none; font-size: 15px; }

main { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

.hero { padding: 24px 0 20px; }
.hero h1 { font-size: clamp(34px, 6vw, 60px); line-height: 1.05; margin: 0 0 10px; letter-spacing: -.03em; }
.sub { font-size: 18px; color: var(--muted); margin: 0 0 18px; max-width: 620px; }
.counter {
  display: inline-flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 18px; font-size: 16px;
}
.counter b { font-size: 22px; color: var(--sea); font-variant-numeric: tabular-nums; }
.counter .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--line); }

.map-wrap { position: relative; }
#map {
  height: min(72vh, 720px); min-height: 420px;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: #dfe9ea;
}
.panel {
  position: absolute; top: 16px; right: 16px; z-index: 500;
  width: 340px; max-height: calc(100% - 32px); overflow: auto;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px;
}
.panel h2 { margin: 0 0 6px; font-size: 21px; letter-spacing: -.01em; }
.panel p { margin: 0 0 12px; }
.note { font-size: 13px; color: var(--muted); margin-top: 12px !important; }
#tg-widget { min-height: 44px; margin: 6px 0; }

.btn {
  font: inherit; font-weight: 700; font-size: 15px;
  border: 0; border-radius: 12px; padding: 11px 16px; cursor: pointer;
  background: var(--sea); color: #fff; transition: background .15s, opacity .15s;
}
.btn:hover { background: var(--sea-dark); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--bg); }
.linklike { font: inherit; border: 0; background: none; color: var(--muted); cursor: pointer; text-decoration: underline; padding: 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.search { display: flex; gap: 8px; margin: 10px 0 6px; }
.search input {
  flex: 1; min-width: 0; font: inherit; font-size: 16px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.search input:focus { outline: 2px solid var(--sea); outline-offset: -1px; border-color: transparent; }

.results { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; gap: 6px; }
.results li {
  border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.results li:hover { border-color: var(--sea); }
.results li.sel { border-color: var(--sea); background: #e8f4f5; }
.results li b { display: block; }
.results li span { font-size: 13px; color: var(--muted); }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 8px 0 0; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--sea); width: 16px; height: 16px; flex: none; }

.my-city { font-size: 18px; font-weight: 700; }
.me-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; font-size: 14px; color: var(--muted);
}
.error { margin-top: 12px; background: var(--coral-soft); color: #9a2f17; border-radius: 10px; padding: 8px 12px; font-size: 14px; }

/* метки */
.city-pin {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--coral); color: #fff; font-weight: 800;
  border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.25);
  font-family: Manrope, system-ui, sans-serif; font-variant-numeric: tabular-nums;
}
.city-pin.mine { background: #f5a300; }
.city-cluster { background: var(--sea); }
.leaflet-popup-content-wrapper { border-radius: 14px; }
.leaflet-popup-content { margin: 14px 16px; font-family: Manrope, system-ui, sans-serif; min-width: 200px; }
.pop-city { font-size: 17px; font-weight: 800; margin: 0; }
.pop-place { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.pop-count { font-size: 13px; font-weight: 700; color: var(--sea); margin-bottom: 6px; }
.pop-list { list-style: none; padding: 0; margin: 0; max-height: 220px; overflow: auto; display: grid; gap: 6px; }
.pop-list li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.ava {
  width: 26px; height: 26px; border-radius: 50%; flex: none; object-fit: cover;
  background: var(--coral-soft); color: var(--coral); font-weight: 800; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.pop-list .you { font-size: 11px; background: #e8f4f5; color: var(--sea); border-radius: 6px; padding: 1px 6px; font-weight: 700; }
.pop-more { font-size: 12px; color: var(--muted); margin-top: 6px; }
.adm-del { margin-left: auto; font-size: 11px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; padding: 1px 6px; color: #9a2f17; }

.about { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 48px 0 24px; }
.about h2 { font-size: 26px; margin: 0 0 12px; letter-spacing: -.02em; }
.top-cities { padding: 0; margin: 16px 0 0; list-style: none; counter-reset: c; }
.top-cities li {
  counter-increment: c; display: grid; grid-template-columns: 28px 1fr auto auto; gap: 10px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--line);
}
.top-cities li::before { content: counter(c); color: var(--muted); font-size: 14px; }
.top-cities li b { color: var(--sea); font-variant-numeric: tabular-nums; }
.top-cities .muted { font-size: 14px; }
details { border-bottom: 1px solid var(--line); padding: 12px 0; }
summary { cursor: pointer; font-weight: 700; }
details p { margin: 8px 0 0; color: #3b4448; }

.foot {
  max-width: 1280px; margin: 0 auto; padding: 24px; display: flex; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; font-size: 14px;
}

@media (max-width: 800px) {
  .top, main, .foot { padding-left: 16px; padding-right: 16px; }
  #map { height: 62vh; min-height: 360px; }
  .panel { position: static; width: auto; max-height: none; margin-top: 12px; box-shadow: none; border: 1px solid var(--line); }
  .about { grid-template-columns: 1fr; gap: 24px; padding-top: 32px; }
  .counter { font-size: 15px; }
}
