/* «Лавки» — дизайн-язык «Тёплая тёмная ночь» (Claude Design, июль 2026).
   Палитра: Ночь/Двор/Фанера/Пена/Янтарь/Фонарь; пины по рейтингу: Ржавый/Янтарь/Хмель.
   Шрифты: Golos Text (интерфейс), Yeseva One (вывески). */

:root {
  --bg: #120d08;        /* Ночь — фон */
  --panel: #1d1610;     /* Двор — поверхности (шиты, панели) */
  --card: #2a2014;      /* Фанера — карточки */
  --line: #2e2418;      /* бордер панелей */
  --line-2: #3a2d1c;    /* бордер карточек и полей */
  --text: #f5ead6;      /* Пена — текст */
  --text-2: #d8c9ab;    /* основной приглушённый */
  --muted: #b9a888;     /* вторичный */
  --dim: #8a7a5f;       /* подписи */
  --accent: #f0a63e;    /* Янтарь */
  --glow: #ffd47e;      /* Фонарь */
  --on-accent: #241708; /* текст на янтаре */
  --rust: #c65f3f;      /* рейтинг < 2.5 */
  --hop: #9dbb5a;       /* рейтинг 4+ */
  --err-bg: #2a1712;
  --err-text: #e8a08a;
  --shadow: 0 12px 50px rgba(0, 0, 0, 0.6);
  --btn-glow: 0 4px 24px rgba(240, 166, 62, 0.35);
  --sans: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Yeseva One', Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: 0; }

@keyframes glowPulse { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Map & chrome ---------- */
#map { position: fixed; inset: 0; background: var(--bg); z-index: 0; }

/* тёплая ночь поверх OSM-тайлов */
.leaflet-tile-pane { filter: brightness(0.62) saturate(0.55) sepia(0.22) contrast(1.05); }
.leaflet-container { background: var(--bg); font: inherit; }
.leaflet-control-attribution {
  background: rgba(18, 13, 8, 0.72) !important;
  color: var(--dim) !important;
  backdrop-filter: blur(4px);
}
.leaflet-control-attribution a { color: var(--accent) !important; }
.leaflet-bar a {
  background: var(--panel) !important;
  color: var(--text) !important;
  border-color: var(--line-2) !important;
}

/* Топбар-капсула: аватар + имя + выход */
.topbar {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 12px);
  left: 16px; right: 16px;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(29, 22, 16, 0.9);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  padding: 10px 12px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}
.topbar-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  background: var(--line-2);
  color: var(--glow);
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
}
.topbar-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-sub { font-size: 11px; color: var(--dim); }
.logout-btn {
  font-size: 13px; font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 7px 12px;
  text-decoration: none;
  flex: none;
}
.logout-btn:active { transform: scale(0.96); }

/* Чипы под топбаром: счётчик точек + своё место в рейтинге (дизайн 02) */
.chips-row {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 78px);
  left: 16px;
  right: 16px;
  z-index: 490;
  display: flex;
  gap: 8px;
  pointer-events: none;
}
.chips-row > * { pointer-events: auto; }
.count-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(29, 22, 16, 0.9);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 7px 14px;
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}
.count-chip .cc-icon { font-size: 13px; }
.count-chip .cc-num { font-size: 13px; font-weight: 700; color: var(--text); }
.count-chip .cc-tail { font-size: 12px; color: var(--dim); }
.rank-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(29, 22, 16, 0.9);
  border: 1px solid rgba(240, 166, 62, 0.4);
  border-radius: 999px;
  padding: 7px 14px;
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  color: var(--text);
  font: inherit;
}
.rank-chip:active { transform: scale(0.96); }
.rank-chip .rc-icon { font-size: 13px; }
.rank-chip .rc-num { font-size: 13px; font-weight: 800; color: var(--accent); }
.rank-chip .rc-tail { font-size: 12px; color: var(--dim); }

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .06s ease, filter .12s ease;
}
.btn:active { transform: scale(0.98); }
.btn-lg { padding: 15px 18px; font-size: 16px; border-radius: 14px; width: 100%; }
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  font-weight: 800;
  box-shadow: var(--btn-glow);
}
.btn-ghost { background: transparent; color: var(--muted); font-weight: 700; }
.btn.is-disabled { opacity: .45; pointer-events: none; box-shadow: none; }
/* Лоадер на кнопке: спиннер слева от текста, кнопка задизейблена на время запроса */
.btn.is-loading { pointer-events: none; opacity: .85; }
.btn.is-loading::before {
  content: '';
  display: inline-block;
  width: 15px; height: 15px;
  margin-right: 9px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btnSpin .7s linear infinite;
}
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* ---------- FAB ---------- */
.fab {
  position: fixed;
  right: 20px;
  bottom: calc(env(safe-area-inset-bottom) + 28px);
  z-index: 450;
  width: 60px; height: 60px;
  border-radius: 50%;
  border: none;
  font-size: 30px; font-weight: 700; line-height: 1;
  color: var(--on-accent);
  background: var(--accent);
  box-shadow: 0 6px 28px rgba(240, 166, 62, 0.45), 0 4px 12px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}
.fab.active { transform: rotate(45deg); }
.add-hint {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 102px);
  z-index: 450;
  background: var(--panel);
  border: 1px solid var(--line-2);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 14px;
  white-space: nowrap;
  box-shadow: var(--shadow);
}

/* ---------- Map pin: кружка в кольце цвета рейтинга ---------- */
.pin-wrap { background: transparent !important; border: none !important; }
.pin { position: relative; width: 46px; }
.pin-c {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--panel);
  border: 3px solid var(--line-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}
.pin-tail {
  width: 12px; height: 12px;
  background: var(--line-2);
  transform: rotate(45deg);
  margin: -7px auto 0;
  border-radius: 2px;
}
.pin-count {
  position: absolute;
  top: -6px; right: -8px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px; font-weight: 800;
  border-radius: 10px;
  padding: 1px 6px;
  border: 2px solid var(--bg);
}
.pin.rust .pin-c { border-color: var(--rust); box-shadow: 0 0 14px rgba(198, 95, 63, 0.4), 0 4px 10px rgba(0, 0, 0, 0.5); }
.pin.rust .pin-tail { background: var(--rust); }
.pin.amber .pin-c { border-color: var(--accent); box-shadow: 0 0 14px rgba(240, 166, 62, 0.4), 0 4px 10px rgba(0, 0, 0, 0.5); }
.pin.amber .pin-tail { background: var(--accent); }
.pin.hop .pin-c { border-color: var(--hop); box-shadow: 0 0 14px rgba(157, 187, 90, 0.4), 0 4px 10px rgba(0, 0, 0, 0.5); }
.pin.hop .pin-tail { background: var(--hop); }

/* ---------- Bottom sheet места ---------- */
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 600;
  max-height: 78dvh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--line-2);
  box-shadow: 0 -12px 50px rgba(0, 0, 0, 0.6);
  padding: 10px 20px calc(env(safe-area-inset-bottom) + 24px);
  gap: 14px;
  animation: slideUp .26s cubic-bezier(.2, .8, .2, 1);
  /* контента стало больше (правки, «моё пиво») — скроллится весь шит целиком */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 0 auto; flex: none; }
.sheet-head { flex: none; min-width: 0; }
/* Длинные слитные названия/имена переносим, а не распираем шит по горизонтали */
.sheet-head h2 { margin: 0; font-size: 24px; line-height: 1.25; text-wrap: balance; overflow-wrap: anywhere; }
.place-desc { color: var(--muted); font-size: 14px; line-height: 1.45; margin: 4px 0 0; overflow-wrap: anywhere; }

.stats { display: flex; gap: 8px; flex: none; }
.stat {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}
.stat.wide { flex: 1.2; }
.stat-v { font-size: 17px; font-weight: 800; color: var(--text); }
.stat-v.amber { color: var(--accent); }
.stat-l { font-size: 10px; color: var(--dim); margin-top: 2px; text-transform: uppercase; letter-spacing: .06em; }

.sheet .btn-checkin { flex: none; font-size: 17px; padding: 16px; }

.list-label {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--dim); font-weight: 700;
  margin-top: 2px;
  flex: none;
}
.checkins {
  display: flex; flex-direction: column; gap: 14px;
  overflow: visible; /* скроллит родительский .sheet */
  padding-bottom: 4px;
}
.checkin { display: flex; align-items: center; gap: 12px; }
.checkin .avatar { width: 40px; height: 40px; font-size: 16px; }
.checkin .meta { flex: 1; min-width: 0; }
.checkin .name { font-size: 14px; font-weight: 600; }
.checkin .when { color: var(--dim); font-weight: 400; font-size: 12px; }
.checkin .stars-sm { font-size: 13px; color: var(--accent); letter-spacing: 1px; }
.checkin .thumb {
  width: 44px; height: 44px; flex: none;
  border-radius: 10px; object-fit: cover;
  border: 1px solid var(--line-2);
  cursor: zoom-in;
  background: var(--card);
}
.empty { color: var(--dim); text-align: center; padding: 22px 8px; font-size: 14px; }

/* Блок «крайние» — последняя посиделка (стопка аватарок + имена) */
.last-crew {
  flex: none;
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border: 1px solid rgba(240, 166, 62, 0.35);
  border-radius: 14px;
  padding: 11px 14px;
}
.crew-avatars { display: flex; flex: none; }
.crew-av {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--line-2);
  color: var(--glow);
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
  border: 2px solid var(--card);
}
.crew-av + .crew-av { margin-left: -9px; }
.crew-names { font-size: 13px; font-weight: 700; }
.crew-sub { font-size: 11px; color: var(--dim); margin-top: 1px; }

/* Меню «⋯» у своей строки чекина */
.row-menu {
  width: 32px; height: 32px; flex: none;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: none;
  color: var(--dim);
  font-size: 16px; font-weight: 700; letter-spacing: 1px;
  cursor: pointer;
  display: grid; place-items: center;
}
.row-menu:active { transform: scale(0.92); }
.me-tag { color: var(--accent); font-weight: 600; font-size: 11px; }

/* «Показать ещё» — догрузка ленты */
.load-more {
  width: 100%;
  border: 1px solid var(--line-2);
  background: none;
  color: var(--muted);
  font: inherit; font-weight: 700; font-size: 14px;
  padding: 13px; border-radius: 14px;
  text-align: center; cursor: pointer;
  margin-top: 2px;
}
.load-more span { color: var(--dim); font-weight: 500; font-size: 12px; }
.load-more:disabled { opacity: .6; }

/* Действия места: Передвинуть / Место снесли */
.place-actions { display: flex; gap: 8px; flex: none; }
.place-act {
  flex: 1;
  border: 1px solid var(--line-2);
  background: none;
  color: var(--muted);
  font: inherit; font-weight: 600; font-size: 13px;
  padding: 10px; border-radius: 12px;
  text-align: center; cursor: pointer;
}
.place-act:active { transform: scale(0.98); }

/* Снесённое место — плашка, приглушение, память, возврат */
.defunct-chip {
  align-self: flex-start; flex: none;
  display: inline-flex; align-items: center; gap: 8px;
  background: #2a1c14;
  border: 1px solid rgba(198, 95, 63, 0.5);
  border-radius: 999px;
  padding: 6px 14px;
}
.defunct-chip span:last-child {
  font-size: 12px; font-weight: 800; color: var(--err-text);
  letter-spacing: .06em; text-transform: uppercase;
}
.sheet.is-defunct .sheet-head, .sheet.is-defunct .stats { opacity: .65; }
.sheet.is-defunct .sheet-head h2 { color: #b9ae9c; }
.defunct-note {
  flex: none;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px; color: var(--muted); line-height: 1.45;
}
.revive-btn {
  flex: none;
  border: 1px solid rgba(240, 166, 62, 0.5);
  background: none;
  color: var(--accent);
  font: inherit; font-weight: 700; font-size: 15px;
  padding: 14px; border-radius: 14px;
  text-align: center; cursor: pointer;
}
.revive-btn:active { transform: scale(0.98); }

/* Снесённый пин: серый, пунктир, ✕ */
.pin.dead { opacity: .85; }
.pin.dead .pin-c { background: #1d1a16; border: 3px dashed #6b6258; color: #6b6258; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); }
.pin.dead .pin-tail { background: #6b6258; }
.pin.dead .pin-count { background: #3d3830; color: #a89e90; border-color: var(--bg); }

/* Режим перемещения точки: подсказка + панель подтверждения */
.move-hint {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 70px);
  left: 50%; transform: translateX(-50%);
  z-index: 620;
  background: rgba(42, 32, 20, 0.95);
  border: 1px solid rgba(240, 166, 62, 0.4);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 13px; font-weight: 700;
  white-space: nowrap;
  box-shadow: var(--shadow);
}
.move-panel {
  position: fixed;
  left: 16px; right: 16px;
  bottom: calc(env(safe-area-inset-bottom) + 16px);
  z-index: 620;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--shadow);
}
.move-coords { font-size: 11px; color: var(--dim); text-align: center; font-family: ui-monospace, monospace; }

/* Подтверждение удаления: цветные пункты в as-group */
.delete-group .as-item { font-size: 15px; }
.as-item.warn { color: var(--err-text); }   /* удалить фото */
.as-item.danger { color: var(--rust); }      /* удалить целиком */
.as-item.muted { color: var(--muted); }      /* отмена */

/* ---------- Scrim + модалки ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 700;
  background: rgba(10, 7, 4, 0.7);
  animation: fade .18s ease;
}

/* Action sheet «Как отмечаемся?» — группа + отдельная «Отмена» */
.modal {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(env(safe-area-inset-bottom) + 16px);
  z-index: 710;
  animation: slideUp .22s cubic-bezier(.2, .8, .2, 1);
}
.as-group {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  overflow: hidden;
}
.as-title {
  padding: 16px; text-align: center;
  font-size: 13px; color: var(--dim); font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.as-item {
  appearance: none; border: none; background: none; width: 100%;
  padding: 18px; text-align: center;
  font: inherit; font-size: 17px; font-weight: 700; color: var(--text);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.as-item:last-child { border-bottom: none; }
.as-item:active { background: var(--card); }
.as-cancel {
  margin-top: 10px;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  padding: 18px;
  font: inherit; font-size: 17px; font-weight: 700; color: var(--muted);
  cursor: pointer;
}

/* Шит оценки «Ну и как тут?» */
.rate-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 710;
  background: var(--panel);
  border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--line-2);
  box-shadow: 0 -12px 50px rgba(0, 0, 0, 0.6);
  padding: 10px 20px calc(env(safe-area-inset-bottom) + 28px);
  display: flex; flex-direction: column; gap: 22px;
  animation: slideUp .22s cubic-bezier(.2, .8, .2, 1);
}
.rate-head { text-align: center; }
.rate-head h3 { margin: 0; font-size: 24px; }
.rate-sub { font-size: 13px; color: var(--dim); margin-top: 6px; }
.stars { display: flex; justify-content: center; gap: 10px; }
.stars button {
  appearance: none; border: none; background: none; padding: 0;
  font-size: 46px; line-height: 1; cursor: pointer;
  color: var(--line-2);
  transition: transform .08s ease;
}
.stars button.on { color: var(--accent); text-shadow: 0 0 18px rgba(240, 166, 62, 0.5); }
.stars button:active { transform: scale(1.15); }
.rate-verdict { text-align: center; font-size: 13px; color: var(--muted); margin-top: -8px; min-height: 20px; }

/* Полноэкранное подтверждение фото */
.photo-confirm {
  position: fixed; inset: 0; z-index: 720;
  background: var(--bg);
  display: flex; flex-direction: column;
  animation: fade .18s ease;
}
.photo-confirm .preview {
  flex: 1;
  margin: calc(env(safe-area-inset-top) + 16px) 20px 0;
  border-radius: 18px;
  border: 1px solid var(--line-2);
  background: var(--card);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  min-height: 0;
}
.photo-confirm .preview img { width: 100%; height: 100%; object-fit: contain; }
.photo-confirm .ask {
  padding: 24px 20px calc(env(safe-area-inset-bottom) + 32px);
  display: flex; flex-direction: column; gap: 12px;
}
.photo-confirm .ask h3 { margin: 0; text-align: center; font-size: 22px; }

/* Модалка «Новое алкашское место» */
.place-modal {
  position: fixed;
  left: 20px; right: 20px; top: 50%;
  transform: translateY(-50%);
  z-index: 710;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 22px;
  padding: 24px 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  display: flex; flex-direction: column; gap: 14px;
  animation: fade .18s ease;
}
.place-modal h3 { margin: 0; font-size: 22px; line-height: 1.25; }
.fieldbox {
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 11px 14px 12px;
}
.fieldbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(240, 166, 62, 0.12); }
.fieldbox label {
  display: block;
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--dim); font-weight: 700;
}
.fieldbox:focus-within label { color: var(--accent); }
.fieldbox input {
  display: block; width: 100%;
  background: none; border: none; outline: none; padding: 0;
  margin-top: 3px;
  font: inherit; font-size: 15px; color: var(--text);
}
.coords { font-size: 12px; color: var(--dim); font-family: ui-monospace, monospace; }
.place-modal .row { display: flex; gap: 10px; margin-top: 4px; }
.place-modal .row .btn-ghost { flex: 1; }
.place-modal .row .btn-primary { flex: 1.4; }

/* Полноэкранный просмотр фото */
.viewer {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0, 0, 0, 0.94);
  display: flex; flex-direction: column;
  animation: fade .18s ease;
}
.viewer .stage { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; }
.viewer img { max-width: 100%; max-height: 100%; }
.viewer .close {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 16px); right: 16px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(29, 22, 16, 0.85);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 16px;
  display: grid; place-items: center;
  cursor: pointer;
}
.viewer .caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 20px 20px calc(env(safe-area-inset-bottom) + 30px);
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8));
  display: flex; align-items: center; gap: 12px;
}
.viewer .caption .name { font-size: 14px; font-weight: 600; }
.viewer .caption .when { color: var(--dim); font-weight: 400; font-size: 12px; }
.viewer .caption .stars-sm { font-size: 13px; color: var(--accent); letter-spacing: 1px; }

/* ---------- Тосты ---------- */
.toast {
  position: fixed;
  left: 20px; right: 20px;
  top: calc(env(safe-area-inset-top) + 76px);
  z-index: 800;
  background: var(--card);
  border: 1px solid rgba(240, 166, 62, 0.4);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.55);
  animation: fade .18s ease;
}
.toast .t-icon { font-size: 20px; flex: none; }
.toast .t-title { font-size: 15px; font-weight: 700; }
.toast .t-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.toast.bad { background: var(--err-bg); border-color: rgba(198, 95, 63, 0.5); }
.toast.bad .t-title { color: var(--err-text); }

/* ---------- Welcome ---------- */
body.welcome {
  display: grid; place-items: center;
  min-height: 100dvh;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.welcome-card {
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  margin-top: -12dvh;
}
.welcome-mark {
  position: relative;
  font-size: 88px; line-height: 1;
  filter: drop-shadow(0 0 24px rgba(240, 166, 62, 0.45));
}
/* Свечение ровно за бокалом (концентрично эмодзи), а не по вьюпорту */
.welcome-mark::before {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 340px; height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 166, 62, 0.14) 0%, rgba(240, 166, 62, 0) 70%);
  animation: glowPulse 4s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}
.welcome-card h1 {
  margin: 0;
  font-size: 52px;
  text-shadow: 0 0 30px rgba(240, 166, 62, 0.25);
}

/* ---------- Создатель места и предложения правок (дизайн 03/03e) ---------- */
.place-by { font-size: 12px; color: var(--dim); margin-top: 5px; }
.place-by b { color: var(--muted); font-weight: 600; }
.place-by b.me { color: var(--accent); }

.place-edits:empty { display: none; }
.place-edits { display: flex; flex-direction: column; gap: 10px; }
.edit-card {
  background: var(--card);
  border: 1px solid rgba(240, 166, 62, 0.4);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 9px;
}
.edit-card .ec-head { display: flex; align-items: center; gap: 10px; }
.edit-card .ec-av {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--line-2); color: var(--glow);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex: none;
}
.edit-card .ec-who { flex: 1; font-size: 13px; font-weight: 700; }
.edit-card .ec-who .when { color: var(--dim); font-weight: 400; font-size: 12px; }
.edit-card .ec-diff { font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.edit-card .ec-diff .lbl { color: var(--dim); }
.edit-card .ec-diff .old { color: var(--dim); text-decoration: line-through; }
.edit-card .ec-diff .new { color: var(--text); font-weight: 600; }
.edit-card .ec-deadline { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); }
.edit-card .ec-deadline b { color: var(--muted); font-weight: 700; }
.edit-card .ec-actions { display: flex; gap: 8px; }
.edit-card .ec-actions .btn { flex: 1; padding: 12px; font-size: 14px; }

/* ---------- «Моё пиво» (дизайн 03) ---------- */
.my-beer {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex; align-items: center; gap: 14px;
}
.beer-glass {
  appearance: none;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--panel);
  border: 3px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; flex: none;
  box-shadow: 0 0 18px rgba(240, 166, 62, 0.45);
  transition: transform 0.12s ease;
}
.beer-glass:active { transform: scale(0.9); }
.beer-glass.pop { animation: beerPop 0.45s ease; }
@keyframes beerPop { 0% { transform: scale(1); } 35% { transform: scale(1.22); } 70% { transform: scale(0.94); } 100% { transform: scale(1); } }
.beer-glass.cooldown {
  border: 3px dashed #6b6258;
  filter: grayscale(1);
  opacity: 0.7;
  box-shadow: none;
}
.my-beer .mb-meta { flex: 1; }
.my-beer .mb-title { font-size: 15px; font-weight: 800; }
.my-beer .mb-sub { font-size: 11px; color: var(--dim); margin-top: 2px; }

/* ⓘ и тултип (компонент дизайн-системы) */
.tip-btn {
  appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex: none;
  padding: 0;
}
.tip-bubble {
  position: fixed;
  z-index: 1400;
  max-width: 290px;
  background: var(--card);
  border: 1px solid rgba(240, 166, 62, 0.4);
  border-radius: 12px;
  padding: 10px 13px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: fade 0.15s ease;
}
.tip-bubble p { margin: 0; }
.tip-bubble p + p { margin-top: 6px; }

/* Счётчик пива в строке чекина и в «крайних» */
.beer-cnt { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0; }

/* ---------- Гео-чип «Я тут» (компонент) ---------- */
.geo-chip {
  appearance: none;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid rgba(240, 166, 62, 0.5);
  background: transparent;
  color: var(--accent);
  font-weight: 700; font-size: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
  flex: none;
  font-family: inherit;
}
.geo-chip:active { transform: scale(0.96); }
.geo-chip.busy { border-color: var(--line-2); color: var(--dim); }
.geo-chip .geo-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: glowPulse 1.2s ease-in-out infinite;
}
.coords-row { display: flex; align-items: center; gap: 10px; }
.coords-row .coords { flex: 1; margin: 0; }

/* ---------- Экран рейтинга (дизайн 08) ---------- */
.rating-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 900;
  display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 14px) 0 env(safe-area-inset-bottom);
  animation: fade 0.18s ease;
}
.rating-head { display: flex; align-items: center; gap: 12px; padding: 0 16px; }
.rating-head h2 { margin: 0; font-family: 'Yeseva One', serif; font-size: 26px; font-weight: 400; }
.rating-head .tip-btn { margin-left: auto; }
.rating-back {
  appearance: none;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  flex: none;
  padding: 0 0 2px;
}
.period-tabs { display: flex; gap: 6px; padding: 14px 16px 0; }
.period-tab {
  appearance: none;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--muted);
  font-size: 12px; font-weight: 600; font-family: inherit;
  padding: 7px 11px;
  border-radius: 999px;
}
.period-tab.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
  box-shadow: 0 2px 14px rgba(240, 166, 62, 0.35);
}
.rating-cols {
  display: flex; justify-content: flex-end; gap: 18px;
  padding: 14px 20px 6px;
  font-size: 10px; color: var(--dim);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
}
.rating-cols span:first-child { width: 52px; text-align: right; }
.rating-cols span:last-child { width: 56px; text-align: right; }
.rating-list { display: flex; flex-direction: column; gap: 8px; padding: 0 12px; overflow-y: auto; }
.rating-row { border-radius: 16px; padding: 11px 12px; display: flex; align-items: center; gap: 11px; }
.rating-row .rr-rank { font-size: 14px; font-weight: 700; color: var(--dim); flex: none; width: 28px; text-align: center; }
.rating-row .rr-av {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--line-2); color: var(--glow);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; flex: none;
}
.rating-row .rr-name { flex: 1; font-size: 15px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rating-row .rr-name .me-tag { color: var(--accent); font-weight: 600; font-size: 11px; }
.rating-row .rr-beers { width: 52px; text-align: right; font-size: 15px; font-weight: 700; color: var(--text-2); }
.rating-row .rr-cks { width: 56px; text-align: right; font-size: 13px; font-weight: 700; color: var(--muted); }
.rating-row.top { background: #241b11; border: 1px solid rgba(240, 166, 62, 0.3); }
.rating-row.top .rr-beers { color: var(--accent); font-weight: 800; }
.rating-row.top .rr-rank { color: var(--text-2); font-weight: 800; font-size: 15px; }
.rating-row.first {
  background: var(--card);
  border: 1px solid rgba(240, 166, 62, 0.55);
  box-shadow: 0 0 22px rgba(240, 166, 62, 0.18);
  padding: 13px 12px;
}
.rating-row.first .rr-rank { font-size: 20px; }
.rating-row.first .rr-av { width: 42px; height: 42px; border: 2px solid var(--accent); font-size: 17px; font-weight: 800; }
.rating-row.first .rr-name { font-size: 16px; font-weight: 800; }
.rating-row.first .rr-beers { font-size: 16px; }
.rating-row.me-row { background: rgba(240, 166, 62, 0.08); border: 1px solid var(--line-2); }
.rating-row.me-row .rr-beers { color: var(--accent); font-weight: 800; }
.rating-empty { text-align: center; color: var(--dim); font-size: 14px; padding: 40px 20px; line-height: 1.6; }

/* ---------- Поздравлялка (дизайн 09) ---------- */
.congrats {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 1300;
  overflow: hidden;
  animation: fade 0.25s ease;
}
.congrats::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(90% 60% at 50% 38%, rgba(240, 166, 62, 0.22), rgba(18, 13, 8, 0) 70%);
}
.congrats .bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(245, 234, 214, 0.7);
  animation: floatUp 3.6s ease-out infinite;
}
@keyframes floatUp {
  0% { transform: translateY(0); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(-64vh); opacity: 0; }
}
.congrats .cg-close {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 52px); right: 16px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(29, 22, 16, 0.85);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
}
.congrats .cg-body {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px;
  padding: 0 32px;
  text-align: center;
}
.congrats .cg-mark { font-size: 76px; line-height: 1; filter: drop-shadow(0 0 26px rgba(240, 166, 62, 0.55)); animation: beerPop 0.7s ease; }
.congrats h2 {
  margin: 0;
  font-family: 'Yeseva One', serif;
  font-size: 42px; font-weight: 400; line-height: 1.15;
  text-shadow: 0 0 30px rgba(240, 166, 62, 0.3);
}
.congrats .cg-sub { font-size: 15px; color: var(--muted); line-height: 1.5; }
.congrats .cg-go { margin-top: 10px; padding: 15px 44px; }

/* ---------- Прицел по центру (создание/перемещение точки, дизайн 05a/03c) ---------- */
.reticle {
  position: fixed;
  left: 50%; top: 50%;
  width: 56px; height: 56px;
  transform: translate(-50%, -50%);
  z-index: 610;
  pointer-events: none; /* карта двигается ПОД прицелом */
}
.reticle-h { position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; background: rgba(245, 234, 214, 0.85); box-shadow: 0 0 5px rgba(0, 0, 0, 0.9); }
.reticle-v { position: absolute; top: 0; bottom: 0; left: 50%; width: 1.5px; background: rgba(245, 234, 214, 0.85); box-shadow: 0 0 5px rgba(0, 0, 0, 0.9); }

/* «Ты здесь» — красная точка на карте по точному GPS (если юзер дал доступ) */
.gps-dot-wrap { background: transparent !important; border: none !important; }
.gps-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: #e05340;
  border: 2px solid #fff;
  box-shadow: 0 0 10px rgba(224, 83, 64, 0.9);
}

/* ---------- Строка фильтров мест (дизайн 02) ---------- */
.filters-row {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 120px);
  left: 0; right: 0;
  z-index: 490;
  display: flex;
  gap: 6px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.filters-row::-webkit-scrollbar { display: none; }
.filter-chip {
  appearance: none;
  flex: none;
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(29, 22, 16, 0.9);
  border: 1px solid var(--line-2);
  color: var(--muted);
  font: inherit; font-size: 12px; font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}
.filter-chip.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
}
/* тумблер «С погостами» */
.filter-chip .fc-switch {
  display: inline-block; width: 26px; height: 15px; border-radius: 8px;
  background: var(--line-2); position: relative; flex: none;
}
.filter-chip .fc-switch::after {
  content: ''; position: absolute; left: 2px; top: 2px;
  width: 11px; height: 11px; border-radius: 50%; background: var(--dim);
  transition: left 0.15s ease, background 0.15s ease;
}
.filter-chip.on .fc-switch { background: var(--accent); }
.filter-chip.on .fc-switch::after { left: 13px; background: var(--on-accent); }

/* ---------- Пин «сейчас наливают»: пульс-кольцо + свечение (дизайн 02) ---------- */
.pin.live .pin-c { box-shadow: 0 0 22px rgba(255, 212, 126, 0.6), 0 4px 10px rgba(0, 0, 0, 0.5); }
/* Кольцо точно поверх .pin-c (обе 44×44, border-box, left:0/top:0) и масштаб из
   собственного центра — расходится строго концентрично, без сдвига. */
.pin-ring {
  position: absolute; left: 2px; top: 2px; /* сдвиг на пару px вправо-вниз: на iOS кольцо иначе съезжает влево-вверх */
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--glow);
  transform-origin: center;
  animation: ringPulse 1.8s ease-out infinite;
  pointer-events: none;
}
@keyframes ringPulse {
  0% { transform: scale(0.65); opacity: 0.9; }
  100% { transform: scale(1.9); opacity: 0; }
}

/* ---------- Создатель места на карточке: мини-аватар + строка (дизайн 03) ---------- */
.place-by { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dim); margin-top: 6px; }
.place-by .pb-av {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: var(--line-2); color: var(--glow);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.place-by b { color: var(--muted); font-weight: 600; }
.place-by b.me { color: var(--accent); }

/* Приписка «· в рейтинг не идёт» у чекина без фото (action sheet 04a) */
.as-item .as-note { font-size: 12px; font-weight: 600; color: var(--dim); }

/* Промпт-осуждение чекина без фото (дизайн 04d): центрированная карточка */
.np-confirm { justify-content: center; align-items: center; padding: 0 20px; background: rgba(10, 7, 4, 0.72); }
.np-confirm .ask {
  width: 100%; max-width: 340px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 22px;
  padding: 26px 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  text-align: center;
  gap: 10px;
}
.np-confirm .np-mark { font-size: 44px; line-height: 1; }
.np-confirm .np-sub { margin: 0 0 6px; font-size: 14px; color: var(--muted); line-height: 1.5; }

/* iOS-фикс центрирования: эмодзи/глифы в круглых контейнерах наследуют
   line-height 1.5 из body и садятся ниже центра. Приколачиваем line-height:1
   ко всем иконкам-кружкам; FAB дополнительно flex-центрируем (был обычной кнопкой). */
.fab, .pin-c, .avatar, .beer-glass, .tip-btn, .cg-close, .rating-back,
.crew-av, .rr-av, .ec-av, .pb-av, .pin-count, .me-avatar, .checkin .avatar {
  line-height: 1;
}
.fab { display: flex; align-items: center; justify-content: center; }

/* Осуждение: метка чекина без фотопруфа в ленте «Кто отмечался» */
.no-proof { color: var(--rust); font-size: 12px; font-weight: 700; letter-spacing: 0; }
