/* Гуляем, отцы — дизайн-система: тёплая, дружелюбная, в языке «карты отцов» */
:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --surface-2: #f1ede6;
  --text: #1c1c1e;
  --text-2: #6b6e75;
  --primary: #e05d1f;
  --primary-press: #c14e17;
  --on-primary: #ffffff;
  --primary-soft: #ffe8c5;
  --club: #2f6db3;
  --club-soft: #e3edf8;
  --border: #e8e4dc;
  --danger: #dc2626;
  --shadow: 0 8px 28px rgba(28, 28, 30, 0.16);
  --radius: 18px;
  --radius-s: 12px;
}
[data-theme="dark"] {
  --bg: #1a1a1c;
  --surface: #242428;
  --surface-2: #2e2e33;
  --text: #f3f2ef;
  --text-2: #a2a5ad;
  --primary: #ff7a38;
  --primary-press: #e5661f;
  --on-primary: #241205;
  --primary-soft: #3a2a1e;
  --club: #6ba3e0;
  --club-soft: #253647;
  --border: #3a3a40;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: "Nunito", -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#map { position: fixed; inset: 0; background: var(--bg); }

/* ---------- топбар ---------- */
.topbar {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: 12px; right: 12px;
  z-index: 1000;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border-radius: 999px;
  padding: 10px 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.topbar .logo {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  background: var(--primary-soft); border-radius: 50%;
}
.topbar .logo svg { width: 20px; height: 20px; color: var(--primary); }
.topbar .titles { min-width: 0; }
.topbar h1 { font-size: 17px; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; }
.topbar .sub { font-size: 12.5px; color: var(--text-2); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- чипы фильтра дней ---------- */
.daybar {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 68px);
  left: 0; right: 0;
  z-index: 999;
  display: flex; gap: 8px;
  padding: 6px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.daybar::-webkit-scrollbar { display: none; }
.daybar .chip {
  flex: none;
  min-height: 38px;
  padding: 0 16px;
  box-shadow: 0 2px 8px rgba(28, 28, 30, 0.10);
  border-color: transparent;
  background: var(--surface);
}
.daybar .chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }

/* ---------- мини-карточка места ---------- */
.fav-btn {
  display: flex; align-items: center; justify-content: center;
  width: 50px; min-height: 50px; flex: none;
  border: 1.5px solid var(--border); border-radius: var(--radius-s);
  background: var(--surface); color: var(--text-2); cursor: pointer;
  transition: all 0.15s ease;
}
.fav-btn svg { width: 22px; height: 22px; }
.fav-btn.on { color: #d99114; border-color: #d99114; background: color-mix(in srgb, #d99114 12%, var(--surface)); }
.row-2 { display: flex; gap: 10px; }
.row-2 .btn { flex: 1; }

/* ---------- баннер-подсказка (режим выбора места) ---------- */
.hintbar {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 120px);
  left: 50%; transform: translateX(-50%);
  z-index: 1000;
  background: var(--text); color: var(--bg);
  font-size: 14px; font-weight: 700;
  padding: 10px 18px; border-radius: 999px;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.hintbar.show { opacity: 1; }

/* ---------- маркеры ---------- */
.walk-pin { filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3)); }
.walk-pin .badge {
  position: absolute; top: 2px; left: 50%; transform: translateX(-50%);
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 900; font-size: 14px; font-family: "Nunito", sans-serif;
  color: #fff;
}
.place-dot {
  width: 100%; height: 100%; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}
.place-dot svg { width: 12px; height: 12px; }
.place-dot.park svg { color: #3d9c52; }
.place-dot.playground svg { color: #d99114; }

/* ---------- шторка ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 1500;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.sheet-backdrop.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1600;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.25);
  transform: translateY(105%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0.22, 1);
  max-height: 82vh;
  display: flex; flex-direction: column;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
}
.sheet.show { transform: translateY(0); }
.sheet .grip { width: 44px; height: 5px; border-radius: 3px; background: var(--border);
  margin: 10px auto 4px; flex: none; }
.sheet .body { overflow-y: auto; padding: 8px 20px 8px; }
@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet-backdrop, .hintbar { transition: none; }
}

/* ---------- карточка прогулки ---------- */
.w-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 4px; }
.w-icon { width: 44px; height: 44px; flex: none; border-radius: 14px;
  display: grid; place-items: center; background: var(--primary-soft); }
.w-icon svg { width: 24px; height: 24px; color: var(--primary); }
.w-icon.club { background: var(--club-soft); }
.w-icon.club svg { color: var(--club); }
.w-title { font-size: 19px; font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; }
.w-when { font-size: 15px; font-weight: 700; color: var(--primary); margin-top: 2px; }
.w-club-tag { display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 800; color: var(--club);
  background: var(--club-soft); border-radius: 999px; padding: 3px 10px; margin-top: 6px; }
.w-comment { font-size: 15px; color: var(--text); background: var(--surface-2);
  border-radius: var(--radius-s); padding: 10px 14px; margin: 12px 0; }
.w-section { font-size: 13px; font-weight: 800; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.05em; margin: 14px 0 8px; }
.people { display: flex; flex-direction: column; gap: 2px; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px 4px;
  border-radius: var(--radius-s); text-decoration: none; color: var(--text); min-height: 44px; }
a.person:active { background: var(--surface-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: #fff; }
.person .p-name { font-size: 15px; font-weight: 700; }
.person .p-role { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.person .p-link { margin-left: auto; color: var(--text-2); }
.person .p-link svg { width: 18px; height: 18px; }

/* ---------- кнопки ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 50px;
  border: none; border-radius: var(--radius-s);
  font-family: inherit; font-size: 16px; font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 20px; height: 20px; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:active { background: var(--primary-press); }
.btn-secondary { background: var(--surface-2); color: var(--text); }
.btn-ghost-danger { background: none; color: var(--danger); min-height: 44px; font-size: 15px; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn-row { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }

/* ---------- выбор места ---------- */
.placelist { display: flex; flex-direction: column; gap: 6px; }
.place-opt {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; min-height: 56px;
  border: 1.5px solid var(--border); border-radius: var(--radius-s);
  background: var(--surface); cursor: pointer;
  font-family: inherit; font-size: 15px; text-align: left; color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.place-opt:active { background: var(--surface-2); }
.place-opt .pl-icon { width: 36px; height: 36px; flex: none; border-radius: 10px;
  display: grid; place-items: center; background: var(--surface-2); }
.place-opt .pl-icon svg { width: 20px; height: 20px; }
.place-opt.park .pl-icon svg { color: #3d9c52; }
.place-opt.playground .pl-icon svg { color: #d99114; }
.place-opt .pl-name { font-weight: 700; line-height: 1.3; }
.place-opt .pl-dist { font-size: 13px; color: var(--text-2); font-weight: 600; }

/* ---------- форма ---------- */
.f-label { font-size: 13px; font-weight: 800; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.05em; margin: 16px 0 8px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: all 0.15s ease;
}
.chip.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.f-input {
  width: 100%; min-height: 50px;
  border: 1.5px solid var(--border); border-radius: var(--radius-s);
  background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 16px; font-weight: 600;
  padding: 12px 14px;
}
.f-input:focus { outline: none; border-color: var(--primary); }
textarea.f-input { resize: none; min-height: 72px; }
.f-note { font-size: 13px; color: var(--text-2); font-weight: 600; margin-top: 8px; }
.f-place-line { display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border-radius: var(--radius-s); padding: 12px 14px;
  font-weight: 700; font-size: 15px; }
.f-place-line button { margin-left: auto; border: none; background: none;
  color: var(--primary); font-family: inherit; font-weight: 800; font-size: 14px;
  cursor: pointer; min-height: 44px; padding: 0 6px; }

/* ---------- тумблеры-строки ---------- */
.toggle-row {
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 4px 2px;
  font-size: 15px; font-weight: 700; color: var(--text);
  cursor: pointer;
}
.toggle-row .t-hint { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.switch {
  margin-left: auto; flex: none;
  width: 46px; height: 28px; border-radius: 999px;
  background: var(--border); position: relative;
  transition: background 0.2s ease;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  transition: left 0.2s ease;
}
.switch.on { background: var(--primary); }
.switch.on::after { left: 21px; }

/* ---------- погода ---------- */
.w-weather {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 700; color: var(--text-2);
  background: var(--surface-2); border-radius: 999px;
  padding: 3px 12px; margin-top: 6px;
}

/* ---------- топбар: кнопка списка ---------- */
.topbar .list-btn {
  margin-left: auto; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  border: none; background: var(--surface-2); color: var(--text);
  display: grid; place-items: center; cursor: pointer;
}
.topbar .list-btn svg { width: 20px; height: 20px; }

/* ---------- лента ---------- */
.feed-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 12px 8px; min-height: 64px;
  border: none; background: none; border-bottom: 1px solid var(--border);
  font-family: inherit; text-align: left; color: var(--text); cursor: pointer;
}
.feed-row:active { background: var(--surface-2); }
.feed-row .f-when { flex: none; width: 92px; font-size: 13.5px; font-weight: 800; color: var(--primary); line-height: 1.3; }
.feed-row.club .f-when { color: var(--club); }
.feed-row .f-title { font-size: 15px; font-weight: 700; line-height: 1.3; }
.feed-row .f-meta { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.feed-row .f-n {
  margin-left: auto; flex: none;
  min-width: 30px; height: 30px; border-radius: 50%; padding: 0 6px;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
  font-size: 13.5px; font-weight: 800;
}
.feed-row.club .f-n { background: var(--club-soft); color: var(--club); }
.feed-empty { text-align: center; color: var(--text-2); font-weight: 600; padding: 28px 8px; }

/* ---------- комментарии ---------- */
.comments { display: flex; flex-direction: column; gap: 10px; }
.comment { display: flex; gap: 10px; align-items: flex-start; }
.comment .avatar { width: 28px; height: 28px; font-size: 12px; margin-top: 2px; }
.comment .c-body { flex: 1; min-width: 0; }
.comment .c-head { font-size: 13px; font-weight: 800; }
.comment .c-time { font-weight: 600; color: var(--text-2); margin-left: 6px; font-size: 12px; }
.comment .c-text { font-size: 14.5px; line-height: 1.4; word-wrap: break-word; user-select: text; -webkit-user-select: text; }
.comment .c-del { flex: none; border: none; background: none; color: var(--text-2);
  cursor: pointer; padding: 4px; min-width: 32px; min-height: 32px; }
.comment .c-del svg { width: 15px; height: 15px; }
.c-form { display: flex; gap: 8px; margin-top: 12px; }
.c-form input { flex: 1; min-height: 46px; }
.c-form .c-send { flex: none; width: 46px; min-height: 46px;
  border: none; border-radius: var(--radius-s);
  background: var(--primary); color: var(--on-primary);
  display: grid; place-items: center; cursor: pointer; }
.c-form .c-send svg { width: 20px; height: 20px; }
.c-empty { font-size: 13.5px; color: var(--text-2); font-weight: 600; }

/* ---------- тосты и оверлеи ---------- */
.toast {
  position: fixed; bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
  left: 50%; transform: translateX(-50%) translateY(20px);
  z-index: 2000;
  background: var(--text); color: var(--bg);
  padding: 12px 20px; border-radius: 999px;
  font-size: 14.5px; font-weight: 700;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transition: all 0.25s ease;
  max-width: calc(100vw - 40px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.gate {
  position: fixed; inset: 0; z-index: 3000;
  background: var(--bg);
  display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 32px; text-align: center;
}
.gate.show { display: flex; }
.gate .logo { width: 72px; height: 72px; border-radius: 24px;
  display: grid; place-items: center; background: var(--primary-soft); }
.gate .logo svg { width: 40px; height: 40px; color: var(--primary); }
.gate h2 { font-size: 22px; font-weight: 800; }
.gate p { color: var(--text-2); font-weight: 600; max-width: 300px; }
.gate a { display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 0 28px; border-radius: var(--radius-s);
  background: var(--primary); color: var(--on-primary);
  font-weight: 800; text-decoration: none; }

.spinner {
  position: fixed; inset: 0; z-index: 2500;
  display: none; place-items: center;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}
.spinner.show { display: grid; }
.spinner .ring {
  width: 42px; height: 42px; border-radius: 50%;
  border: 4px solid var(--primary-soft); border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Leaflet поверх наших переменных */
.leaflet-container { font-family: inherit; }
.leaflet-control-attribution {
  font-size: 10px; background: color-mix(in srgb, var(--surface) 75%, transparent) !important;
  color: var(--text-2) !important;
}
.leaflet-control-attribution a { color: var(--text-2) !important; }
.leaflet-control-zoom { display: none; }
