:root {
  --bg: #edeef2;
  --card: #ffffff;
  --ink: #0d1117;
  --muted: #5c6470;
  --line: #e4e7ec;
  --accent: #1677ff;
  --accent-ink: #ffffff;
  --accent-soft: #e8f1ff;
  --danger: #f0333f;
  --ok: #12a56a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(13, 17, 23, .05), 0 6px 18px -10px rgba(13, 17, 23, .25);
}

[data-theme="dark"] {
  --bg: #0f1216;
  --card: #171b21;
  --ink: #e9edf3;
  --muted: #98a2b3;
  --line: #262c35;
  --accent: #4d94ff;
  --accent-soft: #16263f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
::selection { background: var(--accent-soft); }
input::placeholder, textarea::placeholder { color: #7b8494; opacity: 1; }

/* ---------- АВТОРИЗАЦИЯ ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 420px at 15% -10%, #cfe2ff 0%, transparent 60%),
    radial-gradient(700px 380px at 95% 5%, #d9f0ff 0%, transparent 55%),
    var(--bg);
}
[data-theme="dark"] .auth { background: radial-gradient(700px 400px at 10% -10%, #16263f 0%, transparent 60%), var(--bg); }
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.auth-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; letter-spacing: .2px; }
.auth-sub { color: var(--muted); margin: 8px 0 20px; font-size: 13px; }
.auth-tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 12px; margin-bottom: 16px; }
.auth-tab { flex: 1; padding: 8px; border-radius: 9px; color: var(--muted); font-weight: 600; }
.auth-tab.is-active { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.auth-form label { display: block; margin-bottom: 12px; font-size: 12px; color: var(--muted); font-weight: 600; }
.auth-form input {
  display: block; width: 100%; margin-top: 6px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--bg); outline: none;
}
.auth-form input:focus { border-color: var(--accent); background: var(--card); }
.auth-error { color: var(--danger); font-size: 13px; min-height: 18px; margin: 10px 0 0; }
.auth-hint { color: var(--muted); font-size: 12px; margin: 14px 0 0; text-align: center; }

/* ---------- ШАПКА ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: 1120px; margin: 0 auto; padding: 0 16px; height: 56px;
  display: flex; align-items: center; gap: 14px;
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.logo-mark {
  width: 28px; height: 28px; border-radius: 9px;
  background: linear-gradient(145deg, #2b8bff, #0b57d0);
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px;
}
.searchbox { position: relative; flex: 1; max-width: 320px; }
.searchbox .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; fill: var(--muted); }
.searchbox input {
  width: 100%; padding: 9px 12px 9px 32px; border-radius: 10px;
  border: 1px solid transparent; background: var(--bg); outline: none;
}
.searchbox input:focus { border-color: var(--accent); background: var(--card); }
.topnav { display: flex; gap: 4px; margin-left: auto; }
.tn { padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; position: relative; }
.tn:hover { background: var(--bg); color: var(--ink); }
.tn.is-active { background: var(--accent-soft); color: var(--accent); }
.badge {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
}
.top-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 16px; }
.icon-btn:hover { background: var(--bg); }
.me-chip { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 20px; font-weight: 600; }
.me-chip:hover { background: var(--bg); }

/* ---------- СЕТКА ---------- */
.shell {
  max-width: 1120px; margin: 0 auto; padding: 16px;
  display: grid; grid-template-columns: 200px minmax(0, 1fr) 280px; gap: 16px; align-items: start;
}
.col-left { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 12px; }
.col-right { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 12px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px;
}
@media (max-width: 1080px) {
  .shell { grid-template-columns: 200px minmax(0, 1fr); }
  .col-right { display: none; }
}

/* ---------- ТЕЛЕФОН: одно поле, нижнее меню ---------- */
@media (max-width: 780px) {
  .shell {
    grid-template-columns: 1fr; padding: 10px 10px calc(76px + env(safe-area-inset-bottom));
    gap: 10px;
  }
  .col-left, .col-right { display: none; }
  .topnav { display: none; }
  .searchbox { display: none; }
  .logo-text { display: none; }
  .topbar-in { gap: 6px; padding: 0 10px; }
  .me-chip { padding: 3px; }
  .me-chip #me-name { display: none; }
  .card { border-radius: 12px; padding: 12px; }
  .notif-panel { left: 10px; right: 10px !important; width: auto; max-height: 76vh; }
  .modal-box { width: calc(100% - 20px); max-height: 88vh; overflow-y: auto; }
  .chat-body { max-height: calc(100vh - 320px); }
  .chat-back {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--bg);
    color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; margin-right: 2px;
  }
  .bubble { max-width: 88%; }
  .bubble-wrap { max-width: 92%; }
  .post-actions { flex-wrap: wrap; }
  .profile-card .avatar-xl { width: 64px; height: 64px; }
  .tabbar { display: flex; }
}

/* нижнее меню */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  height: calc(58px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
.tabbar a, .tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; background: none; border: 0; color: var(--muted); font-size: 10.5px;
  text-decoration: none; position: relative; cursor: pointer;
}
.tabbar .is-active { color: var(--accent); }
.tabbar .is-active .tab-ico { transform: translateY(-1px); }
.tab-ico { font-size: 19px; line-height: 1; transition: transform .12s ease; }
.tabbar .badge { position: absolute; top: 6px; right: calc(50% - 22px); }

@media (min-width: 781px) {
  .tabbar { display: none; }
}

/* шторка «Ещё» */
.sheet { display: flex; flex-direction: column; gap: 2px; margin: 10px 0 14px; }
.sheet-link {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 12px 12px; border-radius: 11px; border: 0; background: none; color: var(--ink);
  font-size: 14px; font-weight: 600; text-align: left; text-decoration: none; cursor: pointer;
}
.sheet-link:hover { background: var(--bg); }
.sheet-link.is-danger { color: var(--danger); }
.sheet-link:not(:last-child) { border-bottom: 1px solid var(--line); border-radius: 0; }

/* ---------- ПРОФИЛЬ И МЕНЮ ---------- */
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 13px; flex: none; user-select: none;
  background-size: cover;
}
.avatar-xl { width: 78px; height: 78px; font-size: 26px; margin: 0 auto 10px; display: grid; }
.profile-card { text-align: center; }
.profile-name { font-weight: 700; font-size: 15px; }
.profile-status { color: var(--muted); font-size: 12px; margin: 2px 0 12px; }
.profile-status.is-online { color: var(--ok); }

.menu { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.menu-item { padding: 9px 10px; border-radius: 9px; color: var(--ink); font-weight: 600; font-size: 13.5px; }
.menu-item:hover { background: var(--bg); }
.menu-item.is-active { background: var(--accent-soft); color: var(--accent); }

.sos-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px; border-radius: 12px; font-weight: 700; letter-spacing: .8px; font-size: 13px;
  background: #fff; color: #d81f2a; border: 1.5px solid #f3c2c2;
  box-shadow: 0 1px 2px rgba(216, 31, 42, .08);
}
.sos-btn:hover { background: #fff5f5; border-color: #e88b8b; }
.sos-btn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #e33; }
.sos-btn:active { transform: translateY(1px); }

/* ---------- КНОПКИ ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 14px; border-radius: 10px; font-weight: 600; font-size: 13.5px;
  background: var(--bg); color: var(--ink); border: 1px solid transparent;
}
.btn:hover { filter: brightness(.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #0b63d8; filter: none; }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-danger { background: #fdecec; color: var(--danger); }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: default; }

/* ---------- ЛЕНТА ---------- */
.composer { display: flex; gap: 10px; }
.composer textarea {
  flex: 1; min-height: 52px; max-height: 220px; resize: none; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg); outline: none;
}
.composer textarea:focus { border-color: var(--accent); background: var(--card); }
.composer-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.composer-hint { color: var(--muted); font-size: 12px; }

.post { display: flex; flex-direction: column; gap: 10px; }
.post-head { display: flex; align-items: center; gap: 10px; }
.post-author { font-weight: 700; font-size: 14px; }
.post-time { color: var(--muted); font-size: 12px; }
.post-body { white-space: pre-wrap; font-size: 14.5px; line-height: 1.5; }
.post-media { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.post-media img { display: block; width: 100%; height: auto; }
.post-actions { display: flex; gap: 18px; padding-top: 8px; border-top: 1px solid var(--line); }
.act { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 13px; padding: 4px 2px; }
.act:hover { color: var(--accent); }
.act.is-liked { color: var(--danger); }
.act .heart { font-size: 15px; }

/* ---------- ГАРАЖ И КАРТОЧКИ ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.car-card { display: flex; flex-direction: column; gap: 6px; }
.plate {
  display: inline-block; padding: 6px 10px; border-radius: 8px; font-weight: 800; letter-spacing: .6px;
  background: #fff; color: #111; border: 2px solid #111; font-size: 15px; align-self: flex-start;
}
[data-theme="dark"] .plate { background: #f4f6f9; }
.car-meta { color: var(--muted); font-size: 12.5px; }

/* ---------- ПОИСК ---------- */
.search-result { display: flex; gap: 14px; align-items: center; }
.result-owner { font-weight: 700; }
.result-note { color: var(--muted); font-size: 12.5px; }
.paywall {
  border: 1px dashed var(--accent); background: var(--accent-soft);
  border-radius: 12px; padding: 16px; display: flex; gap: 14px; align-items: center;
}
.paywall-title { font-weight: 700; }

/* ---------- СООБЩЕНИЯ ---------- */
@media (min-width: 781px) {
  .chat-back { display: none; }
}
.messenger { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 0; padding: 0; overflow: hidden; min-height: 480px; }
.dialog-list { border-right: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.dialog-item { display: flex; gap: 10px; align-items: center; padding: 9px; border-radius: 10px; text-align: left; }
.dialog-item:hover { background: var(--bg); }
.dialog-item.is-active { background: var(--accent-soft); }
.dialog-name { font-weight: 600; font-size: 13.5px; }
.dialog-last { color: var(--muted); font-size: 12px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unread { margin-left: auto; background: var(--accent); color: #fff; border-radius: 9px; font-size: 11px; font-weight: 700; padding: 1px 6px; }
.chat { display: flex; flex-direction: column; }
.chat-head { padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.chat-body { flex: 1; padding: 14px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: 380px; }
.bubble { max-width: 78%; padding: 9px 12px; border-radius: 14px; background: var(--bg); font-size: 13.5px; }
.bubble.mine { align-self: flex-end; background: var(--accent); color: #fff; }
.bubble-time { display: block; font-size: 10.5px; opacity: .7; margin-top: 3px; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); outline: none; }
.chat-form input:focus { border-color: var(--accent); background: var(--card); }

/* ---------- СПИСКИ ЛЮДЕЙ ---------- */
.person { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.person + .person { border-top: 1px solid var(--line); }
.person-name { font-weight: 600; }
.person-sub { color: var(--muted); font-size: 12px; }
.person-actions { margin-left: auto; display: flex; gap: 6px; }

/* ---------- КАРТА ---------- */
/* Карта Leaflet держит собственные z-index до 1000, поэтому создаём ей
   отдельный контекст наложения: иначе она рисуется поверх окон и меню. */
#map-canvas { height: 460px; border-radius: 12px; overflow: hidden; position: relative; z-index: 0; isolation: isolate; }
.map-toolbar { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.map-toolbar select { padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); }

/* ---------- БАРАХОЛКА ---------- */
.listing { display: flex; flex-direction: column; gap: 6px; }
.listing-photo { height: 150px; border-radius: 10px; background: linear-gradient(140deg, #cfe0ff, #a9c6ff); display: grid; place-items: center; color: #2f5fa8; font-weight: 700; }
.listing-price { font-weight: 800; font-size: 16px; }
.listing-title { font-weight: 600; font-size: 13.5px; }
.listing-city { color: var(--muted); font-size: 12px; }

/* ---------- МОДАЛЬНОЕ ОКНО ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(9, 12, 18, .55); backdrop-filter: blur(2px); }
.modal-box {
  position: relative; width: 100%; max-width: 420px; background: var(--card);
  border-radius: 16px; padding: 20px; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .5);
}
.modal-title { font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.modal-sub { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.field { display: block; margin-bottom: 10px; font-size: 12px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); outline: none; font-size: 14px;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); background: var(--card); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

/* ---------- ПРОЧЕЕ ---------- */
.section-title { font-size: 15px; font-weight: 700; margin: 0 0 12px; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; font-size: 13.5px; }
.chip { display: inline-block; padding: 3px 8px; border-radius: 8px; background: var(--bg); color: var(--muted); font-size: 11.5px; font-weight: 600; }
.chip-accent { background: var(--accent-soft); color: var(--accent); }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast {
  background: #10151c; color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 13px;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .6); animation: slide .18s ease;
}
@keyframes slide { from { transform: translateY(8px); opacity: 0; } }
.skeleton { height: 54px; border-radius: 10px; background: linear-gradient(90deg, var(--bg), var(--line), var(--bg)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.colophon { color: var(--muted); font-size: 11.5px; line-height: 1.5; padding: 2px 6px; }
.feed-empty { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.feed-empty b { font-size: 14px; }

.avatar-sm { width: 26px; height: 26px; font-size: 11px; }
.comments { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.comment-list { display: flex; flex-direction: column; gap: 8px; }
.comment { display: flex; gap: 8px; align-items: flex-start; }
.comment-bubble { background: var(--bg); border-radius: 10px; padding: 7px 10px; font-size: 13px; flex: 1; }
.comment-author { font-weight: 700; font-size: 12.5px; margin-bottom: 2px; display: flex; gap: 8px; align-items: baseline; }
.comment-time { color: var(--muted); font-weight: 400; font-size: 11px; }
.comment-del { width: 26px; height: 26px; font-size: 12px; opacity: .5; }
.comment-del:hover { opacity: 1; background: transparent; }
.comment-form { display: flex; gap: 8px; }
.comment-form input {
  flex: 1; padding: 8px 11px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); outline: none; font-size: 13px;
}
.comment-form input:focus { border-color: var(--accent); background: var(--card); }

/* выбор звука уведомлений */
.sound-list { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; max-height: 340px; overflow-y: auto; }
.sound-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 11px;
  border: 1px solid var(--line); cursor: pointer; transition: border-color .15s, background .15s;
}
.sound-row:hover { background: var(--bg); }
.sound-row.is-active { border-color: var(--accent); background: var(--accent-soft); }
.sound-row input[type="radio"] { accent-color: var(--accent); }
.sound-text { display: flex; flex-direction: column; flex: 1; line-height: 1.35; }
.sound-text b { font-size: 13.5px; }
.sound-text i { font-style: normal; font-size: 11.5px; color: var(--muted); }
.sound-preview { min-width: 34px; }
.sound-controls { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.sound-switch { display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.sound-volume { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.sound-volume input[type="range"] { accent-color: var(--accent); width: 130px; }

/* реакции-смайлики */
.bubble-wrap { display: flex; flex-direction: column; gap: 4px; max-width: 76%; }
.bubble-wrap.mine { align-self: flex-end; align-items: flex-end; }
.bubble-wrap.mine .react-zone { justify-content: flex-end; }
.bubble-wrap:not(.mine) { align-self: flex-start; }
.bubble-wrap .bubble { max-width: 100%; }
.react-zone { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; position: relative; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px;
  background: var(--card); border: 1px solid var(--line); font-size: 13px; line-height: 1.6;
  color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s;
}
.chip:hover { border-color: var(--accent); }
.chip.is-mine { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip-count { font-size: 11.5px; font-weight: 700; }
.chip-add { color: var(--muted); opacity: .65; }
.chip-add:hover { opacity: 1; }
.picker {
  display: flex; flex: 0 0 auto; gap: 2px; padding: 5px 7px; border-radius: 14px; background: var(--card);
  border: 1px solid var(--line); box-shadow: 0 8px 24px -12px rgba(16, 24, 40, .4); animation: pop .14s ease-out;
}
.picker button {
  background: none; border: 0; font-size: 18px; line-height: 1; padding: 4px 4px; border-radius: 8px; cursor: pointer;
  transition: transform .1s, background .1s;
}
.picker button:hover { transform: scale(1.25); background: var(--bg); }
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.96); } to { opacity: 1; transform: none; } }

/* колокольчик и панель уведомлений */
.bell { position: relative; font-size: 15px; }
.bell .badge {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
  background: #e0342b; color: #fff; font-size: 11px; font-weight: 800; line-height: 1;
  border-radius: 9px; border: 2px solid var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.notif-panel {
  position: fixed; top: 62px; right: 24px; width: 340px; max-height: 70vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 24px 60px -24px rgba(16, 24, 40, .45); padding: 8px; z-index: 90;
  animation: pop .16s ease-out;
}
.notif-head { font-weight: 800; font-size: 13px; padding: 8px 10px 6px; }
.notif-item {
  display: flex; align-items: flex-start; gap: 9px; width: 100%; text-align: left;
  background: none; border: 0; padding: 9px 10px; border-radius: 11px; cursor: pointer; color: var(--ink);
}
.notif-item:hover { background: var(--bg); }
.notif-item.is-fresh { background: var(--accent-soft); }
.notif-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.35; }
.notif-text b { font-size: 13px; font-weight: 600; }
.notif-text i { font-style: normal; font-size: 11.5px; color: #667085; }
.notif-empty { padding: 8px 10px 14px; font-size: 12.5px; color: var(--muted); }
.notif-item + .notif-item { border-top: 1px solid var(--line); border-radius: 0; }
.notif-foot { display: flex; justify-content: center; padding: 8px 10px 4px; border-top: 1px solid var(--line); margin-top: 4px; }

/* кнопка публикации, пока текст пустой */
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }

/* полоса «нет подключения» */
.offline-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 7px 12px calc(7px); font-size: 12.5px; font-weight: 700;
  background: #fff4e5; color: #8a4b00; border-bottom: 1px solid #f3d9b5;
  padding-top: calc(7px + env(safe-area-inset-top));
}
.offline-bar small { font-weight: 500; opacity: .8; font-size: 11.5px; }
body.is-offline .topbar { top: 34px; }
body.is-offline .col-left, body.is-offline .col-right { top: 106px; }

/* ================= МОБИЛЬНЫЕ ПРАВИЛА (в конце файла, чтобы побеждать базовые) ================= */
@media (max-width: 780px) {
  /* мессенджер: одна колонка на всю ширину и высоту */
  body.view-messages .shell {
    padding: 0 0 calc(58px + env(safe-area-inset-bottom));
    gap: 0;
  }
  body.view-messages .card.messenger {
    border: 0; border-radius: 0; margin: 0; min-height: calc(100vh - 57px - 58px - env(safe-area-inset-bottom));
  }
  .messenger {
    display: block; padding: 0;
  }
  .messenger.has-dialog .dialog-list { display: none; }
  .messenger:not(.has-dialog) .chat { display: none; }
  .messenger .dialog-list { border-right: 0; }

  .messenger .chat {
    display: flex; flex-direction: column; width: 100%;
    height: calc(100vh - 57px - 58px - env(safe-area-inset-bottom));
    min-height: 380px;
  }
  .messenger .chat-body { max-height: none; flex: 1; }
  .messenger .chat-form { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .chat-head { padding: 10px 12px; }
}

.chat-day {
  align-self: center; margin: 6px 0 2px; padding: 3px 10px; border-radius: 20px;
  background: var(--bg); color: var(--muted); font-size: 11.5px; font-weight: 600;
}

.dialog-side { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.dialog-time { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* карта на телефоне — на весь экран под шапкой */
@media (max-width: 780px) {
  body.view-map .shell { padding: 0 0 calc(58px + env(safe-area-inset-bottom)); }
  body.view-map .card {
    border: 0; border-radius: 0; padding: 10px;
    min-height: calc(100vh - 57px - 58px - env(safe-area-inset-bottom));
  }
  body.view-map #map-canvas { height: calc(100vh - 250px); min-height: 320px; }
}

@media (max-width: 780px) {
  .toasts { right: 10px; left: 10px; bottom: calc(72px + env(safe-area-inset-bottom)); }
}

.share-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
