* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  /* основной цвет (имена оставлены прежними — переопределяем значения) */
  --brown: #0d9488;        /* глубокий бирюзово-зелёный */
  --brown-light: #14b8a6;
  --brown-dark: #0f766e;
  --accent: #f59e0b;       /* тёплый янтарный акцент */
  --bg: #eef3f1;
  --card: #ffffff;
  --text: #16302b;
  --muted: #6b7d79;
  --border: #e3eae7;
  --danger: #ef4444;
  --success: #10b981;
  --radius: 16px;
  /* мягкие тени-уровни (свежий минимал) */
  --shadow-sm: 0 1px 3px rgba(16,48,43,.06), 0 1px 2px rgba(16,48,43,.04);
  --shadow: 0 6px 18px rgba(13,148,136,.09), 0 2px 6px rgba(16,48,43,.05);
  --shadow-lg: 0 16px 44px rgba(13,148,136,.16), 0 4px 12px rgba(16,48,43,.08);
  --grad-brand: linear-gradient(135deg, #14b8a6 0%, #0d9488 60%, #0f766e 100%);
}

html, body {
  height: 100%;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

.screen {
  width: 100%;
  height: 100vh;
  height: 100dvh; /* учитываем панель браузера на мобильных */
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }

/* === AUTH === */
#auth-screen {
  background:
    radial-gradient(circle at 18% 16%, rgba(245,158,11,0.28), transparent 38%),
    linear-gradient(135deg, #14b8a6 0%, #0e7d70 55%, #0f5e57 100%);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-box {
  background: white;
  padding: 40px 30px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.auth-box h1 { font-size: 64px; }
.auth-box h2 { margin: 10px 0 4px; color: var(--brown-dark); }
.tagline { color: var(--muted); margin-bottom: 24px; font-size: 14px; }

.auth-box input {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  background: #fafafa;
}

.auth-box input:focus { outline: none; border-color: var(--brown); background: white; }

button.primary {
  width: 100%;
  padding: 14px;
  background: var(--brown);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}

button.primary:hover { background: var(--brown-dark); }
button.primary:disabled { opacity: 0.5; cursor: not-allowed; }

button.danger {
  padding: 12px 20px;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
}

.switch { margin-top: 16px; font-size: 14px; color: var(--muted); }
.switch a { color: var(--brown); cursor: pointer; text-decoration: underline; font-weight: 500; }

.error-msg {
  background: #fff0f0;
  color: var(--danger);
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

/* === SIGNATURE === */
.signature {
  margin-top: 24px;
  text-align: center;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.signature .cap-line {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.signature .borat-line {
  margin-top: 6px;
  font-size: 13px;
  font-style: italic;
  opacity: 0.95;
}

/* === HEADER === */
header {
  background: var(--grad-brand);
  color: white;
  padding: 12px 16px;
  /* отступ сверху под чёлку/статус-бар (актуально для установленного приложения) */
  padding-top: calc(12px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
}

.logo {
  font-weight: 700;
  font-size: 18px;
}

nav { display: flex; gap: 4px; flex-wrap: wrap; }

.nav-btn {
  background: transparent;
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.nav-btn:hover { background: rgba(255,255,255,0.1); }
.nav-btn.active { background: white; color: var(--brown); }
.nav-btn.logout { border-color: rgba(255,255,255,0.5); }

/* Кнопки-иконки справа в шапке */
.header-actions { display: flex; gap: 6px; align-items: center; }
.icon-btn {
  position: relative;
  background: rgba(255,255,255,0.16);
  color: #fff;
  border: none;
  width: 38px; height: 38px;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: rgba(255,255,255,0.3); }
.icon-btn .badge-count { position: absolute; top: -5px; right: -5px; margin: 0; }
/* Иконки-настройки внутри «Я» (на светлой карточке профиля) — читаемые чипы */
.profile-header .icon-btn { background: var(--bg); color: var(--text); width: 33px; height: 33px; font-size: 16px; }
.profile-header .icon-btn:hover { background: var(--border); }

/* Нижняя панель навигации */
.bottom-nav {
  display: flex;
  flex-wrap: nowrap;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 14px rgba(0,0,0,0.07);
  z-index: 1000;
}
.bnav-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 8px 2px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  position: relative;
}
.bnav-ic { font-size: 20px; line-height: 1; opacity: 0.5; padding: 5px 15px; border-radius: 999px; transition: transform 0.18s, opacity 0.15s, background 0.18s; }
.bnav-btn.active { color: var(--brown); }
.bnav-btn.active .bnav-ic { opacity: 1; background: rgba(20,184,166,0.14); transform: translateY(-1px); }
.bnav-btn:active .bnav-ic { transform: scale(0.9); opacity: 0.75; }
/* Центральная «+» — поднятая брендовая кнопка добавления метки */
.bnav-add {
  flex: 0 0 auto;
  align-self: center;
  width: 56px;
  height: 56px;
  margin: -20px 8px 0;
  border: 3px solid var(--card);
  border-radius: 50%;
  background: var(--grad-brand);
  color: #fff;
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(13,148,136,0.5);
  transition: transform 0.12s, box-shadow 0.15s;
}
.bnav-add:hover { box-shadow: 0 10px 28px rgba(13,148,136,0.6); }
.bnav-add:active { transform: scale(0.92); }
.bnav-btn .badge-count { position: absolute; top: 4px; left: 56%; margin: 0; }

/* === VIEW === */
.view {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#map { width: 100%; height: 100%; }

#map.adding,
#map.adding .leaflet-grab,
#map.adding .leaflet-interactive {
  cursor: crosshair !important;
}

.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 20px;
  overflow-y: auto;
  height: 100%;
}

.container h2 {
  margin: 22px 0 12px;
  color: var(--text);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.container h2:first-child { margin-top: 0; }

/* === FAB === */
.fab {
  position: absolute;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--grad-brand);
  color: white;
  border: none;
  font-size: 32px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(13,148,136,0.45);
  z-index: 999;
  transition: transform 0.12s, box-shadow 0.15s;
}

.fab:hover { transform: scale(1.05); box-shadow: 0 10px 30px rgba(13,148,136,0.55); }
.fab:active { transform: scale(0.95); }

/* Кнопка «где я» (над «+») */
.locate-fab {
  position: absolute;
  bottom: 96px;
  right: 26px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  color: var(--brown);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s;
}
.locate-fab:hover { transform: scale(1.05); }
.locate-fab:active { transform: scale(0.93); }
.loc-arrow { display: inline-block; font-size: 20px; transform: rotate(-45deg); }

/* Точка «ты здесь» */
.me-dot {
  width: 16px;
  height: 16px;
  background: #2196f3;
  border: 3px solid #fff;
  border-radius: 50%;
  animation: me-pulse 1.8s infinite;
}
@keyframes me-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(33,150,243,0.5); }
  70%  { box-shadow: 0 0 0 14px rgba(33,150,243,0); }
  100% { box-shadow: 0 0 0 0 rgba(33,150,243,0); }
}

/* === MODAL === */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal-content {
  background: white;
  padding: 24px;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: transform 0.25s ease;
}

.modal-content h3 { margin-bottom: 16px; color: var(--brown-dark); }
.modal-content label { display: block; margin: 12px 0 4px; font-size: 14px; color: var(--muted); }

.modal-content input,
.modal-content textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  justify-content: flex-end;
}

.modal-actions button {
  padding: 10px 20px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  white-space: nowrap;
}

.modal-actions button.primary {
  background: var(--brown);
  color: white;
  border: none;
  width: auto;
  margin: 0;
}
/* Кнопка удаления — красный фон + белый текст в обеих темах (иначе был белый-по-белому) */
.modal-actions button.danger,
body.dark .modal-actions button.danger {
  background: var(--danger);
  color: #fff;
  border: none;
}

.rating { display: flex; gap: 6px; font-size: 28px; cursor: pointer; user-select: none; }
.rating span { opacity: 0.3; transition: opacity 0.1s; }
.rating span.selected,
.rating span.hover { opacity: 1; }

.process-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.process-chips .chip {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fafafa;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
  transition: background 0.1s, color 0.1s;
}

.process-chips .chip:hover { border-color: var(--brown-light); }

.process-chips .chip.selected {
  background: var(--brown);
  color: white;
  border-color: var(--brown);
}

#view-place {
  font-weight: 600;
  color: var(--brown-dark);
  margin-bottom: 4px;
}

.location-info {
  background: #f5efe5;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

/* === FRIENDS / SEARCH === */
.search-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.search-bar input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
}
.search-bar button {
  padding: 10px 16px;
  background: var(--brown);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.user-card {
  background: var(--card);
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border);
}

.user-card .username { font-weight: 600; }
.user-card button {
  padding: 6px 12px;
  background: var(--brown);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  margin-left: 4px;
}

.user-card button.secondary { background: #999; }
.user-card button.danger { background: var(--danger); }

.empty {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 16px;
}

/* === STATS === */
.stat-card {
  background: var(--card);
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.stat-card .big-num {
  font-size: 36px;
  font-weight: 700;
  color: var(--brown);
}

.stat-card .label { color: var(--muted); font-size: 14px; }
.stat-card.tappable { cursor: pointer; transition: border-color 0.1s, transform 0.12s; }

/* звание патрульного */
.rank-card {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, var(--brown-dark), var(--brown));
  color: #fff; padding: 16px; border-radius: 14px; margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.rank-emoji { font-size: 38px; line-height: 1; flex: 0 0 auto; }
.rank-info { flex: 1; min-width: 0; }
.rank-name { font-size: 18px; font-weight: 700; }
.rank-prog { height: 8px; border-radius: 999px; background: rgba(255,255,255,.25); margin: 7px 0 5px; overflow: hidden; }
.rank-bar { height: 100%; border-radius: 999px; background: var(--accent, #f59e0b); transition: width .4s; }
.rank-sub { font-size: 12px; opacity: .9; }

/* === «Какарта: Итоги» (Wrapped) === */
.wrapped-modal { position: fixed; inset: 0; z-index: 4000; background: #000; opacity: 0; transition: opacity .25s; display: flex; flex-direction: column; }
.wrapped-modal.show { opacity: 1; }
.wr-progress { display: flex; gap: 4px; padding: 10px 12px calc(6px + env(safe-area-inset-top)); position: absolute; top: 0; left: 0; right: 0; z-index: 2; }
.wr-bar { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.3); }
.wr-bar.on { background: #fff; }
.wr-close { position: absolute; top: calc(16px + env(safe-area-inset-top)); right: 14px; z-index: 3; background: rgba(0,0,0,.25); border: none; color: #fff; font-size: 18px; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; line-height: 1; }
.wr-slide { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 26px; color: #fff; cursor: pointer; animation: wr-in .4s ease; }
@keyframes wr-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.wr-emoji { font-size: 88px; line-height: 1; margin-bottom: 18px; filter: drop-shadow(0 6px 16px rgba(0,0,0,.35)); animation: wr-pop .5s cubic-bezier(.3,1.4,.5,1); }
@keyframes wr-pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.wr-big { font-size: 34px; font-weight: 800; line-height: 1.15; margin-bottom: 12px; word-break: break-word; text-shadow: 0 2px 12px rgba(0,0,0,.3); }
.wr-sub { font-size: 17px; opacity: .92; max-width: 420px; }
.wr-actions { margin-top: 28px; }
.wr-share { background: #fff; color: #111; border: none; border-radius: 999px; padding: 13px 26px; font-size: 16px; font-weight: 700; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.wr-hint { position: absolute; bottom: calc(22px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; color: rgba(255,255,255,.7); font-size: 13px; pointer-events: none; }
.wr-bg-0 { background: linear-gradient(135deg,#0d9488,#0f766e); }
.wr-bg-1 { background: linear-gradient(135deg,#f59e0b,#d97706); }
.wr-bg-2 { background: linear-gradient(135deg,#d9488b,#7c3aed); }
.wr-bg-3 { background: linear-gradient(135deg,#ef4444,#f59e0b); }
.wr-bg-4 { background: linear-gradient(135deg,#10b981,#0d9488); }
.wr-bg-5 { background: linear-gradient(135deg,#3b82f6,#6366f1); }
.wr-bg-6 { background: linear-gradient(135deg,#a16207,#6b4423); }
.wr-bg-7 { background: linear-gradient(135deg,#8b5cf6,#d9488b); }
.wr-bg-8 { background: linear-gradient(135deg,#f59e0b,#10b981); }

/* === «Что нового» === */
.wn-wrap { max-height: 62vh; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; margin: 8px 0; }
.wn-post { background: var(--card); border-radius: 14px; padding: 13px 15px; box-shadow: var(--shadow-sm); border-left: 4px solid var(--brown-light); }
.wn-post.wn-unseen { border-left-color: var(--accent); background: linear-gradient(135deg, rgba(245,158,11,.07), var(--card)); }
.wn-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.wn-title { font-weight: 800; font-size: 15px; }
.wn-new { font-size: 9px; font-weight: 900; letter-spacing: .06em; background: var(--accent); color: #fff; border-radius: 999px; padding: 2px 7px; margin-left: 8px; vertical-align: middle; }
.wn-date { font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.wn-list { margin: 7px 0 0; padding-left: 18px; }
.wn-list li { font-size: 14px; line-height: 1.45; margin-bottom: 5px; }

/* === СТРАНИЦА ПРОФИЛЯ === */
.prof-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.prof-avatar { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 34px; flex: 0 0 auto; box-shadow: 0 3px 10px rgba(0,0,0,.2); }
.prof-id { min-width: 0; }
.prof-name { font-size: 22px; font-weight: 800; word-break: break-word; }
.prof-since { font-size: 12px; color: var(--muted); margin-top: 2px; }
.prof-bio-row { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.prof-bio { flex: 1; font-size: 14px; line-height: 1.4; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; min-height: 20px; word-break: break-word; }
.prof-edit { flex: 0 0 auto; background: none; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 15px; padding: 6px 9px; color: inherit; }
.prof-bio-input { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--brown); border-radius: 10px; font-size: 14px; }
.prof-bio-save { margin-top: 6px; background: var(--brown); color: #fff; border: none; border-radius: 8px; padding: 6px 14px; cursor: pointer; font-size: 15px; }
.prof-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
.prof-stat { flex: 1 1 calc(33% - 8px); min-width: 70px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 8px; text-align: center; }
.prof-stat b { display: block; font-size: 18px; color: var(--brown); }
.prof-stat span { font-size: 11px; color: var(--muted); }
.prof-stat.tappable { cursor: pointer; }
.prof-stat.tappable:active { transform: scale(.97); }
/* «Я» — компактный ряд действий (лаунчпад) */
.me-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.me-actions button { flex: 1 1 calc(33% - 8px); min-width: 92px; padding: 11px 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; transition: transform .08s, background .15s; }
.me-actions button:active { transform: scale(.96); }
.me-hint { margin: 12px 2px 4px; font-size: 12px; line-height: 1.45; color: var(--muted); text-align: center; }
/* Светящееся кольцо на лого = вход в сторис */
.logo.has-stories { cursor: pointer; position: relative; padding: 2px 10px; border-radius: 999px; background: linear-gradient(90deg, rgba(13,148,136,.16), rgba(245,158,11,.16)); box-shadow: 0 0 0 1.5px rgba(255,255,255,.35) inset, 0 0 10px rgba(245,158,11,.35); animation: storyGlow 2.6s ease-in-out infinite; }
.logo.has-stories:active { transform: scale(.97); }
@keyframes storyGlow { 0%,100% { box-shadow: 0 0 0 1.5px rgba(255,255,255,.3) inset, 0 0 8px rgba(245,158,11,.3); } 50% { box-shadow: 0 0 0 1.5px rgba(255,255,255,.5) inset, 0 0 16px rgba(245,158,11,.55); } }
/* свежий нейро-разбор — кольцо пульсирует ярче (перебивает обычное свечение сторис) */
.logo.razbor-fresh { animation: razborPulse 1.3s ease-in-out infinite; }
@keyframes razborPulse { 0%,100% { box-shadow: 0 0 0 2px rgba(255,255,255,.45) inset, 0 0 12px rgba(245,158,11,.6); } 50% { box-shadow: 0 0 0 2.5px rgba(255,255,255,.85) inset, 0 0 24px rgba(245,158,11,1); } }
/* Контент слайдов сторис */
.st-emoji { font-size: 64px; line-height: 1; margin-bottom: 14px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.3)); }
.st-big { font-size: 28px; font-weight: 800; margin-bottom: 6px; }
.st-sub { font-size: 15px; opacity: .92; max-width: 320px; line-height: 1.4; }
.st-list { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 17px; font-weight: 600; }
.st-zones { display: flex; width: 100%; max-width: 320px; margin-top: 22px; height: 40px; border-radius: 10px; overflow: hidden; font-size: 11px; font-weight: 700; }
.st-zones span { display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.22); }
.st-zones .z-norm { background: rgba(255,255,255,.5); color: #1a1a1a; }
.st-badges { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; max-width: 330px; font-size: 12px; }
.st-badge { background: rgba(255,255,255,.18); border-radius: 999px; padding: 5px 10px; }
.st-roast { font-size: 20px; font-weight: 800; margin: 8px 0 4px; max-width: 330px; line-height: 1.35; }
.st-neuro { font-size: 16px; font-weight: 600; margin: 10px 0 4px; max-width: 340px; line-height: 1.45; white-space: pre-line; }
.st-tip { margin-top: 18px; background: rgba(255,255,255,.2); border-radius: 14px; padding: 11px 15px; font-size: 14px; max-width: 330px; line-height: 1.4; }
.prof-h { font-size: 15px; margin: 14px 0 6px; }
.prof-ach { display: flex; flex-wrap: wrap; gap: 6px; }
.prof-badge { background: var(--accent, #f59e0b); color: #3a2a00; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; }
.prof-markers { display: flex; flex-direction: column; gap: 6px; }
.prof-marker { background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; font-size: 14px; cursor: pointer; }
.prof-marker:hover { border-color: var(--brown); }

/* === AI-разбор === */
.ai-roast { background: linear-gradient(135deg, #7c3aed, #0d9488); color: #fff; border-radius: 12px; padding: 14px; font-size: 16px; font-weight: 600; line-height: 1.35; margin-bottom: 6px; }
.ai-h { font-size: 15px; margin: 14px 0 6px; }
.ai-insights { display: flex; flex-direction: column; gap: 6px; }
.ai-ins { background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; font-size: 14px; line-height: 1.35; }
.ai-tip { background: var(--accent, #f59e0b); color: #3a2a00; border-radius: 10px; padding: 11px; font-size: 14px; font-weight: 600; }
.ai-disclaimer { font-size: 11px; color: var(--muted); margin-top: 10px; line-height: 1.35; }

/* инлайн-разбор в профиле «Я» (вместо слабых карточек) */
.ai-inline { background: var(--card); }
.ai-inline-roast { background: linear-gradient(135deg, #7c3aed, #0d9488); color: #fff; border-radius: 10px; padding: 11px; font-size: 14px; font-weight: 600; line-height: 1.35; margin: 6px 0 8px; }
.ai-inline-ins { font-size: 13.5px; line-height: 1.4; padding: 5px 0; border-top: 1px solid var(--border); }
.ai-inline-ins:first-of-type { border-top: none; }
.ai-inline-tip { background: var(--accent, #f59e0b); color: #3a2a00; border-radius: 9px; padding: 9px 11px; font-size: 13px; font-weight: 600; margin-top: 8px; }
.ai-inline-srv { font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; margin-top: 6px; }
.ai-neuro-badge { font-size: 10px; background: #7c3aed; color: #fff; border-radius: 999px; padding: 1px 7px; margin-left: 6px; vertical-align: middle; }

/* аналитика места */
.place-analytics { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; margin-bottom: 4px; }
.pa-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 14px; border-top: 1px solid var(--border); }
.pa-row:first-child { border-top: none; }
.pa-row span { color: var(--muted); }
.pa-row b { font-weight: 700; }
.stat-card.tappable:hover { border-color: var(--brown-light); }
.stat-card.tappable:active { transform: scale(0.97); }

/* === ДОСТИЖЕНИЯ === */
.achievements {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.badge {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
}

.badge .emoji {
  font-size: 32px;
  line-height: 1;
  filter: grayscale(1);
  opacity: 0.3;
}

.badge.unlocked {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(245,158,11,.08), rgba(245,158,11,.02));
  box-shadow: 0 0 0 1px rgba(245,158,11,.25), 0 2px 12px rgba(245,158,11,.15);
}
.badge.unlocked .emoji { filter: none; opacity: 1; transform: scale(1.05); }

.badge .b-title {
  font-weight: 600;
  font-size: 14px;
  margin-top: 8px;
  color: var(--muted);
}

.badge.unlocked .b-title { color: var(--brown-dark); }

.badge .b-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* прогресс к следующей ачивке */
.b-prog {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin: 8px 6px 0;
  overflow: hidden;
}
.b-prog-fill { height: 100%; background: var(--brown-light); }
.b-prog-txt { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* === TOAST === */
.toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brown-dark);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  z-index: 3000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  font-size: 14px;
}

.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

.muted { color: var(--muted); font-size: 13px; }

/* === LEAFLET CUSTOM MARKER === */
.poop-marker {
  font-size: 28px;
  text-align: center;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 600px) {
  .logo { font-size: 15px; }
  nav { gap: 6px; }
  .nav-btn { font-size: 13px; padding: 8px 10px; }
  header { padding: 10px; }
  /* у владельца в шапке до 5 иконок (🛠📣🔔🌙🚪) — ужимаем, чтобы не переносило на 2 строки */
  .icon-btn { width: 34px; height: 34px; font-size: 16px; }
  .header-actions { gap: 4px; }

  .auth-box { padding: 32px 22px; }
  .container { padding: 16px; }

  /* Модалки выезжают снизу как «шторка» */
  .modal { align-items: flex-end; padding: 0; }
  .modal-content {
    max-width: none;
    width: 100%;
    border-radius: 18px 18px 0 0;
    max-height: 88vh;
    padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
  }

  /* «Язычок» сверху — подсказка, что окно можно смахнуть вниз пальцем */
  .modal-content::before {
    content: '';
    display: block;
    width: 44px;
    height: 5px;
    border-radius: 3px;
    background: var(--muted);
    opacity: 0.35;
    margin: -6px auto 14px;
  }

  /* Кнопки действий: по 2 в ряд, переносятся если не влезают (одна — во всю ширину) */
  .modal-actions { gap: 10px; }
  .modal-actions button { flex: 1 1 calc(50% - 5px); padding: 14px; font-size: 16px; }
  .modal-actions button:only-child { flex-basis: 100%; }

  /* Чипы процесса крупнее для тапа */
  .process-chips .chip { padding: 10px 14px; font-size: 15px; }

  /* FAB выше с учётом домашней полоски iPhone */
  .fab {
    bottom: calc(20px + env(safe-area-inset-bottom));
    right: 18px;
  }
  .locate-fab {
    bottom: calc(90px + env(safe-area-inset-bottom));
    right: 20px;
  }
  .map-tools { left: 12px; }

  /* Кнопки зума карты — ниже строки поиска, чтобы не перекрывались */
  .leaflet-top.leaflet-left { top: 56px; }

  /* Тост над нижней панелью и полоской iPhone */
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* === ТЁМНАЯ ТЕМА === */
body.dark {
  --bg: #0d1a17;
  --card: #14241f;
  --text: #eaf4f0;
  --muted: #93a8a1;
  --border: #25372f;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.40);
  --shadow: 0 6px 18px rgba(0,0,0,.45);
  --shadow-lg: 0 16px 44px rgba(0,0,0,.55);
}
/* Шапка и нижнее меню тоже темнеют (раньше шапка оставалась ярко-бирюзовой) */
body.dark header { background: linear-gradient(135deg, #16291f, #0d1a17); box-shadow: 0 2px 14px rgba(0,0,0,.5); }
body.dark .bottom-nav { background: #0f1d19; box-shadow: 0 -2px 14px rgba(0,0,0,.4); }
body.dark .bnav-btn.active .bnav-ic { background: rgba(20,184,166,0.22); }
body.dark .icon-btn { background: rgba(255,255,255,0.10); }
body.dark .auth-box,
body.dark .modal-content,
body.dark .modal-actions button { background: var(--card); color: var(--text); }
body.dark .auth-box input,
body.dark .auth-box input:focus,
body.dark .modal-content input,
body.dark .modal-content textarea,
body.dark .process-chips .chip,
body.dark .search-bar input { background: #11201d; color: var(--text); border-color: var(--border); }
body.dark .location-info { background: #11201d; }
body.dark .auth-box h2,
body.dark .container h2,
body.dark .modal-content h3,
body.dark .stat-card .big-num { color: var(--brown-light); }

/* Ночная карта CARTO слишком тёмная — подсвечиваем плитки, чтобы были видны улицы.
   Фильтр только на слое плиток: метки (💩, точка «ты здесь») остаются яркими. */
body.dark .leaflet-tile-pane { filter: brightness(1.7) contrast(1.05); }
body.dark.sat-map .leaflet-tile-pane { filter: none; }

/* === ПИНЫ НА КАРТЕ (капля) === */
.poop-pin {
  width: 30px;
  height: 30px;
  border: 3px solid;            /* цвет = оценка (задаётся inline) */
  border-radius: 50% 50% 50% 0; /* капля остриём вниз-влево */
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 6px rgba(0,0,0,0.4);
}
.poop-pin span {
  transform: rotate(45deg);     /* распрямляем эмодзи обратно */
  font-size: 14px;
  line-height: 1;
}

/* === ПИН ЛЮБИМОГО МЕСТА (золотая капля) === */
.fav-pin {
  width: 30px;
  height: 30px;
  background: var(--accent, #f59e0b);
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0,0,0,0.45);
}
.fav-pin span { transform: rotate(45deg); font-size: 15px; line-height: 1; }
.popup-unfav { background: var(--danger, #e2625a); }
.popup-unfav:hover { background: #c44; }

/* === ПИН ТУАЛЕТА (OSM) === */
.toilet-pin {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e3f2fd;
  border: 2px solid #1976d2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.35);
}
.t-meta { color: #888; font-size: 12px; }
/* Кнопка маршрута внутри всплывашки туалета (заметнее, чем простая ссылка) */
.popup-route {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 14px;
  background: var(--brown);
  color: #fff !important;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.popup-route:hover { background: var(--brown-dark); }

/* === ПОИСК МЕСТА НА КАРТЕ === */
.map-search {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  gap: 6px;
  width: min(90%, 360px);
}
.map-search input {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 22px;
  box-shadow: var(--shadow);
  font-size: 15px;
  outline: none;
  background: var(--card);
  color: var(--text);
}
.map-search button {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 18px;
}
.map-search button:disabled { opacity: 0.5; cursor: default; }

.search-here {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  border: none;
  border-radius: 22px;
  padding: 10px 18px;
  background: var(--brown);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

/* Список результатов поиска места */
.search-results-list {
  position: absolute;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  width: min(92%, 360px);
  background: var(--card);
  color: var(--text);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.28);
  overflow-y: auto;
  max-height: 50vh;
}
.sr-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  color: var(--text);
}
.sr-item:last-child { border-bottom: none; }
.sr-item:hover { background: rgba(0,0,0,0.05); }
.sr-main { font-size: 15px; font-weight: 600; }
.sr-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }

/* «Иголочка» с какашкой (перетаскиваемая) */
.search-pin {
  width: 30px;
  height: 30px;
  background: var(--accent);
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 3px 9px rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-pin span { transform: rotate(45deg); font-size: 15px; line-height: 1; }


/* === ИНСТРУМЕНТЫ КАРТЫ (сгруппированы в один аккуратный блок) === */
.map-tools {
  position: absolute;
  left: 16px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.map-tool {
  width: 46px;
  height: 46px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
  transition: transform 0.12s, background 0.12s;
  border-bottom: 1px solid var(--border);
}
.map-tool:last-child { border-bottom: none; }
.map-tool:hover { background: rgba(20,184,166,0.10); }
.map-tool:active { transform: scale(0.9); }
.map-tool.active { background: rgba(20,184,166,0.18); box-shadow: inset 3px 0 0 var(--brown); }
.list-controls { display: flex; gap: 8px; margin: 8px 0 12px; }
.list-controls input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--border, #ddd); border-radius: 10px; font-size: 15px; }
.list-controls select { padding: 10px; border: 1px solid var(--border, #ddd); border-radius: 10px; font-size: 14px; }
.list-item {
  background: var(--card, #fff);
  border-radius: var(--radius);
  padding: 13px 15px;
  margin-bottom: 9px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.list-item:hover { box-shadow: var(--shadow); }
.list-item:active { transform: scale(0.985); }
.list-main { font-size: 15px; font-weight: 600; }
.list-meta { font-size: 13px; color: var(--muted, #777); margin-top: 2px; }

/* === МЕСТА (рейтинг туалетов) === */
.place-card {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius);
  padding: 13px 15px;
  margin-bottom: 9px;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.place-card:hover { box-shadow: var(--shadow); }
.place-card:active { transform: scale(0.985); }
.place-rank { font-size: 22px; flex: 0 0 auto; }
.place-info { flex: 1; min-width: 0; }
.place-name { font-weight: 600; font-size: 15px; }
.place-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.place-fav { background: none; border: none; font-size: 20px; cursor: pointer; flex: 0 0 auto; padding: 4px; line-height: 1; }

/* === ЛЮБИМЫЕ МЕСТА === */
.fav-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.fav-item:last-child { border-bottom: none; }
.fav-name { flex: 1; min-width: 0; font-weight: 600; }
.fav-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.fav-go { background: var(--brown); color: #fff; border: none; border-radius: 8px; padding: 8px 12px; font-size: 14px; font-weight: 600; cursor: pointer; }
.fav-del { background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer; padding: 4px 6px; }
.fav-del:hover { color: var(--danger); }

/* === РЕАКЦИИ НА МЕТКИ === */
.reactions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.react-btn {
  border: 1px solid var(--border, #ddd);
  background: var(--card, #fff);
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 16px;
  cursor: pointer;
}
.react-btn.reacted {
  background: var(--brown);
  color: #fff;
  border-color: var(--brown);
}

/* === КОММЕНТАРИИ ПОД МЕТКАМИ === */
.comments {
  max-height: 200px;
  overflow-y: auto;
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.comment {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
}
.comment-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.comment-head b { color: var(--brown-dark); font-size: 13px; }
.comment-when { font-size: 12px; }
.comment-del {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}
.comment-del:hover { color: var(--danger); }
.comment-body { font-size: 14px; margin-top: 3px; word-break: break-word; white-space: pre-wrap; }
body.dark .comment-head b { color: var(--brown-light); }

/* === ответы (треды) + реакции на комментарии === */
.comment-reply { margin-left: auto; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.comment-reply:hover { color: var(--brown); }
.comment-del { margin-left: 4px; }
.comment-replyto { font-size: 12px; color: var(--muted); margin-top: 2px; opacity: .85; }
.cr-bar { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 6px; }
.cr-chip { display: inline-flex; align-items: center; gap: 3px; background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; font-size: 13px; cursor: pointer; line-height: 1.7; }
.cr-chip span { font-size: 12px; color: var(--muted); }
.cr-chip.mine { border-color: var(--brown); background: var(--brown); color: #fff; }
.cr-chip.mine span { color: #fff; }
.cr-add { background: none; border: 1px dashed var(--border); border-radius: 999px; color: var(--muted); cursor: pointer; font-size: 12px; padding: 1px 8px; line-height: 1.7; }
.cr-add:hover { color: var(--brown); border-color: var(--brown); }
.cr-pick { display: none; position: absolute; bottom: 100%; left: 0; margin-bottom: 4px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 4px 6px; box-shadow: 0 6px 20px rgba(0,0,0,.18); z-index: 5; }
.cr-pick.open { display: flex; gap: 2px; }
.cr-pick button { background: none; border: none; font-size: 19px; cursor: pointer; padding: 2px 4px; border-radius: 8px; line-height: 1; }
.cr-pick button:hover { background: var(--bg); }
.comment-reply-bar { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); background: var(--bg); border-left: 3px solid var(--brown); border-radius: 6px; padding: 5px 8px; margin: 4px 0; }
.comment-reply-bar b { color: var(--brown-dark); }
.reply-cancel { margin-left: auto; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; }
.reply-cancel:hover { color: var(--danger); }
body.dark .comment-reply-bar b { color: var(--brown-light); }

.comment-add { display: flex; gap: 8px; margin: 6px 0 2px; }
.comment-add input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
}
.comment-add button {
  flex: 0 0 auto;
  width: 46px;
  border: none;
  border-radius: 10px;
  background: var(--brown);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}
.comment-add button:disabled { opacity: 0.5; cursor: default; }

/* === ЛЕНТА АКТИВНОСТИ === */
.feed-card {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--card, #fff);
  border-radius: var(--radius);
  padding: 13px 15px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  border-left: 4px solid var(--feed-color, var(--brown-light));
}
.feed-card:active { transform: scale(0.98); }
.feed-card:hover { box-shadow: var(--shadow); }
.feed-pin {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 2px solid rgba(0,0,0,0.1);
}
.feed-body { flex: 1; min-width: 0; }
.feed-top { font-size: 15px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.feed-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-time { font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.fc-place { font-size: 13px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.fc-chip { font-size: 11px; font-weight: 600; background: var(--bg); color: var(--text); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.fc-verdict { background: linear-gradient(135deg, rgba(245,158,11,.20), rgba(20,184,166,.16)); }
.fc-ach-chip { background: rgba(245,158,11,.20); }
.fc-notif-text { font-size: 13px; color: var(--text); margin-top: 3px; line-height: 1.4; word-break: break-word; }
.fc-razbor-text { font-size: 13px; color: var(--text); margin-top: 3px; line-height: 1.4; }
.feed-razbor { cursor: pointer; }
.feed-notif { cursor: pointer; }
.feed-meta { font-size: 14px; color: var(--muted, #777); margin-top: 2px; }
.feed-date { font-size: 12px; color: var(--muted, #999); margin-top: 2px; }
/* разделитель дня в ленте */
.feed-day { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 16px 4px 7px; }
.feed-day:first-child { margin-top: 2px; }
/* Сворачиваемый блок «Ещё детали» в форме чекина */
.add-more-label { margin: 16px 0 2px; font-size: 14px; font-weight: 800; color: var(--text); border-top: 1px solid var(--border); padding-top: 14px; }
.add-more { margin-top: 2px; }
.view-quip { font-style: italic; color: var(--accent); font-size: 14px; margin-top: 4px; }
.food-custom-input { width: 100%; margin-top: 8px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; background: var(--card); color: var(--text); box-sizing: border-box; }

/* === СЕКЦИИ ФОРМЫ ЧЕКИНА — каждая группа в своей карточке («более цельно») === */
.form-section { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 11px 13px 13px; margin: 10px 0; }
.form-section > label:first-of-type { margin-top: 2px; }
.fs-head { font-size: 13px; font-weight: 800; color: var(--brown-dark); margin-bottom: 9px; letter-spacing: .2px; }
.fs-head .lbl-hint { font-weight: 400; }
/* инпуты внутри секции — белые, чтобы был контраст с фоном секции */
.form-section input[type="text"], .form-section input[type="datetime-local"], .form-section textarea, .form-section .food-custom-input { background: var(--card); }

/* === АНИМАЦИИ ПРОЦЕССА (эмодзи-частицы по типу захода) === */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 4000; overflow: hidden; }
.fx-p { position: absolute; top: -10vh; opacity: 0; will-change: transform, opacity; filter: drop-shadow(0 2px 3px rgba(0,0,0,.18)); }
.fx-rain { animation-name: fxRain; animation-timing-function: ease-in; animation-fill-mode: forwards; }
.fx-rise { top: auto; bottom: -8vh; animation-name: fxRise; animation-timing-function: ease-out; animation-fill-mode: forwards; }
.fx-float { top: auto; bottom: 1vh; animation-name: fxFloat; animation-timing-function: ease-in-out; animation-fill-mode: forwards; }
@keyframes fxRain { 0% { opacity: 0; transform: translateY(-12vh) rotate(0); } 12% { opacity: 1; } 100% { opacity: .15; transform: translateY(118vh) translateX(var(--dx, 0px)) rotate(var(--rot, 180deg)); } }
@keyframes fxRise { 0% { opacity: 0; transform: translateY(8vh) scale(.5); } 18% { opacity: 1; } 100% { opacity: 0; transform: translateY(-116vh) translateX(var(--dx, 0px)) rotate(var(--rot, 180deg)) scale(1); } }
@keyframes fxFloat { 0% { opacity: 0; transform: translateY(14vh) scale(.6); } 22% { opacity: .95; } 100% { opacity: 0; transform: translateY(-70vh) translateX(var(--dx, 0px)) rotate(var(--rot, 90deg)) scale(.95); } }
@media (prefers-reduced-motion: reduce) { .fx-layer { display: none; } }

/* === МАСКОТ БРЕНДА (какашка в кепке) === */
.auth-mascot { width: 132px; height: 132px; object-fit: contain; display: block; margin: 4px auto 2px; filter: drop-shadow(0 6px 12px rgba(0,0,0,.15)); }
.logo-mascot { height: 1.7em; width: auto; vertical-align: -0.5em; margin-right: 5px; }
.inline-mascot { height: 1.5em; width: auto; vertical-align: -0.35em; margin-right: 6px; }

/* === МОНЕТКИ 🪙 === */
.coin-counter { display: inline-flex; align-items: center; gap: 2px; background: #fff7e0; color: #7a5a00; font-weight: 800; font-size: 13px; padding: 4px 10px; border-radius: 999px; border: 1px solid #f0d98a; margin-right: 4px; white-space: nowrap; }
.coin-counter b { font-weight: 900; }
.feed-coins .feed-pin { font-size: 20px; }
.feed-coins .feed-meta { color: #a07a10; }

/* === 🐾 ПИТОМЕЦ === */
.pet-content { max-width: 460px; text-align: center; }
.pet-content h3 { margin: 0 0 4px; color: var(--brown-dark); }
.pet-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
.pet-card { display: flex; flex-direction: column; align-items: center; gap: 5px; background: var(--bg); border: 1px solid var(--border); border-radius: 16px; padding: 12px 8px; cursor: pointer; font: inherit; color: inherit; transition: transform .1s, border-color .15s; }
.pet-card:hover { border-color: var(--brown); transform: translateY(-2px); }
.pet-card img { width: 88px; height: 88px; object-fit: contain; }
.pet-card span { font-weight: 800; font-size: 13px; }
.pet-stage { display: flex; justify-content: center; align-items: flex-end; height: 230px; position: relative; }
.pet-hero { width: 200px; height: 200px; object-fit: contain; transform-origin: bottom center; animation: petBreathe 3.2s ease-in-out infinite; filter: drop-shadow(0 10px 16px rgba(0,0,0,.2)); }
@keyframes petBreathe { 0%,100% { transform: scale(1) translateY(0); } 50% { transform: scale(1.045) translateY(-5px); } }
.pet-name { font-size: 22px; font-weight: 900; color: var(--brown-dark); margin-top: 2px; }
.pet-coins { font-size: 15px; margin-top: 6px; }
.pet-soon { font-size: 13px; opacity: .75; margin: 12px 0; }
.pet-change { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 8px 14px; cursor: pointer; font: inherit; color: inherit; margin-top: 12px; }
.pet-meters { display: flex; gap: 14px; justify-content: center; margin: 8px 0 2px; }
.pmeter { display: flex; align-items: center; gap: 5px; font-size: 15px; }
.pbar { width: 92px; height: 10px; background: var(--border); border-radius: 6px; overflow: hidden; }
.pbar i { display: block; height: 100%; background: #16a34a; transition: width .3s; }
.pet-shop { margin-top: 12px; }
.pet-shop-title { font-size: 13px; font-weight: 800; color: var(--brown-dark); margin-bottom: 8px; }
.food-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.food-card { display: flex; flex-direction: column; align-items: center; gap: 3px; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 8px 4px; cursor: pointer; font: inherit; color: inherit; transition: transform .1s, border-color .15s; }
.food-card:hover { transform: translateY(-2px); border-color: var(--brown); }
.food-card img { width: 46px; height: 46px; object-fit: contain; }
.food-card span { font-size: 11px; font-weight: 800; }
.food-card { touch-action: none; }
.food-ghost { position: fixed; width: 58px; height: 58px; transform: translate(-50%, -50%); pointer-events: none; z-index: 9000; filter: drop-shadow(0 5px 9px rgba(0,0,0,.35)); }
.pet-poop { position: absolute; bottom: 2px; left: 62%; font-size: 30px; animation: petBreathe 2.2s ease-in-out infinite; }
.pet-zzz { position: absolute; top: 6%; right: 24%; font-size: 30px; animation: zzzFloat 2.4s ease-in-out infinite; }
@keyframes zzzFloat { 0%,100% { transform: translateY(0); opacity: .55; } 50% { transform: translateY(-12px); opacity: 1; } }
.pet-stage.pet-sleeping { filter: brightness(.92) saturate(.85); }
.pet-sleepmsg { font-size: 15px; font-weight: 800; color: var(--brown-dark); margin: 12px 0; }
@keyframes petRumble { 0%, 100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-4px) rotate(-2.5deg); } 75% { transform: translateX(4px) rotate(2.5deg); } }
.pet-hero.pet-rumble { animation: petRumble .22s ease-in-out 4; }
.digest-fx { position: absolute; bottom: 4px; left: 50%; width: 0; height: 0; pointer-events: none; z-index: 5; }
.digest-fx span { position: absolute; left: 0; bottom: 0; animation: digestRise 1.5s ease-out forwards; }
@keyframes digestRise { 0% { transform: translate(0, 0) scale(.55); opacity: 0; } 18% { opacity: 1; } 100% { transform: translate(var(--dx), -95px) scale(1.15); opacity: 0; } }
.pet-speech { position: absolute; top: 2px; left: 50%; transform: translateX(-50%) scale(.8); max-width: 88%; background: #fff; border: 2px solid #e6b877; border-radius: 16px; padding: 7px 13px; font-size: 13px; font-weight: 800; line-height: 1.25; color: #5a3d1e; text-align: center; box-shadow: 0 5px 16px rgba(0,0,0,.16); opacity: 0; transition: opacity .3s ease, transform .3s ease; pointer-events: none; z-index: 9; }
.pet-speech.show { opacity: 1; transform: translateX(-50%) scale(1); }
.pet-speech::after { content: ''; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); border: 7px solid transparent; border-top-color: #fff; }
body.dark .pet-speech { background: #2a2118; color: #f0e0c8; border-color: #6b4f2a; }
body.dark .pet-speech::after { border-top-color: #2a2118; }
.coin-test { margin-left: 8px; padding: 3px 10px; font-size: 11px; font-weight: 800; border: none; border-radius: 999px; background: #ffd966; color: #6b4f1a; cursor: pointer; vertical-align: middle; }
.coin-test:active { transform: scale(.94); }
.suds { position: absolute; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #fff, #e3eef8 68%, #cdddee); box-shadow: 0 1px 3px rgba(0,0,0,.12), inset 0 -2px 4px rgba(120,150,180,.45); transform: translate(-50%,-50%) scale(0); animation: sudsPop .25s ease forwards; pointer-events: none; z-index: 6; }
@keyframes sudsPop { 0% { transform: translate(-50%,-50%) scale(0); } 70% { transform: translate(-50%,-50%) scale(1.15); } 100% { transform: translate(-50%,-50%) scale(1); } }
.suds.rinsing { animation: sudsWash .5s ease forwards; }
@keyframes sudsWash { to { transform: translate(-50%,-50%) translateY(46px) scale(.2); opacity: 0; } }
.shower-head { position: absolute; top: -4px; left: 50%; transform: translateX(-50%); font-size: 34px; padding: 2px 8px; z-index: 8; cursor: pointer; pointer-events: auto; filter: drop-shadow(0 2px 3px rgba(0,0,0,.28)); animation: showerBob 1.8s ease-in-out infinite; }
.shower-head:active { animation: none; transform: translateX(-50%) scale(.88); }
@keyframes showerBob { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-3px); } }
.water-drop { position: absolute; top: 22px; width: 5px; border-radius: 0 0 4px 4px; background: linear-gradient(#cdeaff, #6fb8f0); opacity: 0; pointer-events: none; z-index: 7; animation: waterFall .95s linear forwards; }
@keyframes waterFall { 0% { transform: translateY(0); opacity: 0; } 12% { opacity: .95; } 100% { transform: translateY(206px); opacity: 0; } }
.pet-hero { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; pointer-events: none; }
.pet-stage { touch-action: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.pet-poop { cursor: pointer; pointer-events: auto; }
.pet-flies { position: absolute; inset: 0; pointer-events: none; z-index: 7; }
.pet-flies span { position: absolute; font-size: 15px; }
.pet-flies span:nth-child(1) { left: 56%; top: 18%; animation: flyA 2.2s ease-in-out infinite; }
.pet-flies span:nth-child(2) { left: 40%; top: 30%; animation: flyB 2.6s ease-in-out infinite; }
.pet-flies span:nth-child(3) { left: 64%; top: 40%; animation: flyA 1.9s ease-in-out infinite reverse; }
@keyframes flyA { 0%, 100% { transform: translate(0,0); } 25% { transform: translate(13px,-9px); } 50% { transform: translate(-7px,7px); } 75% { transform: translate(9px,5px); } }
@keyframes flyB { 0%, 100% { transform: translate(0,0); } 33% { transform: translate(-11px,-7px); } 66% { transform: translate(11px,9px); } }
.pet-stink { position: absolute; left: 50%; top: 12%; transform: translateX(-50%); display: flex; gap: 11px; pointer-events: none; z-index: 6; }
.pet-stink span { font-size: 20px; font-weight: 900; color: #8aa83a; opacity: 0; animation: stinkRise 2.4s ease-in-out infinite; }
.pet-stink span:nth-child(2) { animation-delay: .8s; }
.pet-stink span:nth-child(3) { animation-delay: 1.6s; }
@keyframes stinkRise { 0% { transform: translateY(0) scaleX(1); opacity: 0; } 30% { opacity: .75; } 100% { transform: translateY(-28px) scaleX(1.5); opacity: 0; } }
.pet-stage { cursor: pointer; }
.pet-hero.pet-poke { animation: petPoke .42s ease; }
@keyframes petPoke { 0% { transform: scale(1); } 30% { transform: scale(1.14) translateY(-7px); } 60% { transform: scale(.96); } 100% { transform: scale(1); } }
.pet-hero.pet-blink { animation: petBlink .22s ease; transform-origin: center bottom; }
@keyframes petBlink { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.8); } }
.pet-hero.pet-wiggle { animation: petWiggle .5s ease; transform-origin: center bottom; }
@keyframes petWiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-5deg); } 75% { transform: rotate(5deg); } }
.pet-hero.pet-wander { animation: petWander 2.4s ease-in-out; }
@keyframes petWander { 0% { transform: translateX(0); } 25% { transform: translateX(-30px); } 50% { transform: translateX(24px); } 75% { transform: translateX(-12px); } 100% { transform: translateX(0); } }
.pet-sick { position: absolute; top: 8%; left: 28%; font-size: 26px; animation: zzzFloat 2s ease-in-out infinite; }
.pet-sickmsg { font-size: 14px; font-weight: 800; color: #c0392b; margin: 6px 0; }
.pet-hat { position: absolute; top: 4%; left: 50%; transform: translateX(-50%); font-size: 40px; z-index: 8; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.pet-level { font-size: 12px; font-weight: 800; color: #b8860b; background: #fff6da; border-radius: 999px; padding: 2px 9px; }
.pet-xpbar { height: 5px; background: rgba(0,0,0,.1); border-radius: 999px; margin: 5px auto 0; max-width: 170px; overflow: hidden; }
.pet-xpbar i { display: block; height: 100%; background: #f1c40f; border-radius: 999px; transition: width .4s; }
.hat-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.hat-chip { font-size: 24px; background: #f3f3f3; border: 2px solid transparent; border-radius: 12px; padding: 6px 9px; cursor: pointer; position: relative; line-height: 1; }
.hat-chip.on { border-color: #f1c40f; background: #fff6da; }
.hat-chip b { display: block; font-size: 9px; font-weight: 800; color: #777; }
body.dark .pet-level { background: #4a3a12; color: #ffe08a; }
body.dark .hat-chip { background: #2a2a2a; }
.pet-stage { border-radius: 16px; }
.pet-stage.room-cozy { background: linear-gradient(#fff5e6 0 72%, #e8c9a0 72%); }
.pet-stage.room-night { background: linear-gradient(#243a6b 0 72%, #16203f 72%); }
.pet-stage.room-beach { background: linear-gradient(#bdeaff 0 72%, #f3e2a9 72%); }
.pet-stage.room-party { background: linear-gradient(#ffd9f3 0 72%, #c9b6ff 72%); }
.pet-stage.room-loo { background: linear-gradient(#e6f3f8 0 72%, #b9d6e0 72%); }
.pet-decor { position: absolute; bottom: 6px; right: 10px; font-size: 30px; pointer-events: none; z-index: 4; filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }
.pet-daily { font-size: 13px; font-weight: 700; color: var(--brown-dark); background: #fff6da; border-radius: 12px; padding: 6px 10px; margin: 6px auto; display: inline-block; }
.pet-daily span { font-size: 18px; margin: 0 2px; filter: grayscale(1); opacity: .45; }
.pet-daily span.done { filter: none; opacity: 1; }
.pet-daily b { color: #16a34a; }
body.dark .pet-daily { background: #3a3320; color: #f0e0c8; }
.pet-pill { position: absolute; font-size: 26px; transform: translate(-50%, -50%); transition: left .4s ease-in, top .4s ease-in, transform .4s ease-in, opacity .4s ease-in; z-index: 9; pointer-events: none; }
.pet-broom { position: absolute; bottom: 6px; left: -34px; font-size: 32px; z-index: 7; pointer-events: none; animation: broomSweep .85s ease forwards; }
@keyframes broomSweep { 0% { left: -34px; transform: rotate(-15deg); } 100% { left: 80%; transform: rotate(18deg); } }
.pet-poop.sweeping { animation: poopSweep .6s .15s ease forwards; }
@keyframes poopSweep { to { transform: translateX(130px) rotate(80deg); opacity: 0; } }
.pet-ball { position: absolute; bottom: 10px; left: 25%; font-size: 30px; z-index: 7; pointer-events: none; animation: ballBounce 2.2s ease-in-out; }
@keyframes ballBounce { 0% { left: 18%; bottom: 10px; } 15% { bottom: 95px; } 30% { bottom: 10px; left: 58%; } 45% { bottom: 80px; } 60% { bottom: 10px; left: 32%; } 75% { bottom: 70px; } 90% { bottom: 10px; left: 50%; } 100% { bottom: 14px; left: 45%; } }
.pet-bubble { position: absolute; bottom: 12px; font-size: 26px; z-index: 7; pointer-events: none; animation: bubbleUp 2.2s ease-in forwards; }
@keyframes bubbleUp { 0% { transform: translateY(0) scale(.5); opacity: 0; } 12% { opacity: .95; } 70% { opacity: .95; } 100% { transform: translateY(-185px) scale(1.15); opacity: 0; } }
.pet-bubble.pop { animation: bubblePop .3s ease forwards; }
@keyframes bubblePop { 0% { transform: scale(1); opacity: .95; } 100% { transform: scale(1.7); opacity: 0; } }
.pet-laser { position: absolute; width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff7b7b, #e60000 60%, #a30000); box-shadow: 0 0 10px 3px rgba(255,0,0,.7); z-index: 8; pointer-events: none; left: 20%; top: 70%; animation: laserDart 3.4s ease-in-out forwards; }
@keyframes laserDart { 0% { left: 20%; top: 72%; } 15% { left: 70%; top: 40%; } 30% { left: 35%; top: 30%; } 45% { left: 78%; top: 66%; } 60% { left: 18%; top: 48%; } 75% { left: 60%; top: 75%; } 90% { left: 45%; top: 35%; } 100% { left: 50%; top: 60%; opacity: 0; } }
/* покадровая спрайт-анимация (Мурзик) */
.pet-hero.pet-anim-host { width: 200px; height: 200px; object-fit: unset; animation: petBreathe 3.2s ease-in-out infinite; }
.pet-sprite { --pw: 200px; --n: 6; --dur: .9s; width: var(--pw); height: var(--pw); background-repeat: no-repeat; background-position: 0 0; background-size: calc(var(--n) * var(--pw)) var(--pw); image-rendering: auto; animation: spriteRun var(--dur) steps(var(--n)) infinite; }
.pet-rive { width: 100%; height: 100%; display: block; touch-action: none; }
@keyframes spriteRun { to { background-position-x: calc(-1 * var(--n) * var(--pw)); } }
.pet-full-note { font-size: 14px; font-weight: 800; color: var(--brown-dark); padding: 14px 8px; opacity: .85; }
@keyframes petEat { 0%,100% { transform: scale(1) rotate(0); } 30% { transform: scale(1.12) rotate(-3deg); } 60% { transform: scale(.96) rotate(2deg); } }
.pet-hero.pet-eat { animation: petEat .65s ease; }
.pet-care { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.pet-care button { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 9px 14px; cursor: pointer; font: inherit; font-weight: 700; color: inherit; transition: transform .1s, border-color .15s; }
.pet-care button:hover { transform: translateY(-2px); border-color: var(--brown); }
@keyframes petSleep { 0%,100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.02) rotate(1.5deg); } }
.pet-hero.pet-sleep { animation: petSleep 1.6s ease; filter: grayscale(.25) brightness(.96); }
.pet-stage.washing { touch-action: none; cursor: cell; }
.sponge { position: absolute; transform: translate(-50%, -50%); font-size: 36px; pointer-events: none; z-index: 6; filter: drop-shadow(0 3px 4px rgba(0,0,0,.3)); }
.foam { position: absolute; width: 18px; height: 18px; transform: translate(-50%, -50%) scale(var(--s, 1)); background: radial-gradient(circle at 35% 30%, #fff, #cfe6ff); border-radius: 50%; pointer-events: none; box-shadow: 0 0 5px rgba(255,255,255,.85); animation: foamPop .9s ease forwards; z-index: 5; }
@keyframes foamPop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.2); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -130%) scale(var(--s, 1)); } }

/* === ПАЛИТРА ЦВЕТА МЕТКИ === */
.color-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin: 10px 0 4px;
}
.color-swatch {
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  border: 3px solid transparent;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  transition: transform 0.1s;
}
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.selected { border-color: #111; }

/* === КОНФЕТТИ === */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 4000; overflow: hidden; }
.confetti-layer span { position: absolute; top: -40px; animation: confetti-fall 2s linear forwards; }
@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0.2; }
}

/* === ПОДСКАЗКА НА ПУСТОЙ КАРТЕ === */
.map-hint {
  position: absolute;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brown-dark);
  color: #fff;
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 800;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  max-width: 90%;
  text-align: center;
}

/* === ЛИДЕРБОРД === */
#leaderboard { margin-bottom: 12px; }
.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--radius);
  margin-bottom: 7px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.lb-row.me { background: linear-gradient(135deg, rgba(20,184,166,.10), var(--card)); box-shadow: 0 0 0 1.5px var(--brown-light) inset, var(--shadow-sm); }
.lb-rank { font-size: 16px; width: 26px; text-align: center; flex: 0 0 auto; }
.lb-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-stat { font-size: 13px; color: var(--muted); flex: 0 0 auto; white-space: nowrap; }

/* === СЧЁТЧИК ЗАЯВОК === */
.badge-count {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  padding: 0 5px;
  margin-left: 5px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
}

/* === УВЕДОМЛЕНИЯ (колокольчик) === */
#notif-content { max-height: 60vh; overflow-y: auto; }
.notif-item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 10px;
  margin-bottom: 8px;
  background: var(--bg);
}
.notif-item.clickable { cursor: pointer; }
.notif-item.clickable:hover { background: rgba(0,0,0,0.04); }
.notif-item.unseen { border-left-color: var(--brown-light); background: rgba(45,154,134,0.08); }
.notif-text { font-size: 14px; }
.notif-when { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* === АНИМАЦИИ === */
.modal:not(.hidden) .modal-content { animation: modal-in 0.22s ease; }
@keyframes modal-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.view:not(.hidden) .container { animation: fade-in 0.25s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* === ОКНО РЕГИСТРАЦИИ === */
#signup-modal input { margin-bottom: 12px; }

/* === ПОДСКАЗКИ ЗАВЕДЕНИЙ РЯДОМ (при добавлении метки) === */
.place-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: -4px 0 6px;
}
.place-chip {
  border: 1px solid var(--border);
  background: #fafafa;
  border-radius: 16px;
  padding: 5px 10px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
}
.place-chip:hover { border-color: var(--brown-light); }
.place-chip.mine { background: var(--brown); color: #fff; border-color: var(--brown); }
.place-chip.fav { background: var(--accent, #f59e0b); color: #3a2a00; border-color: var(--accent, #f59e0b); font-weight: 600; }
.place-chip.fav:hover { filter: brightness(1.05); }
body.dark .place-chip { background: #11201d; }

/* мягкое предложение «в любимые» (не-блокирующее) */
.fav-offer {
  position: fixed; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  z-index: 1200; max-width: min(440px, calc(100vw - 24px));
  display: flex; align-items: center; gap: 10px;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-left: 4px solid var(--accent, #f59e0b);
  border-radius: 12px; padding: 10px 12px; box-shadow: 0 8px 28px rgba(0,0,0,.22);
  transition: transform .25s, opacity .25s;
}
.fav-offer.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.fav-offer-txt { font-size: 13px; line-height: 1.3; }
.fav-offer-btns { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: 0 0 auto; }
.fav-offer-yes { background: var(--accent, #f59e0b); color: #3a2a00; border: none; border-radius: 8px; padding: 7px 10px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.fav-offer-no { background: none; border: none; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; padding: 2px 4px; }

/* === КНОПКА «УТОЧНИТЬ НА КАРТЕ» === */
.link-btn {
  background: none;
  border: none;
  color: var(--brown);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  margin: -4px 0 14px;
  text-decoration: underline;
}
body.dark .link-btn { color: var(--brown-light); }

/* === БАННЕР УСТАНОВКИ PWA === */
.install-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  background: var(--brown-dark);
  color: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 3500;
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
  font-size: 14px;
}

.install-banner #install-text { flex: 1; }

.install-btn {
  background: #fff;
  color: var(--brown-dark);
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.install-x {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

@media (min-width: 600px) {
  .install-banner { left: auto; right: 16px; max-width: 360px; }
}

/* ===== Ачивка-анимация (дождь из какашек + баннер) ===== */
.ach-unlock-overlay {
  position: fixed; inset: 0; z-index: 7500;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.65);
  animation: ach-fade .3s ease;
  cursor: pointer;
}
@keyframes ach-fade { from { opacity:0 } to { opacity:1 } }
.ach-unlock-inner {
  background: var(--card, #182421);
  border: 2px solid var(--accent, #f59e0b);
  border-radius: 20px; padding: 30px 40px; text-align: center;
  animation: ach-pop .4s cubic-bezier(.34,1.56,.64,1);
  position: relative; z-index: 1; pointer-events: none;
}
@keyframes ach-pop {
  from { transform: scale(.3); opacity:0 }
  to   { transform: scale(1);  opacity:1 }
}
.ach-unlock-title { color: var(--accent,#f59e0b); font-weight:700; font-size:13px; margin:10px 0 4px; text-transform:uppercase; letter-spacing:.5px; }
.ach-unlock-name  { font-size:22px; font-weight:800; }
.ach-unlock-desc  { font-size:14px; opacity:.75; margin-top:4px; }
.ach-unlock-hint  { font-size:11px; opacity:.4; margin-top:12px; }

/* ===== Анимация дропа 💩-пина ===== */
/* Какуля падает сверху, делает САЛЬТО (полный переворот −405°→−45°), шлёпается
   и весело прыгает пару раз со «сквошем». translate перед rotate — прыжок строго вертикальный. */
@keyframes pin-drop {
  0%   { transform: translateY(-55px) rotate(-405deg) scale(0.55, 0.55); opacity: 0; } /* высоко, в начале сальто */
  14%  { opacity: 1; }
  28%  { transform: translateY(0)     rotate(-45deg)  scale(1.2, 0.8); }   /* сальто завершено, шлёпок + сплющивание */
  44%  { transform: translateY(-26px) rotate(-45deg)  scale(0.9, 1.1); }   /* большой подскок */
  60%  { transform: translateY(0)     rotate(-45deg)  scale(1.12, 0.88); } /* второй шлёпок */
  76%  { transform: translateY(-11px) rotate(-45deg)  scale(0.96, 1.04); } /* подскок поменьше */
  90%  { transform: translateY(0)     rotate(-45deg)  scale(1.04, 0.96); }
  100% { transform: translateY(0)     rotate(-45deg)  scale(1, 1); }
}
.poop-pin.dropping,
.search-pin.dropping { animation: pin-drop 0.85s cubic-bezier(.3,.7,.4,1) forwards; transform-origin: center center; }

/* ===== Скелетон-загрузки ===== */
.skeleton-card {
  background: var(--card); border-radius: var(--radius,14px);
  padding: 14px; margin-bottom: 10px; overflow: hidden;
}
.skeleton-line {
  height: 14px; border-radius: 6px; margin-bottom: 8px;
  background-color: var(--border);
  background-image: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.28) 50%, transparent 100%);
  background-size: 180% 100%;
  background-repeat: no-repeat;
  animation: sk-wave 1.3s ease-in-out infinite;
}
.skeleton-line.short { width: 55%; }
.skeleton-line.tiny  { width: 35%; height: 10px; margin-bottom: 0; }
@keyframes sk-wave { from { background-position: 200% 0 } to { background-position: -200% 0 } }

/* ===== Шапка профиля ===== */
.profile-header {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 0 14px; margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.profile-header .profile-avatar { margin-right: 6px; }
.profile-username { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--profile-color, var(--brown));
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.profile-username { font-size: 18px; font-weight: 800; color: var(--text); }
.profile-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.profile-info { flex: 1; min-width: 0; }

/* ===== Компактная форма метки (меньше листать) ===== */
#add-modal label { display: block; margin: 10px 0 3px; font-size: 13px; font-weight: 600; opacity: 0.9; }
#add-modal .lbl-hint { font-weight: 400; opacity: 0.55; font-size: 11px; }
#add-modal input, #add-modal textarea { margin-bottom: 0; }
#add-modal .field-hint { font-size: 12px; opacity: 0.7; min-height: 15px; margin-top: 2px; }
#add-modal .rating { margin: 2px 0; font-size: 26px; }
#add-modal .process-chips, #add-modal .bristol-scale { margin-top: 3px; }
#add-modal .place-suggest { margin-top: 4px; }
#add-modal .field-row { display: flex; gap: 8px; }
#add-modal .field-row .grow { flex: 1; min-width: 0; }
#add-modal #pick-on-map { margin: 2px 0 0; }
/* чуть компактнее чипы внутри формы */
#add-modal .chip { padding: 6px 10px; font-size: 13px; }

/* ===== Шкала Бристола ===== */
.bristol-scale { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.bristol-chip {
  flex: 1; min-width: 40px; display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 8px 2px; border-radius: 10px; cursor: pointer;
  border: 2px solid transparent; background: var(--border); transition: transform 0.1s;
}
.bristol-chip .br-emoji { font-size: 20px; line-height: 1; }
.bristol-chip .br-n { font-size: 11px; font-weight: 700; opacity: 0.7; }
.bristol-chip.zone-hard { background: rgba(217,119,6,0.18); }
.bristol-chip.zone-norm { background: rgba(16,185,129,0.18); }
.bristol-chip.zone-soft { background: rgba(59,130,246,0.18); }
.bristol-chip.selected { border-color: var(--brown); transform: scale(1.06); }
.bristol-chip:active { transform: scale(0.94); }
/* Новые карточки Бристола (build 94) */
.bristol-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 4px; }
.bristol-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 9px 3px 7px; border-radius: 14px; cursor: pointer; border: 2px solid transparent; background: var(--border); min-height: 76px; transition: transform .1s; text-align: center; font-family: inherit; }
.bristol-card .bc-e { font-size: 24px; line-height: 1; }
.bristol-card .bc-n { font-size: 10px; font-weight: 800; opacity: .65; }
.bristol-card .bc-l { font-size: 9px; font-weight: 700; line-height: 1.1; color: var(--muted); }
.bristol-card.zone-hard { background: rgba(232,146,58,.14); border-color: rgba(232,146,58,.28); }
.bristol-card.zone-norm { background: rgba(55,178,77,.14); border-color: rgba(55,178,77,.28); }
.bristol-card.zone-soft { background: rgba(58,160,232,.14); border-color: rgba(58,160,232,.28); }
.bristol-card.unknown { background: var(--border); border-style: dashed; }
.bristol-card.selected { border-width: 3px; transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,.12); }
.bristol-card.zone-hard.selected { border-color: #e8923a; }
.bristol-card.zone-norm.selected { border-color: #37b24d; }
.bristol-card.zone-soft.selected { border-color: #3aa0e8; }
.bristol-card:active { transform: scale(.95); }
.bristol-zones { display: flex; justify-content: space-between; font-size: 10px; font-weight: 800; margin-top: 7px; padding: 0 4px; }
.bristol-zones .z-h { color: #e8923a; } .bristol-zones .z-n { color: #37b24d; } .bristol-zones .z-s { color: #3aa0e8; }
.redflag-hint { font-size: 11px; color: #b07d3a; background: #fff4e2; border-radius: 10px; padding: 8px 11px; margin: 6px 0 2px; font-weight: 700; line-height: 1.35; }
body.dark .redflag-hint { background: #3a2e1a; color: #e6c089; }

/* ===== Титулы компании ===== */
#titles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 8px; }
.title-card {
  display: flex; align-items: center; gap: 9px;
  background: var(--card); box-shadow: var(--shadow-sm); border-radius: var(--radius);
  padding: 11px 12px; cursor: pointer; transition: transform 0.1s, box-shadow 0.12s;
}
.title-card:hover { box-shadow: var(--shadow); }
.title-card:active { transform: scale(0.97); }
.title-card.me { background: linear-gradient(135deg, rgba(245,158,11,.12), var(--card)); box-shadow: 0 0 0 1.5px var(--accent) inset, var(--shadow-sm); }
.title-emoji { font-size: 26px; line-height: 1; flex-shrink: 0; }
.title-name { font-weight: 700; font-size: 13px; }
.title-holder { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* ===== Календарь активности ===== */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 10px; }
.cal-title { font-weight: 700; font-size: 15px; text-transform: capitalize; }
.cal-nav { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-size: 20px; cursor: pointer; line-height: 1; }
.cal-nav:disabled { opacity: 0.3; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-wd { text-align: center; font-size: 11px; color: var(--muted); padding-bottom: 2px; }
.cal-cell { aspect-ratio: 1; border-radius: 9px; background: var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; transition: transform 0.1s; }
.cal-cell.empty { background: transparent; }
.cal-cell .cal-d { font-size: 13px; opacity: 0.5; }
.cal-cell.has { cursor: pointer; }
.cal-cell.has .cal-d { opacity: 0.95; font-weight: 700; }
.cal-cell .cal-dot { font-size: 11px; line-height: 1; margin-top: 1px; }
.cal-cell.lvl1 { background: rgba(13,148,136,0.35); }
.cal-cell.lvl2 { background: rgba(13,148,136,0.62); }
.cal-cell.lvl3 { background: rgba(13,148,136,0.92); }
.cal-cell.lvl2 .cal-d, .cal-cell.lvl3 .cal-d { color: #fff; opacity: 1; }
.cal-cell.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-cell.has:active { transform: scale(0.92); }

/* ===== Баннер обновления ===== */
#update-banner {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(80px + env(safe-area-inset-bottom));
  z-index: 8000; display: flex; align-items: center; gap: 12px;
  background: var(--brown); color: #fff;
  padding: 10px 12px 10px 16px; border-radius: 30px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  font-size: 14px; font-weight: 600; max-width: 92vw;
  animation: ub-rise 0.3s ease;
}
@keyframes ub-rise { from { opacity:0; transform: translate(-50%, 12px) } to { opacity:1; transform: translate(-50%, 0) } }
#update-banner button {
  background: #fff; color: var(--brown); border: none;
  border-radius: 20px; padding: 7px 14px; font-weight: 700;
  font-size: 13px; cursor: pointer; white-space: nowrap;
}

/* ===== Пустые состояния ===== */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 48px 24px; text-align: center;
  gap: 10px; min-height: 200px;
}
.empty-state .es-emoji { font-size: 56px; line-height: 1; animation: es-bob 2.5s ease-in-out infinite; }
@keyframes es-bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
.empty-state .es-title { font-size: 17px; font-weight: 700; }
.empty-state .es-sub { font-size: 14px; color: var(--muted); max-width: 260px; line-height: 1.5; }

/* ===== Туалет — оценки в попапе ===== */
.toilet-rate-block { border-top: 1px solid #374a45; margin-top: 8px; padding-top: 6px; }
.tr-s { font-size: 19px; cursor: pointer; user-select: none; display: inline-block; padding: 4px 4px; }
.tr-s:hover { transform: scale(1.2); display: inline-block; }
.t-attr-row { display: flex; gap: 6px; flex-wrap: wrap; }
.t-attr { position: relative; background: var(--bg, #fff); border: 1px solid var(--border, #ccc); border-radius: 9px; padding: 8px 10px; font-size: 18px; line-height: 1; cursor: pointer; color: inherit; transition: transform .08s, background .12s, border-color .12s; }
.t-attr:hover { border-color: var(--brown); }
.t-attr:active { transform: scale(.92); }
.t-attr.on { background: var(--brown); border-color: var(--brown); }
.t-attr-n { font-size: 10px; margin-left: 2px; opacity: .8; vertical-align: top; }

/* ===== Кластер «одно место — N посещений» ===== */
.pc-count {
  position: absolute; top: -6px; right: -8px;
  background: var(--accent, #f59e0b); color: #111;
  border-radius: 10px; font-size: 11px; font-weight: 800;
  padding: 1px 5px; line-height: 1.4;
  pointer-events: none;
}

/* ═══════ Build 95 · единый «причёсыватель» интерфейса (refresh) ═══════ */
/* По ресерчу: структуру не трогаем, делаем визуал когерентным и «законченным». */
:root { --r-sm: 11px; --r-md: 14px; --r-lg: 20px; --tap: 46px; }

/* мягкие нажатия на всё кликабельное */
button, .chip, .nav-btn, .icon-btn, .pet-card, .food-card, .hat-chip, .bristol-card, .place-chip, .seg, [role="button"] {
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease, border-color .15s ease;
}
button:active, .chip:active, .icon-btn:active, .seg:active, [role="button"]:active { transform: scale(.96); }

/* первичные кнопки — глубина, единый радиус, нормальная тап-зона */
button.primary, #modal-save, .save, #modal-cancel {
  min-height: var(--tap); border-radius: var(--r-md); font-weight: 800;
}
button.primary, #modal-save, .save { box-shadow: 0 5px 14px rgba(13,148,136,.28); }

/* поля ввода — единый радиус + аккуратное фокус-кольцо */
input[type="text"], input[type="password"], input[type="email"], input[type="datetime-local"], input[type="search"], textarea, select {
  border-radius: var(--r-md); border: 2px solid var(--border);
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--brown); box-shadow: 0 0 0 3px rgba(13,148,136,.13);
}

/* чипы — единая «пилюля» */
.chip, .process-chips .chip, .food-chip { border-radius: 999px; }

/* карточки/секции — единая мягкая тень и радиус */
.form-section, .b-card, .stat-card, .place-card, .feed-item { box-shadow: var(--shadow-sm); border-radius: var(--r-lg); }

/* тап-зоны иконок ≥44px (доступность) */
.icon-btn { min-width: 44px; min-height: 44px; }

/* модалки/листы — единый крупный радиус и тень */
.modal-content { border-radius: 24px; box-shadow: var(--shadow-lg); }

/* 🤔 Умный разбор — мини-опрос (build 96) */
.qsurvey { background: linear-gradient(135deg, rgba(13,148,136,.09), rgba(245,158,11,.07)); }
.qitem { margin-top: 11px; }
.qitem .qtext { font-weight: 800; font-size: 14px; color: var(--text); margin-bottom: 7px; line-height: 1.3; }
.qchips { display: flex; flex-wrap: wrap; gap: 7px; }
.qa-chip { background: var(--card); border: 2px solid var(--border); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 800; color: var(--text); cursor: pointer; transition: transform .08s, border-color .15s; }
.qa-chip:active { transform: scale(.94); }
.qa-chip:hover { border-color: var(--brown); }
.qrow { display: flex; gap: 8px; }
.qa-text { flex: 1; border-radius: var(--r-md, 14px); border: 2px solid var(--border); padding: 10px 12px; font-size: 14px; }
.qa-send { background: var(--brown); color: #fff; border: none; border-radius: 12px; padding: 0 18px; font-size: 17px; font-weight: 800; cursor: pointer; }
