/* Светлые темы — «только светлые»: браузер и WebView в тёмном режиме телефона не перекрашивают страницу сами
   (иначе текст становится белым на светлом фоне). Тёмные темы («Ночь», «Неон») переопределяют color-scheme ниже. */
:root { color-scheme: only light; }
:root {
  --green: #1f7a6d;
  --green-dark: #165a50;
  --green-soft: #e3f3f0;
  --orange: #ff7a3d;
  --gold: #f2b01e;
  --text: #1d2b29;
  --muted: #6b7a77;
  --line: #dbe5e3;
  --bg: #ffffff;
  --bg-soft: #f5f9f8;
  --danger: #c0392b;
  /* --green* — акцент темы (имена исторические). Ниже — поверхности и служебные цвета */
  --surface: #ffffff;
  --on-accent: #ffffff;
  --focus: #7cc6bb;
  --overlay: rgba(255, 255, 255, .78);
  --toast-bg: rgba(29, 43, 41, .92);
  --error-bg: #fdecea;
  --warn-bg: #fff6e0;
  --sponsor-bg: #fff9e8;
  --soon-bg: #fff3d6;
  --soon-fg: #8a6200;
  --reject-bg: #fde3df;
  --pin-start: #2d9cdb;
  --pin-end: #333333;
  --route: #1f7a6d;
  --route-dash: #ffffff;
  --repeat: var(--route); --repeat-on: var(--on-accent);      /* участок, где маршрут идёт второй раз: цвет темы (линии маршрута), как и сама тема */
  --map-filter: none;
  --radius: 14px;
  --panel-w: 430px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-weight: 400; }
.hint { color: var(--muted); font-size: 13px; margin-top: 6px; }

#app { position: relative; height: 100%; display: flex; }
#map { flex: 1; height: 100%; z-index: 0; }

/* ---------- Панель ---------- */
#panel {
  width: var(--panel-w);
  max-width: 100%;
  height: 100%;
  overflow-y: auto;
  background: var(--bg);
  border-right: 1px solid var(--line);
  padding: 0 16px calc(16px + env(safe-area-inset-bottom));
  z-index: 2;
}
.panel-head {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0 10px; background: var(--bg);
}
.logo { font-size: 22px; font-weight: 800; color: var(--green); letter-spacing: .2px; }
.logo-paw.ic { width: 1em; height: 1em; vertical-align: -0.12em; color: var(--green); }
.field { margin: 14px 0 18px; }
.label { font-weight: 700; margin-bottom: 8px; display: flex; gap: 8px; align-items: baseline; }
.label .link-btn { margin-left: auto; }

/* ---------- Кнопки ---------- */
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
}
.primary, .secondary {
  min-height: 48px; border-radius: var(--radius); border: 0; padding: 0 18px; font-weight: 700; font-size: 17px;
}
.primary { background: var(--green); color: var(--on-accent); width: 100%; }
.primary:hover { background: var(--green-dark); }
.primary:disabled { opacity: .6; cursor: progress; }
.secondary { background: var(--green-soft); color: var(--green-dark); width: 100%; margin-top: 8px; }
.link-btn { background: none; border: 0; color: var(--green); padding: 4px 0; font-size: 14px; text-decoration: underline; }
.link-btn.back { font-size: 15px; margin: 8px 0; }
.icon-btn { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; width: 40px; height: 40px; }

.segmented { display: flex; gap: 6px; background: var(--bg-soft); padding: 4px; border-radius: var(--radius); }
.segmented button {
  flex: 1; min-height: 46px; border: 0; background: transparent; border-radius: 10px; font-weight: 600; padding: 4px 6px;
}
.segmented.small button { min-height: 40px; font-size: 14px; }
.segmented button.active { background: var(--green); color: var(--on-accent); box-shadow: 0 1px 3px rgba(0,0,0,.18); }

.row { margin-top: 8px; }
input[type="text"], input[type="url"], input[type="tel"], input[type="email"], input[type="password"], select, textarea {
  width: 100%; min-height: 46px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
textarea { min-height: 80px; }

/* ---------- Наборы и плитки ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--green); background: var(--surface); color: var(--green-dark);
  border-radius: 999px; padding: 8px 14px; min-height: 40px; font-weight: 600; font-size: 14px;
}
.chip:hover { background: var(--green-soft); }
.chip-cats { margin-left: 4px; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 88px; padding: 8px 4px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
  text-align: center;
}
.tile:hover { border-color: var(--green); background: var(--green-soft); }
.tile:active { transform: scale(.97); }
.tile-icon { line-height: 1; color: var(--green); }
.tile-icon .ic { width: 30px; height: 30px; stroke-width: 1.6; vertical-align: 0; }
.tile-name { font-size: 13px; font-weight: 600; line-height: 1.15; }
.tile-count { font-size: 11px; color: var(--muted); }
.tile-empty { opacity: .55; }
.tile-soon { opacity: .6; cursor: default; }
.tile-soon .soon-badge { margin-top: 2px; font-size: 10px; padding: 2px 7px; }
.tile-badge {
  position: absolute; top: 4px; right: 6px; background: var(--orange); color: #fff; border-radius: 999px;
  font-size: 12px; font-weight: 700; padding: 1px 7px;
}

/* ---------- Список маршрута ---------- */
.route-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.route-list li {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px;
  background: var(--green-soft); border-radius: 12px;
}
.num {
  flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: var(--on-accent);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.r-icon { color: var(--green); display: inline-flex; }
.r-icon .ic { width: 20px; height: 20px; vertical-align: 0; }
.r-name { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: break-word; hyphens: auto; line-height: 1.2; }
.r-btns { display: flex; gap: 4px; }
.r-btns button {
  width: 36px; height: 36px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; font-size: 15px;
}
.r-btns button:disabled { opacity: .35; cursor: default; }
.r-drag { flex: none; width: 28px; height: 36px; margin-right: -6px; padding: 0; border: 0; background: none; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; cursor: grab; touch-action: none; border-radius: 8px; }
.r-drag .ic { width: 18px; height: 18px; }
.r-drag:focus-visible { outline: 3px solid var(--green); outline-offset: 1px; }
.route-list li.dragging { position: relative; z-index: 5; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); cursor: grabbing; }
.route-list li.dragging .r-drag { cursor: grabbing; }

/* ---------- Лимит ---------- */
.slider-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.slider-row output { min-width: 78px; text-align: right; font-weight: 700; }
input[type="range"] { flex: 1; width: 100%; accent-color: var(--green); height: 32px; }
.advanced { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.advanced summary { cursor: pointer; font-weight: 600; }
.inline { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; margin-top: 12px; font-size: 14px; }
.inline input[type="range"] { grid-column: 1; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 14px; }
.check input { width: 22px; height: 22px; accent-color: var(--green); flex: none; }
.field-inline { display: block; margin-top: 12px; font-size: 14px; }
.field-inline input, .field-inline select, .field-inline textarea { margin-top: 4px; }

.actions { margin-top: 16px; }
.actions.sticky {
  position: sticky; bottom: 0; z-index: 4; /* выше точки и флажка «Откуда / Куда» (.rp-dot) */
  background: linear-gradient(to top, var(--bg) 75%, transparent);
  padding: 14px 0 6px; margin-bottom: 0;
}
.error { margin-top: 10px; background: var(--error-bg); color: var(--danger); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.panel-foot { margin-top: 18px; text-align: center; }

/* ---------- Результат ---------- */
.res-title { margin: 6px 0 12px; font-size: 22px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { background: var(--green-soft); border-radius: 12px; padding: 10px 4px; text-align: center; }
.stat b { display: block; font-size: 16px; }
.stat span { font-size: 12px; color: var(--muted); }
.warn { margin-top: 12px; background: var(--warn-bg); border-radius: 12px; padding: 8px 12px; font-size: 14px; }
.stops { list-style: none; margin: 16px 0 0; padding: 0; }
.stops li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.stops li:hover { background: var(--bg-soft); }
.stops li.sponsored { background: var(--sponsor-bg); }
.stop-body { flex: 1; min-width: 0; }
.stop-name { font-weight: 700; overflow-wrap: anywhere; }
.stop-meta { color: var(--muted); font-size: 14px; }
.stop-contacts { font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.stop-contacts a { color: var(--green); }
.ad-badge {
  display: inline-block; background: var(--gold); color: #3b2a00; font-size: 11px; font-weight: 800;
  border-radius: 6px; padding: 1px 6px; margin-left: 6px; vertical-align: middle;
}
.legs { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.legs th, .legs td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); }

/* ---------- Маркеры на карте ---------- */
.pin {
  width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: var(--on-accent); font-weight: 800;
  display: flex; align-items: center; justify-content: center; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.pin-start, .num.pin-start { background: var(--pin-start); }
.pin-end, .num.pin-end { background: var(--pin-end); }
.pin-ad, .num.pin-ad { background: var(--gold); color: #3b2a00; }
.pin-biz { background: var(--orange); }

/* ---------- Прочее ---------- */
.fab {
  position: absolute; left: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 5;
  background: var(--green); color: var(--on-accent); border: 0; border-radius: 999px; padding: 0 20px; height: 48px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
/* Кнопка «Где я»: круглая, справа внизу (элемент карты Leaflet), масштаб «+/−» — над ней */
.map-locate {
  width: 48px; height: 48px; border-radius: 50%; border: 0; display: flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--green); box-shadow: 0 4px 12px rgba(0,0,0,.3); cursor: pointer;
}
.map-locate .ic { width: 22px; height: 22px; }
.map-locate.busy .ic { animation: spin 1.2s linear infinite; }
.map-locate.hidden { display: none; }
/* «Туалет рядом»: того же размера (48 px), что «+/−» и «Где я»; над масштабом, по правому краю столбика */
.map-locate.map-toilet { width: 40px; height: 40px; margin: 0 10px 10px 0; }
.map-locate.map-toilet .ic { width: 20px; height: 20px; }
/* «Сбросить маршрут» на карте: на одном уровне с кнопкой «Назад» (тот же отступ сверху с учётом выреза экрана) и чуть левее края */
.leaflet-top .leaflet-control.map-reset { width: 44px; height: 44px; margin: calc(12px + env(safe-area-inset-top, 0px)) 22px 0 0; }
/* «Назад» в левом верхнем углу карты (телефон, панель свёрнута) */
.map-back {
  position: absolute; z-index: 6;
  left: calc(12px + env(safe-area-inset-left, 0px)); top: calc(12px + env(safe-area-inset-top, 0px));
  width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0;
  background: var(--surface); color: var(--text); box-shadow: 0 4px 12px rgba(0,0,0,.3); cursor: pointer;
}
.map-back .ic { width: 22px; height: 22px; }
.map-back:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.me-dot { fill: #2f80ed; fill-opacity: 1; stroke: #fff; stroke-width: 3; }
.me-acc { fill: #2f80ed; fill-opacity: .12; stroke: #2f80ed; stroke-opacity: .35; stroke-width: 1; }
.toast {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 20;
  background: var(--toast-bg); color: #fff; padding: 10px 16px; border-radius: 12px; max-width: min(92vw, 420px); font-size: 14px;
}
.loading {
  position: absolute; inset: 0; z-index: 30; background: var(--overlay); color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; font-weight: 700;
}
.spinner {
  width: 46px; height: 46px; border-radius: 50%; border: 5px solid var(--green-soft); border-top-color: var(--green);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.modal {
  position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 12px;
}
.modal-box {
  position: relative; width: min(520px, 100%); max-height: 92vh; overflow-y: auto; background: var(--bg);
  border-radius: 18px; padding: 20px 18px 22px;
}
.modal-x { position: absolute; top: 10px; right: 10px; }
.modal-box h2 { margin: 0 40px 6px 0; }
.success { font-size: 20px; font-weight: 800; color: var(--green); margin-bottom: 8px; }
.key-box { display: flex; gap: 8px; align-items: center; margin: 12px 0; }
.key-box code { flex: 1; background: var(--bg-soft); padding: 12px; border-radius: 12px; overflow-wrap: anywhere; font-size: 14px; }
.key-box .secondary { width: auto; margin: 0; }

/* ---------- Телефон ---------- */
.only-mobile { display: none; }
/* Только в мобильном приложении (класс native-app ставит mobile/native/native.js) */
html:not(.native-app) .native-only { display: none !important; }
@media (max-width: 800px) {
  .only-mobile { display: inline-flex; align-items: center; justify-content: center; }
  .fab.only-mobile { display: inline-flex; align-items: center; justify-content: center; }
  #app { display: block; }
  #map { position: absolute; inset: 0; }
  #panel {
    position: absolute; left: 0; right: 0; bottom: 0; top: auto; width: 100%; height: auto; max-height: 72vh;
    border-right: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,.2);
    transition: transform .25s ease;
  }
  #panel.collapsed { transform: translateY(110%); }
  .tiles { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 3s; }
  #panel { transition: none; }
}

/* ---------- Аккаунты ---------- */
.account-btn {
  margin-left: auto; margin-right: 8px; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--green-soft);
  color: var(--green-dark); font-weight: 600; font-size: 14px;
}
.account-btn.on { background: var(--green); color: var(--on-accent); border-color: var(--green); }
#auth-tabs { margin: 10px 0 4px; }
#auth-form .primary { margin-top: 14px; }
.cab-section { margin: 16px 0 8px; font-weight: 700; }
.cab-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0; background: var(--bg-soft); }
.cab-item .row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.cab-item .title { font-weight: 600; overflow-wrap: anywhere; }
.cab-item .meta { font-size: 13px; color: var(--muted); }
.cab-item .btns { display: flex; gap: 12px; margin-top: 6px; }
.cab-item .link-btn.danger { color: var(--danger); }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--line); }
.badge.approved, .badge.active { background: var(--green-soft); color: var(--green-dark); }
.badge.pending, .badge.paused { background: var(--soon-bg); color: var(--soon-fg); }
.badge.rejected { background: var(--reject-bg); color: var(--danger); }
.cab-actions .secondary, .cab-actions .primary { margin-top: 8px; }
#cab-logout { margin-top: 18px; }

/* ---------- Нижние вкладки и страницы (телефон) ---------- */
#tabbar, .page { display: none; }
.panel-head .account-btn { display: none; }   /* аккаунт — отдельная вкладка */
.beta { font-size: 11px; font-weight: 700; color: var(--green-dark); background: var(--green-soft); border-radius: 99px; padding: 2px 8px; margin-left: 6px; vertical-align: 3px; letter-spacing: .3px; }
.page-inner { max-width: 560px; margin: 0 auto; padding: 18px 16px 32px; }
.page-title { font-size: 26px; font-weight: 800; margin: 4px 0 16px; letter-spacing: -.01em; }
.empty-card { text-align: center; border: 1px dashed var(--line); border-radius: 18px; padding: 28px 20px; background: var(--bg-soft); }
.empty-card .ico { line-height: 1; color: var(--green); }
.empty-card .ico .ic { width: 46px; height: 46px; stroke-width: 1.5; vertical-align: 0; }
.empty-card h2 { margin: 12px 0 6px; font-size: 22px; }
.empty-card.soon-card h2 { color: var(--green); }
.empty-card p { color: var(--muted); margin: 0 0 4px; }
.empty-card .cab-actions { margin-top: 16px; }
.soon-badge { flex: none; display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--soon-bg); color: var(--soon-fg); white-space: nowrap; }
.soon-list { list-style: none; margin: 18px 0 0; padding: 0; }
.soon-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); color: var(--muted); }
.soon-list li:last-child { border-bottom: 1px solid var(--line); }
.profile { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.avatar { flex: none; width: 58px; height: 58px; border-radius: 50%; background: var(--green); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; }
.profile .nm { font-weight: 700; font-size: 18px; overflow-wrap: anywhere; }
.profile .em { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.page .cab-section { font-size: 17px; margin: 26px 0 8px; }
.page details.advanced { margin-top: 12px; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.set-row.col { display: block; }
.set-row.off { color: var(--muted); }
.set-row .slider-row { margin-top: 10px; }
.page .link-btn[disabled] { color: var(--muted); text-decoration: none; cursor: default; }
.page .logout { margin-top: 26px; }

@media (max-width: 800px) {
  :root { --tabbar-h: calc(62px + env(safe-area-inset-bottom, 0px)); }
  html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }   /* вкладки всегда на месте: страница целиком не прокручивается */
  #tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; height: var(--tabbar-h); z-index: 15;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    background: var(--bg); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  #tabbar .tab {
    position: relative; background: none; border: 0; padding: 6px 2px; color: var(--muted);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font-size: 11px; font-weight: 600; line-height: 1.1; min-width: 0;
  }
  #tabbar .tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #tabbar .tab svg { width: 24px; height: 24px; flex: none; stroke-width: 1.75; }
  #tabbar .tab.active { color: var(--green); }
  #tabbar .tab.active::before { content: ""; position: absolute; top: 0; left: 26%; right: 26%; height: 3px; border-radius: 0 0 3px 3px; background: var(--green); }
  #map { inset: 0 0 var(--tabbar-h) 0; height: auto; }
  #panel { bottom: var(--tabbar-h); max-height: 64vh; padding-bottom: 16px; }
  .fab { bottom: calc(14px + var(--tabbar-h)); }
  .panel-head .account-btn { display: none; }
  .page.active {
    display: block; position: fixed; left: 0; right: 0; top: 0; bottom: var(--tabbar-h); z-index: 12;
    overflow-y: auto; background: var(--bg); padding-top: env(safe-area-inset-top, 0px);
  }
}

/* ---------- Компьютер: вкладки полосой слева ---------- */
@media (min-width: 801px) {
  /* полоса 92 px; при наведении раскрывается до 220 px поверх панели (класс .expanded, задержки — в app.js) */
  :root { --rail-w: 92px; --rail-open-w: 220px; }
  #tabbar {
    position: fixed; left: 0; top: 0; bottom: 0; width: var(--rail-w); z-index: 15;
    display: flex; flex-direction: column; align-items: stretch; gap: 4px;
    padding: 14px 8px; background: var(--bg); border-right: 1px solid var(--line);
    overflow: hidden; transition: width .18s ease, box-shadow .18s ease;
  }
  #tabbar.expanded { width: var(--rail-open-w); box-shadow: 6px 0 24px rgba(0, 0, 0, .18); }
  #tabbar.expanded .tab { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 14px; font-size: 14px; text-align: left; white-space: nowrap; }
  #tabbar.expanded .rail-logo { flex-direction: row; justify-content: flex-start; gap: 10px; padding-left: 8px; }
  #tabbar.expanded .rail-name { font-size: 15px; }
  @media (prefers-reduced-motion: reduce) { #tabbar { transition: none; } }
  /* Логотип — не кнопка: залитый знак и подпись, отделён чертой, не реагирует на наведение */
  #tabbar .rail-logo {
    display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: default; user-select: none;
    padding: 2px 0 14px; margin: 0 4px 10px; border-bottom: 1px solid var(--line);
  }
  #tabbar .rail-mark {
    width: 44px; height: 44px; border-radius: 50%; background: var(--green); color: var(--on-accent);
    display: flex; align-items: center; justify-content: center;
  }
  #tabbar .rail-mark .ic { width: 28px; height: 28px; }
  #tabbar .rail-name { font-size: 12px; font-weight: 800; color: var(--green); letter-spacing: .1px; white-space: nowrap; }
  #tabbar .tab {
    position: relative; background: none; border: 0; border-radius: 14px; padding: 10px 4px; color: var(--muted);
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 600; line-height: 1.15; text-align: center;
  }
  #tabbar .tab:hover { background: var(--bg-soft); color: var(--text); }
  #tabbar .tab svg { width: 24px; height: 24px; flex: none; stroke-width: 1.75; }
  #tabbar .tab.active { color: var(--green); background: var(--green-soft); }
  #tabbar .tab.active::before { content: ""; position: absolute; left: -8px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--green); }
  #app { margin-left: var(--rail-w); }
  .page.active {
    display: block; position: fixed; left: var(--rail-w); right: 0; top: 0; bottom: 0; z-index: 12;
    overflow-y: auto; background: var(--bg);
  }
  .page-inner { max-width: 680px; padding: 32px 28px 48px; }
  .page-title { font-size: 30px; }
}

/* ---------- Темы ---------- */
/* «Лес» — базовые токены в :root. Остальные темы переопределяют только токены. */
:root[data-theme="sea"] {
  --green: #1f6fd1; --green-dark: #164f99; --green-soft: #e4eefb;
  --text: #18263a; --muted: #66758a; --line: #d9e2ee; --bg: #ffffff; --bg-soft: #f4f7fc;
  --focus: #8fb6ea; --toast-bg: rgba(24, 38, 58, .92); --route: #1f6fd1; --pin-start: #0fa3a3;
}
:root[data-theme="lilac"] {
  --green: #7a4fd0; --green-dark: #5b37a6; --green-soft: #efe8fb;
  --text: #241d33; --muted: #756c86; --line: #e3dcef; --bg: #ffffff; --bg-soft: #f8f5fd;
  --focus: #bba3ec; --toast-bg: rgba(36, 29, 51, .92); --route: #7a4fd0; --pin-start: #e0679f;
}
:root[data-theme="night"] {
  color-scheme: dark;
  --green: #3dbfa8; --green-dark: #7fdccb; --green-soft: #183330;
  --text: #e3ece9; --muted: #8fa29e; --line: #2a3634; --bg: #121918; --bg-soft: #1a2322;
  --surface: #1d2726; --on-accent: #0b1211; --focus: #3dbfa8; --danger: #ff7b6b;
  --overlay: rgba(18, 25, 24, .8); --toast-bg: rgba(0, 0, 0, .86);
  --error-bg: #3a1f1c; --warn-bg: #3a321a; --sponsor-bg: #2f2914; --soon-bg: #3a321a; --soon-fg: #f2c75c; --reject-bg: #3a1f1c;
  --pin-end: #5d6b69; --route: #3dbfa8; --route-dash: #121918;
  --map-filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9) saturate(.55);
}
:root[data-theme="pink"] {   /* «Неон»: чёрный фон, розовый акцент */
  color-scheme: dark;
  --green: #ff3d9a; --green-dark: #ff7ab8; --green-soft: #3a1229;
  --text: #f7eef3; --muted: #a8909e; --line: #2d2329; --bg: #0b0a0b; --bg-soft: #151215;
  --surface: #1b171a; --on-accent: #0b0a0b; --focus: #ff7ab8; --danger: #ff6b81;
  --overlay: rgba(11, 10, 11, .82); --toast-bg: rgba(40, 18, 31, .95);
  --error-bg: #3b1420; --warn-bg: #33240f; --sponsor-bg: #2e1f12; --soon-bg: #3a1229; --soon-fg: #ff8cc4; --reject-bg: #3b1420;
  --pin-start: #b05cff; --pin-end: #6b5b66; --route: #ff3d9a; --route-dash: #0b0a0b;
  --map-filter: invert(1) hue-rotate(180deg) grayscale(.55) brightness(.78) contrast(1.05);
}

/* Карта под тему */
.leaflet-container { background: var(--bg-soft); }
.leaflet-tile-pane { filter: var(--map-filter); }
/* Векторная карта сама рисуется светлой или тёмной палитрой — тёмный фильтр растровых плиток к ней не применяется */
.vector-map-on .leaflet-tile-pane, .offline-map-on .leaflet-tile-pane { filter: none; }
/* Плавное появление плиток: без резкого «мигания» при подгрузке */
.leaflet-tile-container .leaflet-tile { transition: opacity .35s ease-out; }
@media (prefers-reduced-motion: reduce) { .leaflet-tile-container .leaflet-tile { transition: none; } }
.leaflet-bar a, .leaflet-bar a:hover { background-color: var(--surface); color: var(--text); border-bottom-color: var(--line); }
/* Кнопки масштаба «+/−» (40 px) — одного размера с «Туалет рядом»; «Где я» и «Настройки» крупнее (48 px); общий овал */
.leaflet-touch .leaflet-control-zoom { border-radius: 20px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,.3); border: 0; }
.leaflet-touch .leaflet-control-zoom a { width: 40px; height: 40px; line-height: 40px; font-size: 24px; }
.leaflet-control-attribution.leaflet-control { background: var(--bg); color: var(--muted); opacity: .85; }
.leaflet-control-attribution a { color: var(--green); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); }

/* Выбор темы */
.themes { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-chip {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 6px 14px 6px 6px; font-size: 14px;
}
.theme-chip .sw { width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(127, 127, 127, .35); flex: none; }
.theme-chip.active { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-soft); font-weight: 700; }

/* ---------- Иконки (Lucide, js/icons.js) ---------- */
.ic { display: inline-block; width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rail-logo { display: none; }
.segmented button .ic, .primary .ic, .secondary .ic, .fab .ic, .account-btn .ic, .link-btn .ic { margin-right: 3px; }
.chip-cats { display: inline-flex; gap: 3px; vertical-align: -0.15em; color: var(--green); }
.chip-cats .ic { width: 15px; height: 15px; }
.stop-name .cat, .cab-item .title .cat { color: var(--green); margin-right: 2px; }
.leaflet-popup-content .cat { color: var(--green); }
.pin .ic, .num .ic { width: 14px; height: 14px; stroke-width: 2.6; vertical-align: 0; }
.r-btns .ic { width: 16px; height: 16px; vertical-align: -0.15em; }
.icon-btn .ic { width: 18px; height: 18px; vertical-align: -0.2em; }
.warn-ic { color: var(--gold); }
.success .ic { width: 1em; height: 1em; }
.meta .ic { width: 14px; height: 14px; color: var(--green); }

/* ---------- Несколько аккаунтов и удаление ---------- */
.acc-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.acc-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); padding: 10px 12px;
}
.acc-item:hover { border-color: var(--green); }
.acc-item.current { border-color: var(--green); background: var(--green-soft); cursor: default; }
.acc-item .acc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.acc-item .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-item .em { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-go { color: var(--muted); }
.ic.flip { transform: scaleX(-1); }
.avatar.sm { width: 38px; height: 38px; font-size: 17px; }
.del-banner { display: flex; flex-direction: column; gap: 10px; background: var(--error-bg); color: var(--text); border: 1px solid var(--danger); border-radius: 14px; padding: 14px; margin-bottom: 18px; }
.del-banner .ic { color: var(--danger); }
.danger-zone { margin-top: 22px; }
.danger-zone summary { color: var(--danger); }
.secondary.danger { background: var(--error-bg); color: var(--danger); }
.page .check { display: flex; gap: 8px; align-items: center; margin: 12px 0 4px; font-size: 14px; }

/* ---------- Финиш и режим маршрута ---------- */
#end-mode button { padding-inline: 4px; }
.res-sub { margin: -4px 0 12px; font-size: 14px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.res-sub .ic { color: var(--green); }

/* ---------- Рекламные места в полосе слева (только компьютер, пока заглушки) ---------- */
.rail-ads { display: none; }
@media (min-width: 801px) {
  .rail-ads { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: auto; padding-top: 12px; min-height: 0; overflow: hidden; }
  /* два места поровну; размер по пропорции картинки (2 : 5 или узкая 1 : 3) считает fitRailAds() */
  .ad-slot {
    flex: none; width: 100%; aspect-ratio: 2 / 5; border: 1.5px dashed var(--line); border-radius: 12px; background: var(--bg-soft);
    color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 6px; text-align: center; font-size: clamp(11px, 0.8vw, 14px); line-height: 1.25; font-weight: 600;
  }
  .ad-slot[hidden] { display: none; }
  .ad-slot .ic { width: 22px; height: 22px; color: var(--green); opacity: .8; }
}

/* ---------- Кто идёт ---------- */
.who-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.who-grid button {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 10px; text-align: left;
  border: 1px solid var(--line); background: var(--bg-soft); border-radius: 12px; font-size: 14px; font-weight: 600; line-height: 1.15;
}
.who-grid button .ic { width: 20px; height: 20px; color: var(--green); }
.who-grid button:hover { border-color: var(--green); }
.who-grid button.active { background: var(--green); border-color: var(--green); color: var(--on-accent); }
.who-grid button.active .ic { color: var(--on-accent); }
.who-custom { margin-top: 8px; padding: 4px 12px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); }
.who-custom .slider-row { margin-top: 4px; font-size: 14px; }


/* ---------- Как идти между местами ---------- */
.style-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.style-cards button {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft);
}
.style-cards button:hover { border-color: var(--green); }
.style-cards button.active { border: 2px solid var(--green); padding: 9px 11px; background: var(--green-soft); }
.sc-title { font-weight: 700; font-size: 15px; }
.sc-title .ic { color: var(--green); }
.sc-text { font-size: 12.5px; color: var(--muted); line-height: 1.3; }

/* ---------- Папки категорий ---------- */
.cat-groups { display: flex; flex-direction: column; gap: 8px; }
.cat-group { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.cat-group.open { padding-bottom: 8px; }
.cat-group .tiles { padding: 0 8px; }
.cg-head {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 8px 12px;
  background: none; border: 0; text-align: left; border-radius: var(--radius);
}
.cg-head:hover { background: var(--bg-soft); }
.cg-icon { display: inline-flex; color: var(--green); }
.cg-icon .ic { width: 22px; height: 22px; }
.cg-name { flex: 0 1 auto; min-width: 0; font-weight: 700; }
.cg-picked { font-size: 12px; font-weight: 700; color: var(--orange); margin-left: 4px; white-space: nowrap; }
.cg-preview { flex: 1; min-width: 0; display: flex; gap: 6px; justify-content: flex-end; color: var(--muted); overflow: hidden; }
.cg-preview .ic { width: 16px; height: 16px; }
.cg-chev { color: var(--muted); transition: transform .2s; }
.cat-group.open .cg-chev { transform: rotate(180deg); }

/* ---------- Загрузка карты ---------- */
.map-loading {
  position: absolute; right: 12px; top: 12px; z-index: 6; display: flex; align-items: center; gap: 8px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; font-size: 13px; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.spinner.sm { width: 16px; height: 16px; border-width: 3px; }
@media (max-width: 800px) { .map-loading { top: calc(12px + env(safe-area-inset-top, 0px)); } }

/* ---------- Карточки заведений и рекламные предложения ---------- */
.card-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.card-link {
  display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--green); color: var(--green-dark); background: var(--surface); font-size: 13px; font-weight: 700; text-decoration: none;
}
.card-link:hover { background: var(--green-soft); }
.card-link .ic { width: 15px; height: 15px; }
.offers { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.offers-title { font-weight: 700; }
.offers-title .muted { font-size: 13px; }
.offer { border: 1px dashed var(--gold); background: var(--sponsor-bg); border-radius: 12px; padding: 10px 12px; }
.offer-head { display: flex; gap: 10px; align-items: flex-start; }
.offer-ic { color: var(--green); padding-top: 2px; }
.offer-body { flex: 1; min-width: 0; }
.offer-btns { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.offer-btns .secondary { width: auto; margin: 0; min-height: 40px; font-size: 15px; padding: 0 14px; }
.sponsor-note {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 12px; padding: 8px 12px;
  background: var(--sponsor-bg); border: 1px solid var(--gold); border-radius: 12px; font-size: 14px;
}
.sponsor-note > .ic { color: var(--gold); }
.sponsor-note > span { flex: 1; min-width: 0; }
.sponsor-note .link-btn { padding: 0; }
.pin-offer { background: var(--surface); color: var(--text); border: 3px dashed var(--gold); }
.pin-offer .ic { color: var(--green); }
.ad-order { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: var(--surface); }
.ad-order summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.ad-order summary .ic { color: var(--green); }
.ad-feat { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; font-size: 14px; }
.ad-feat input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green); flex: none; }
.ad-feat .hint { margin-top: 2px; }
.ad-all { margin-top: 10px; }
.ad-total { margin-top: 12px; font-size: 16px; }
.ad-total b { color: var(--green-dark); }
.ad-form .primary, .links-form .secondary { margin-top: 10px; }

/* ---------- Поля по категории, «Скоро...», статистика заведения ---------- */
.cat-fields { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); }
.cat-fields-title { font-weight: 700; font-size: 14px; }
.soon-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; font-size: 14px; color: var(--muted); }
.soon-row .ic { color: var(--green); }
.stats-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.stats-table th, .stats-table td { padding: 5px 4px; border-bottom: 1px solid var(--line); text-align: right; }
.stats-table th:first-child, .stats-table td:first-child { text-align: left; }
.stats-table th { color: var(--muted); font-weight: 600; }

/* ---------- Поиск мест, подсказки адресов, выбранные места ---------- */
.suggest-wrap { position: relative; }
.place-search { display: flex; align-items: center; }
.place-search > .ic { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.place-search input { width: 100%; min-height: 46px; padding: 8px 12px 8px 38px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; max-height: 320px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.sg-item { display: flex; gap: 8px; align-items: flex-start; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; font-size: 14px; line-height: 1.25; }
.sg-item:hover, .sg-item:focus { background: var(--green-soft); }
.sg-item .ic { flex: none; color: var(--green); margin-top: 1px; }
.sg-sub { display: block; font-size: 12px; color: var(--muted); }
.sg-head { padding: 8px 12px 2px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sg-empty { padding: 10px 12px; font-size: 14px; color: var(--muted); }
.route-list li.picked { background: var(--surface); border: 1.5px solid var(--green); }
.r-sub { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.r-sub .ic { width: 12px; height: 12px; color: var(--green); }
.pin-btn {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 3px 10px; min-height: 30px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 700;
}
.pin-btn .ic { width: 14px; height: 14px; }
.pin-btn.on { border-color: var(--green); color: var(--green-dark); background: var(--green-soft); }
.map-place {
  width: 28px; height: 28px; border-radius: 50%; background: var(--surface); border: 2px solid var(--green); color: var(--green);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.map-place .ic { width: 15px; height: 15px; }
.map-place.in-route { background: var(--green); color: var(--on-accent); }
/* у заведения идёт реклама — значок всегда жёлтый (на подбор мест не влияет) */
.map-place.ad { background: var(--gold); border-color: var(--gold); color: #3b2a00; }
.map-place.ad.in-route { box-shadow: 0 0 0 3px var(--green), 0 1px 4px rgba(0,0,0,.3); }
/* Группа меток одной категории: крупнее, с числом мест (жёлтая — в группе есть реклама) */
.map-place.cluster { position: relative; width: 32px; height: 32px; border-width: 2px; }
.map-place.cluster .ic { width: 17px; height: 17px; }
.map-place .mp-count { position: absolute; top: -7px; right: -9px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--green); color: var(--on-accent); font-size: 10px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.map-place.cluster.ad .mp-count { background: #3b2a00; color: var(--gold); }
.cluster-list { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; }
.cluster-list .link-btn { text-align: left; }
.ic-ad { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: #3b2a00; flex: none; }
.ic-ad .ic { width: 15px; height: 15px; }
.verify-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 12px 0; padding: 10px 12px; border-radius: 12px; background: var(--gold-soft, var(--bg-soft)); border: 1px solid var(--gold); }
.verify-banner span { flex: 1 1 200px; }
.verify-banner .primary { width: auto; padding: 0 16px; min-height: 38px; }
.popup-add { width: auto; min-height: 36px; margin-top: 8px; font-size: 14px; padding: 0 12px; }

/* ---------- Лента, отзывы ---------- */
#feed-sort { margin-bottom: 12px; }
.feed-card {
  display: block; width: 100%; text-align: left; margin: 8px 0; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--surface); color: var(--text);
}
.feed-card:hover { border-color: var(--green); }
.feed-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; font-size: 16px; }
.feed-top .badge { flex: none; }
.feed-cats { display: flex; gap: 6px; margin: 6px 0 4px; color: var(--green); }
.feed-cats .ic { width: 18px; height: 18px; }
.feed-card .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.feed-card .meta .ic { width: 13px; height: 13px; vertical-align: -0.15em; }
.feed-title { margin: 8px 0 4px; font-size: 22px; }
.feed-desc { margin: 10px 0 0; white-space: pre-line; }
.feed-stops { margin: 12px 0 0; padding-left: 0; list-style: none; counter-reset: st; }
.feed-stops li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.feed-stops li .ic { color: var(--green); }
.stars { color: var(--gold); letter-spacing: 1px; }
.rating-big { margin: 6px 0 10px; font-size: 16px; }
.rating-big .stars { font-size: 18px; }
.review-form { border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px 12px; background: var(--bg-soft); margin-bottom: 10px; }
.review-form textarea { margin-top: 8px; }
.star-pick { display: flex; gap: 4px; }
.star-pick button { background: none; border: 0; font-size: 30px; line-height: 1; color: var(--line); padding: 2px; min-width: 40px; min-height: 40px; }
.star-pick button.on { color: var(--gold); }
.review { padding: 10px 0; border-top: 1px solid var(--line); }
.review-head { font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.review-text { margin-top: 4px; white-space: pre-line; overflow-wrap: anywhere; }
.review-reply { margin-top: 6px; padding: 6px 10px; border-left: 3px solid var(--green); background: var(--green-soft); border-radius: 0 8px 8px 0; font-size: 14px; }
.review .btns { display: flex; gap: 12px; margin-top: 4px; }
.stop-actions { display: flex; flex-wrap: wrap; gap: 6px; }
#sheet .modal-box textarea, #sheet .modal-box select { width: 100%; }

/* ---------- Откуда / Куда (как в картах: две строки, пунктир, ⇅) ---------- */
.rp { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 4px 48px 4px 0; }
.rp-row { position: relative; display: flex; align-items: center; gap: 4px; min-height: 50px; }
.rp-row + .rp-row { border-top: 1px solid var(--line); margin-left: 44px; }
.rp-row + .rp-row .rp-dot { margin-left: -44px; }
.rp-dot { flex: none; width: 44px; display: flex; justify-content: center; align-items: center; position: relative; z-index: 1; }
.rp-dot-start::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--pin-start); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pin-start) 25%, transparent); }
.rp-dot-end .ic { width: 18px; height: 18px; color: var(--text); }
.rp.rp-ring .rp-dot-end .ic { color: var(--pin-start); }
.rp::before { /* пунктир между точками */
  content: ""; position: absolute; left: 21px; top: 36px; bottom: 36px; border-left: 2px dotted var(--muted); opacity: .6;
}
.rp-input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; min-height: 46px; padding: 6px 4px !important; font-size: 16px; }
.rp-input:focus { outline: none; }
.rp-input::placeholder { color: var(--muted); }
.rp.rp-start-empty .rp-row[data-which="start"] .rp-input::placeholder { color: var(--green-dark); font-weight: 600; }
.rp-btn { flex: none; width: 40px; height: 40px; border: 0; background: none; color: var(--muted); border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.rp-btn:hover { background: var(--bg-soft); color: var(--text); }
.rp-btn.on { color: var(--pin-start); }
.rp-swap {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.rp-swap:hover { color: var(--green); border-color: var(--green); }
.rp-menu { top: 56px; }
#rp-status:empty { display: none; }

/* Галочки «без дорог» и «без повторов» */
label.check.off { color: var(--muted); }
label.check .sg-sub { display: block; font-size: 12px; color: var(--muted); }

/* ---------- «Объявления слева»: баннеры ---------- */
.ad-slot.has-banner { padding: 0; border-style: solid; overflow: hidden; }
.ad-banner { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.ad-banner img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ad-banner .ad-badge { position: absolute; right: 4px; top: 4px; margin: 0; font-size: 9px; }
.banner-field { margin-top: 10px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 10px; }
.banner-field + .banner-field { margin-top: 6px; }
/* Заявка заведения: «это моё место», сеть, данные для проверки */
.claim-box { position: relative; margin: 6px 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); }
.claim-box > input { width: 100%; }
.claim-picked { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-weight: 600; }
.branch-row { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.branch-row .suggest-wrap, .branch-row > input, .branch-row .branch-name { flex: 1; min-width: 0; }
.branch-row .branch-name { font-size: 14px; }
.found-list { margin-top: 8px; max-height: 220px; overflow-y: auto; }
.found-list label { display: flex; gap: 8px; align-items: center; padding: 4px 0; font-size: 14px; }
/* Фото мест: полоса миниатюр в карточке, просмотр крупно, сетка в кабинете */
.photo-strip { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; scrollbar-width: thin; max-width: 100%; }
.photo-thumb { flex: 0 0 auto; width: 84px; height: 64px; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg-soft); cursor: zoom-in; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.leaflet-popup-content .photo-strip { max-width: 240px; margin-bottom: 6px; }
.photo-viewer { position: fixed; inset: 0; z-index: 3000; background: rgba(0,0,0,.88); display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.photo-viewer.hidden { display: none; }
.photo-viewer img { max-width: calc(100vw - 32px); max-height: calc(100vh - 80px); border-radius: 8px; object-fit: contain; }
.pv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; display: flex; align-items: center; justify-content: center; }
.pv-nav .ic { width: 26px; height: 26px; }
.pv-prev { left: 12px; } .pv-next { right: 12px; }
.pv-count { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: #fff; font-size: 14px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 8px; }
.photo-cell { position: relative; }
.photo-cell img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-soft); display: block; }
.photo-status { position: absolute; left: 4px; top: 4px; font-size: 11px; padding: 1px 6px; border-radius: 8px; background: var(--surface); color: var(--muted); }
.photo-status.approved { color: var(--green); }
.photo-status.rejected { color: #c0392b; }
.photo-del { position: absolute; right: 4px; top: 4px; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: flex; align-items: center; justify-content: center; }
.photo-del .ic { width: 16px; height: 16px; }
.file-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; cursor: pointer; }
.file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.banner-preview { position: relative; width: 80px; height: 200px; margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.banner-field[data-kind="rail_small"] .banner-preview { width: 60px; height: 180px; }
.banner-field[data-kind="panel"] .banner-preview { width: 240px; height: 80px; }
.banner-preview img { width: 100%; height: 100%; object-fit: cover; }
.banner-preview .ad-badge { position: absolute; right: 4px; top: 4px; margin: 0; font-size: 9px; }
.banner-thumb { width: 24px; height: 60px; object-fit: cover; border-radius: 4px; vertical-align: middle; border: 1px solid var(--line); }
.banner-thumb.small { width: 20px; }
.banner-thumb.wide { width: 72px; height: 24px; }
/* «Баннер под маршрутом»: горизонтальная карточка 3 : 1 в самом низу результата */
.panel-ad { position: relative; display: block; width: 100%; margin: 18px 0 4px; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); cursor: pointer; text-align: left; color: inherit; font: inherit; }
.panel-ad img { display: block; width: 100%; aspect-ratio: 3 / 1; object-fit: cover; }
.panel-ad .ad-badge { position: absolute; right: 8px; top: 8px; margin: 0; }
.panel-ad .cap { display: block; padding: 6px 10px; font-size: 12px; color: var(--muted); background: var(--bg-soft); }
/* Смена рекламы каждые 30 с: новый баннер мягко проявляется («уменьшить движение» — сразу) */
.ad-fade { animation: fade-in .5s ease both; }
@media (max-width: 800px) { #result { padding-bottom: 72px; } }   /* кнопка «Маршрут» не закрывает баннер */

/* ---------- Панель администратора (js/admin.js) ---------- */
@media (max-width: 800px) {
  #tabbar.has-admin { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.adm .page-title { margin-bottom: 8px; }
.adm-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: var(--bg-soft); }
.adm-card h2 { margin: 0 0 8px; font-size: 20px; display: flex; gap: 8px; align-items: center; }
.adm-card > .primary, .adm-card #adm-setup-out .primary { margin-top: 12px; }
.adm-card #adm-login-code { margin: 6px 0 10px; font-size: 22px; letter-spacing: 4px; text-align: center; }
.adm-steps { padding-left: 20px; margin: 8px 0; }
.adm-steps li { margin: 4px 0; }
.adm-qr { width: 220px; max-width: 100%; margin: 14px auto 6px; background: #fff; padding: 8px; border-radius: 12px; }
.adm-qr svg { display: block; width: 100%; height: auto; }
.adm-secret { font-size: 13px; overflow-wrap: anywhere; background: var(--surface); padding: 2px 6px; border-radius: 6px; }
.adm-backup { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.adm-backup code { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; font-size: 16px; letter-spacing: 1px; user-select: all; -webkit-user-select: all; }
.adm-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.adm-row .primary, .adm-row .secondary { width: auto; flex: 1 1 140px; margin-top: 0; }
.adm-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; font-size: 14px; overflow-wrap: anywhere; }
.adm-head .ic { color: var(--green); vertical-align: -3px; }
.adm-head .link-btn { padding: 0; font-size: 13px; }
.adm-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.adm-nav-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 6px 12px; min-height: 38px; font-size: 14px; font-weight: 600;
}
.adm-nav-btn .ic { width: 16px; height: 16px; color: var(--green); }
.adm-nav-btn.active { background: var(--green); color: var(--on-accent); border-color: var(--green); }
.adm-nav-btn.active .ic { color: var(--on-accent); }
.adm-count:empty { display: none; }
.adm-count { background: var(--orange); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; }
.adm-qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.adm-qcard { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--bg-soft); color: var(--text); }
.adm-qcard .n { font-size: 28px; font-weight: 800; line-height: 1; }
.adm-qcard .t { font-weight: 600; }
.adm-qcard .hint { margin-top: 2px; font-size: 12px; }
.adm-qcard.warn { border-color: var(--orange); background: var(--warn-bg); }
.adm-filter { margin: 8px 0; }
.adm-filter .chip { min-height: 34px; padding: 5px 12px; }
.chip.on { background: var(--green); color: var(--on-accent); }
.adm-search { display: flex; gap: 8px; margin: 8px 0 10px; }
.adm-search input { flex: 1; min-width: 0; }
.adm-search .secondary { width: auto; margin: 0; white-space: nowrap; }
.adm-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0; background: var(--bg-soft); }
.adm-item .row, .adm-detail > .row { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin: 0; }
.adm-item .title { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.adm-item .meta, .adm-detail .meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; margin-top: 2px; }
.adm-item .btns { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; }
.link-btn.danger { color: var(--danger); }
.secondary.danger { color: var(--danger); background: var(--reject-bg); }
.primary.danger-bg { background: var(--danger); margin-top: 8px; }
.adm-quote { color: var(--text) !important; font-style: italic; }
.adm-decision .adm-reject { margin-top: 10px; }
.adm-reasons { margin: 6px 0 8px; }
.adm-reasons .chip { min-height: 32px; padding: 5px 10px; font-size: 13px; font-weight: 500; text-align: left; }
.adm-decision .check { margin-top: 8px; }
.adm-detail h2 { margin: 6px 0; font-size: 21px; overflow-wrap: anywhere; min-width: 0; }
.adm-f { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.adm-f > span { color: var(--muted); }
.adm-f > div { overflow-wrap: anywhere; }
.adm-f .link-btn { padding: 0; margin-left: 6px; font-size: 13px; }
.adm-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.adm-thumbs a { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); text-decoration: none; }
.adm-thumbs img { height: 90px; max-width: 160px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: zoom-in; }
.adm-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.adm-photo img { width: 100%; height: 180px; object-fit: cover; border-radius: 10px; background: var(--line); cursor: zoom-in; }
.warn-box { margin: 10px 0; background: var(--warn-bg); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.warn-box .ic { vertical-align: -3px; }
.adm-totals { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 8px 0; }
.adm-totals .stat b { display: block; font-size: 20px; }
.adm-bars { display: flex; align-items: flex-end; gap: 2px; height: 120px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); }
.adm-bars .bar { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 2px; }
.adm-bars .bar i { display: block; width: 100%; min-height: 1px; background: var(--green); border-radius: 3px 3px 0 0; }
.adm-table { width: 100%; font-size: 13px; }
.adm-roles, .adm-perms { display: flex; flex-direction: column; margin: 6px 0; }
.adm-roles .check, .adm-perms .check { margin: 6px 0 0; }
.adm-note, .adm-role-name, #adm-new-email { margin-top: 8px; }
.adm-add { margin-top: 10px; }
.adm-log { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; overflow-wrap: anywhere; }
.adm-log .when { color: var(--muted); font-size: 13px; }
.adm-log code { font-size: 12px; background: var(--bg-soft); padding: 1px 5px; border-radius: 5px; }
.adm-log .meta { font-size: 12px; color: var(--muted); }
.adm-list { padding-left: 18px; }
.adm-code-box h2 { display: flex; gap: 8px; align-items: center; margin-top: 0; }
#adm-code-input { font-size: 22px; letter-spacing: 4px; text-align: center; margin-top: 8px; }
#adm-code-modal { z-index: 60; }
@media (max-width: 800px) {
  .adm-f { grid-template-columns: 1fr; gap: 0; }
  .adm-photos { grid-template-columns: 1fr; }
}

/* ---------- Фото людей: аватарки, фото маршрутов и отзывов ---------- */
.avatar.has-img { overflow: hidden; padding: 0; background: var(--line); }
.avatar.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.xs { width: 22px; height: 22px; font-size: 11px; flex: none; display: inline-flex; vertical-align: middle; }
.avatar-edit { position: relative; flex: none; }
.avatar-btn { position: absolute; right: -4px; bottom: -4px; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); color: var(--green); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.avatar-btn .ic { width: 15px; height: 15px; }
.avatar-del { font-size: 13px; padding: 2px 0; display: block; }
.review-head { align-items: center; }
.feed-author { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.feed-cover { display: block; width: 100%; height: 140px; object-fit: cover; border-radius: 10px; margin-bottom: 8px; background: var(--line); }
.media-item { position: relative; flex: 0 0 auto; }
.media-item .photo-thumb { display: block; position: relative; }
.media-badge { position: absolute; left: 3px; bottom: 3px; right: 3px; font-size: 10px; font-weight: 700; text-align: center; border-radius: 6px; padding: 1px 3px; background: var(--soon-bg); color: var(--soon-fg); }
.media-badge.bad { background: var(--reject-bg); color: var(--danger); }
.media-del { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--danger); padding: 0; display: flex; align-items: center; justify-content: center; }
.media-del .ic { width: 13px; height: 13px; }
.media-strip { padding-top: 6px; }
.file-pick { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--green); font-size: 14px; font-weight: 600; cursor: pointer; }
.file-pick .ic { width: 17px; height: 17px; }
.adm-photo img.square { height: 220px; object-fit: contain; background: var(--bg-soft); }

/* ---------- Вкладка «Аккаунт»: список разделов ---------- */
.acc-menu { display: flex; flex-direction: column; margin-top: 16px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--bg-soft); }
.acc-menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; color: var(--text); min-height: 64px; }
.acc-menu-item:last-child { border-bottom: 0; }
.acc-menu-item:hover { background: var(--green-soft); }
.acc-menu-ic { flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; }
.acc-menu-ic .ic { width: 20px; height: 20px; }
.acc-menu-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.acc-menu-text b { font-size: 16px; }
.acc-menu-text span { font-size: 13px; color: var(--muted); }
.acc-menu-text .acc-new { font-size: 11px; color: var(--on-accent); }   /* значок «новое» — не серым, как подпись */
.acc-menu-go { flex: none; color: var(--muted); }
.acc-back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 600; }
.acc-title { font-size: 22px; margin: 6px 0 10px; }
.acc-avatar-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.acc-file { display: inline-flex; align-items: center; gap: 6px; width: auto; margin: 0; padding: 10px 14px; cursor: pointer; }
.acc-file .ic { width: 17px; height: 17px; }

/* ---------- Плавные анимации (18.10) ----------
   Только opacity и transform — дёшево даже для слабых телефонов. Появление — @keyframes (срабатывают,
   когда элемент вставлен или перестал быть display:none); исчезновение окон и тостов — класс .is-closing
   (fadeHide в app.js). «Уменьшить движение» в системе — всё почти мгновенно (в конце файла). */
:root { --ease-out: cubic-bezier(.2, .8, .2, 1); --t-fast: .15s; --t-mid: .22s; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes pop-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes slide-in-right { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toast-out { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -8px); } }

/* окна */
.modal { animation: fade-in var(--t-mid) ease both; }
.modal .modal-box { animation: pop-in .26s var(--ease-out) both; }
.modal.is-closing { animation: fade-out var(--t-fast) ease both; pointer-events: none; }
.modal.is-closing .modal-box { animation: pop-out var(--t-fast) ease both; }
@media (max-width: 800px) {
  .modal .modal-box { animation-name: sheet-up; }
}
.photo-viewer:not(.hidden) { animation: fade-in .2s ease both; }
.photo-viewer:not(.hidden) img { animation: pop-in .24s var(--ease-out) both; }
.loading:not(.hidden) { animation: fade-in .2s ease both; }

/* тост */
.toast { animation: toast-in .24s var(--ease-out) both; }
.toast.is-closing { animation: toast-out .18s ease both; }

/* страницы вкладок и виды панели */
.page.active { animation: fade-in .2s ease both; }
.page.active .page-inner { animation: rise-in .28s var(--ease-out) both; }
.view:not(.hidden) { animation: rise-in .26s var(--ease-out) both; }
.acc-menu, .profile, .adm-nav { animation: rise-in .26s var(--ease-out) both; }
.acc-back, .acc-title { animation: slide-in-right .24s var(--ease-out) both; }
.acc-title ~ * { animation: slide-in-right .28s var(--ease-out) both; }

/* списки: карточки появляются с небольшим сдвигом по очереди */
.feed-card, .adm-item, .cab-item, .review, .stops li, .offer, .empty-card, .adm-qcard, .acc-menu-item, .adm-log, .sec-dev {
  animation: rise-in .3s var(--ease-out) both;
}
:is(.feed-card, .adm-item, .cab-item, .review, .stops li, .offer, .adm-qcard, .acc-menu-item):nth-child(2) { animation-delay: .03s; }
:is(.feed-card, .adm-item, .cab-item, .review, .stops li, .offer, .adm-qcard, .acc-menu-item):nth-child(3) { animation-delay: .06s; }
:is(.feed-card, .adm-item, .cab-item, .review, .stops li, .offer, .adm-qcard, .acc-menu-item):nth-child(4) { animation-delay: .09s; }
:is(.feed-card, .adm-item, .cab-item, .review, .stops li, .offer, .adm-qcard, .acc-menu-item):nth-child(5) { animation-delay: .12s; }
:is(.feed-card, .adm-item, .cab-item, .review, .stops li, .offer, .adm-qcard, .acc-menu-item):nth-child(n+6) { animation-delay: .15s; }

/* раскрывающиеся блоки, подсказки, ошибки */
details[open] > :not(summary) { animation: drop-in .2s var(--ease-out) both; }
details > summary { transition: color var(--t-fast) ease; }
.suggest:not(.hidden), .rp-menu:not(.hidden) { animation: drop-in .16s var(--ease-out) both; }
.error:not(.hidden), .warn-box:not(.hidden), .verify-banner, .del-banner { animation: drop-in .2s var(--ease-out) both; }
.hint:not(.hidden) { animation: fade-in .2s ease both; }

/* кнопки и поля: мягкая смена цвета, лёгкое нажатие */
button, .chip, .tile, .tab, .link-btn, .acc-menu-item, .feed-card, .adm-nav-btn, .adm-qcard, .photo-thumb, .file-pick, .acc-file, .avatar-btn, a {
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease, border-color var(--t-fast) ease,
              box-shadow var(--t-fast) ease, transform var(--t-fast) ease, opacity var(--t-fast) ease;
}
.primary:active, .secondary:active, .chip:active, .adm-nav-btn:active, .acc-menu-item:active, .feed-card:active,
.adm-qcard:active, .icon-btn:active, .fab:active, .photo-thumb:active { transform: scale(.97); }
.feed-card:hover, .adm-qcard:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .08); }
.acc-menu-item:hover .acc-menu-go { transform: translateX(3px); }
.acc-menu-go { transition: transform var(--t-fast) ease; }
input, select, textarea { transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease, background-color var(--t-fast) ease; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px var(--green-soft); }
.photo-thumb img, .feed-cover, .adm-thumbs img { transition: transform .3s var(--ease-out); }
.photo-thumb:hover img { transform: scale(1.05); }
.star-pick button { transition: transform var(--t-fast) ease, color var(--t-fast) ease; }
.star-pick button:hover { transform: scale(1.15); }
.badge { transition: background-color var(--t-fast) ease, color var(--t-fast) ease; }
/* полоса вкладок: подчёркивание активной появляется плавно */
#tabbar .tab::before { transition: opacity var(--t-mid) ease, transform var(--t-mid) var(--ease-out); }
#tabbar .tab.active::before { animation: fade-in var(--t-mid) ease both; }

/* «Уменьшить движение»: анимации почти мгновенные (крутилка загрузки — медленно, как раньше) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .spinner { animation: spin 3s linear infinite !important; }
}

/* ---------- Панель: цены, сводка рекламы, оформление ---------- */
.adm-prices { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.adm-price-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--bg-soft); }
.adm-price-row > span:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.adm-price-row .meta { font-size: 12px; color: var(--muted); }
.adm-price-in { display: flex; align-items: center; gap: 6px; flex: none; flex-wrap: wrap; justify-content: flex-end; max-width: 50%; }
.adm-price-in input { width: 110px; min-height: 40px; text-align: right; }
.stat.warn { background: var(--warn-bg); }
.adm-item.ending { border-color: var(--orange); }
.adm-theme .sw, .theme-chip .sw { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line); vertical-align: -4px; }
.adm-tok { display: grid; grid-template-columns: 42px minmax(0, 1fr) 150px auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.adm-tok input[type="color"] { width: 40px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; }
.adm-tok-name { display: flex; flex-direction: column; font-size: 14px; min-width: 0; }
.adm-tok-name .meta { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.adm-tok-val { min-height: 36px !important; font-size: 13px; }
.adm-tok.changed .adm-tok-name { font-weight: 700; }
.adm-tok-reset { width: 34px; height: 34px; }
.adm-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.adm-cat { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); color: var(--text); font-size: 12px; text-align: center; }
.adm-cat .ic { width: 26px; height: 26px; color: var(--green); }
.adm-cat.on { border-color: var(--green); background: var(--green-soft); }
.adm-cat .dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.adm-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; margin: 8px 0; }
.adm-ic { display: flex; align-items: center; justify-content: center; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }
.adm-ic:hover { border-color: var(--green); color: var(--green); }
.adm-icons.big { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.adm-ic-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); font-size: 12px; }
.adm-ic-card .ic { width: 30px; height: 30px; color: var(--green); }
.adm-ic-preview { width: 64px; height: 64px; margin: 8px 0; border: 1px dashed var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--green); }
.adm-ic-preview .ic { width: 40px; height: 40px; }
@media (max-width: 800px) {
  .adm-tok { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .adm-tok-val { grid-column: 2 / 4; }
  .adm-price-row { flex-direction: column; align-items: stretch; }
  .adm-price-in { max-width: none; justify-content: flex-start; }
}
.adm-price-row .badge { align-self: flex-start; }

/* ---------- Поля форм: пароль с кнопкой «показать», ошибка под полем (js/forms.js) ---------- */
.pw-wrap { position: relative; display: block; margin-top: 4px; }
.field-inline .pw-wrap input { margin-top: 0; }
.pw-wrap input { padding-right: 48px; }
.pw-eye {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer;
}
.pw-eye:hover { color: inherit; background: var(--bg-soft); }
.pw-eye[aria-pressed="true"] { color: var(--green); }
.pw-eye .ic { width: 20px; height: 20px; }
input::-ms-reveal, input::-ms-clear { display: none; }   /* своя кнопка Edge не нужна: есть наша */
.field-err { display: block; margin-top: 4px; color: var(--danger); font-size: 13px; }
input[aria-invalid] { border-color: var(--danger); }

/* ---------- Юридические документы: галочки согласия, ссылки, плашка «примите документы» ---------- */
.legal-checks .check { margin-top: 10px; font-size: 13px; line-height: 1.4; }
.check a, .legal-banner a, .warn-box a { color: var(--green); }
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 22px 0 8px; font-size: 13px; }
.legal-links a { color: var(--muted); }
.legal-links a:hover { color: var(--green); }

/* ---------- Карточка места (как в Яндекс Картах): шторка на телефоне, панель справа на компьютере ---------- */
.place-card {
  position: fixed; z-index: 14; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text); box-shadow: 0 8px 32px rgba(0, 0, 0, .22);
}
.pc-body { flex: 1 1 auto; min-height: 0; padding: 16px 16px 18px; overflow-y: auto; overscroll-behavior: contain; }
.pc-close { position: absolute; top: 10px; right: 10px; z-index: 1; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.pc-grip { display: none; }
.pc-peek-end { display: block; height: 0; }
.pc-head { display: flex; gap: 12px; align-items: flex-start; padding-right: 40px; }
.pc-ic {
  flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--green-soft); color: var(--green);
  display: flex; align-items: center; justify-content: center; font-weight: 800;
}
.pc-ic.ad { background: var(--gold); color: #3b2a00; }
.pc-ic .ic { width: 22px; height: 22px; }
.pc-titles { flex: 1; min-width: 0; }
.pc-head h2 { margin: 0; font-size: 20px; line-height: 1.2; overflow-wrap: anywhere; }
.pc-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin-top: 3px; color: var(--muted); font-size: 14px; }
.pc-sub .ad-badge { margin-left: 0; }
.pc-sub .cat { color: var(--green); }
.pc-rating { color: var(--text); }
.pc-rating:empty { display: none; }
.pc-route { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 8px 10px; border-radius: 12px; background: var(--bg-soft); font-size: 14px; }
.pc-route > .ic { flex: none; margin-top: 2px; color: var(--green); }
.pc-offer { background: var(--sponsor-bg); }
.pc-offer > .ic { color: var(--gold); }
.pc-acts { display: flex; gap: 4px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.pc-acts::-webkit-scrollbar { display: none; }
.pc-act {
  flex: 1 0 62px; max-width: 92px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 4px 2px; border: 0; background: none; color: var(--text); font-size: 12px; font-weight: 600; line-height: 1.15; text-align: center;
}
.pc-act-ic { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--green-soft); color: var(--green-dark); }
.pc-act-ic .ic { width: 20px; height: 20px; }
.pc-act:first-child .pc-act-ic, .pc-act.on .pc-act-ic { background: var(--green); color: var(--on-accent); }
.pc-act:hover .pc-act-ic { box-shadow: 0 0 0 2px var(--green-soft); }
.pc-act:disabled { opacity: .55; cursor: default; }
.pc-act:active .pc-act-ic { transform: scale(.94); }
.pc-rows { margin-top: 12px; border-top: 1px solid var(--line); }
.pc-row { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 15px; overflow-wrap: anywhere; }
.pc-row > .ic { flex: none; margin-top: 2px; color: var(--muted); }
a.pc-row span { color: var(--green); }
a.pc-row:hover span { text-decoration: underline; }
.pc-desc { color: var(--muted); font-size: 14px; }
.pc-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; margin-top: 10px; font-size: 13px; }
.pc-foot .link-btn { display: inline-flex; align-items: center; gap: 4px; }
.pc-foot .link-btn .ic { width: 15px; height: 15px; }
.pc-body .card-links { margin-top: 10px; }
.pc-rv-title { margin-top: 18px; }

/* Подсвеченная метка: место открыто в карточке или развёрнуто в списке */
.pin, .map-place { transition: transform var(--t-mid) var(--ease-out), box-shadow var(--t-mid) ease; }
.pin.is-active, .map-place.is-active { transform: scale(1.25); box-shadow: 0 0 0 4px var(--focus), 0 2px 8px rgba(0, 0, 0, .4); }

/* Остановка маршрута: строка-кнопка, по нажатию — карточка на месте */
.stops li { align-items: flex-start; }
.stops li.open { background: var(--bg-soft); }
.stops li.sponsored.open { background: var(--sponsor-bg); }
.stop-toggle { position: relative; display: block; width: 100%; padding: 0 30px 0 0; border: 0; background: none; color: inherit; text-align: left; }
.stop-toggle .stop-name, .stop-toggle .stop-meta { display: block; }
.stop-chev { position: absolute; top: 2px; right: 6px; color: var(--muted); transition: transform var(--t-mid) var(--ease-out); }
.stop-chev .ic { width: 18px; height: 18px; }
.stops li.open .stop-chev { transform: rotate(180deg); }
.stop-more { padding-right: 6px; animation: drop-in .2s var(--ease-out) both; }
.stop-more .pc-acts { margin-top: 10px; }
.stop-more .pc-route { margin-top: 10px; background: var(--bg); }
.stop-more .pc-rows { margin-top: 8px; }
.stop-meta .stars { letter-spacing: 0; }

@media (min-width: 801px) {
  .place-card {
    top: 12px; right: 12px; width: clamp(260px, calc(100vw - var(--rail-w) - var(--panel-w) - 48px), 380px);
    max-height: calc(100vh - 24px); border: 1px solid var(--line); border-radius: 18px;
  }
  .place-card:not(.hidden) { animation: slide-in-right .22s var(--ease-out) both; }
  .place-card.is-closing { animation: fade-out var(--t-fast) ease both; pointer-events: none; }
}
@media (max-width: 800px) {
  .place-card {
    left: 0; right: 0; bottom: var(--tabbar-h);
    max-height: calc(100% - var(--tabbar-h) - env(safe-area-inset-top, 0px) - 40px);
    border-radius: 20px 20px 0 0; box-shadow: 0 -6px 24px rgba(0, 0, 0, .22);
    transform: translateY(var(--pc-y, 0px)); transition: transform .26s var(--ease-out); will-change: transform;
  }
  .place-card.dragging { transition: none; }
  .pc-grip { display: block; flex: none; position: relative; height: 22px; touch-action: none; cursor: grab; }
  .pc-grip::before { content: ""; position: absolute; left: 50%; top: 8px; width: 40px; height: 5px; border-radius: 3px; background: var(--muted); opacity: .45; transform: translateX(-50%); }
  .pc-body { padding-top: 0; }
  .pc-head { touch-action: none; }
  .place-card:not(.full) .pc-body { overflow: hidden; touch-action: none; }
  .pc-close { top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .place-card, .pin, .map-place, .stop-chev { transition: none; }
  .place-card:not(.hidden), .stop-more { animation: none; }
}
.stop-more .pc-acts { flex-wrap: wrap; overflow: visible; }
.stop-more .pc-act { flex: 1 0 60px; }

/* «Дойти до метро / станции» под маршрутом */
.transit-offer { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.transit-offer .transit-ic { flex: none; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--bg-soft); color: var(--green); }
.transit-offer .transit-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; }
.transit-offer .transit-text span { color: var(--muted); font-size: 12px; }
.transit-offer button { flex: none; width: auto; margin: 0; padding: 8px 12px; }

/* «Сократить маршрут»: шаг поездки в списке остановок */
.stop-transit .num.pin-transit { background: var(--bg-soft); color: var(--green); border: 2px solid var(--green); }
.stop-transit .ts-seg { display: flex; gap: 8px; align-items: flex-start; margin-top: 6px; font-size: 13px; }
.stop-transit .ts-line { flex: none; width: 6px; align-self: stretch; min-height: 28px; border-radius: 3px; }
.transit-note { align-items: center; }

/* Список мест под плиткой категории (настройка «Показывать места при выборе категории») */
.cat-picker { margin: 8px 8px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; animation: pop-in .18s ease-out; }
.pk-head { padding: 8px 12px 4px; font-size: 12px; color: var(--muted); }
.cat-picker button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-top: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .15s; }
.cat-picker button:hover { background: var(--green-soft); }
.cat-picker button:disabled { opacity: .5; cursor: default; }
.cat-picker .ic { width: 18px; height: 18px; flex: none; color: var(--green); }
.pk-trust { font-weight: 700; color: var(--green); flex-wrap: wrap; }
.pk-trust .pk-sub { flex-basis: 100%; margin-left: 28px; font-weight: 400; }
.pk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pk-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.pk-ad .ic { width: 13px; height: 13px; color: #e0a800; fill: currentColor; vertical-align: -1px; }
.pk-sub { font-size: 12px; color: var(--muted); }
.pk-note { padding: 12px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.pk-more { justify-content: center; color: var(--green); font-weight: 600; }

/* Карточка «Приложение для Android» (вкладка «Аккаунт», только Android-браузер) */
.app-card { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 14px 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--green-soft); animation: pop-in .2s ease-out; }
.app-card .acc-menu-text { flex: 1; min-width: 160px; }
.app-card a.primary { width: auto; display: inline-block; text-align: center; padding: 9px 16px; border-radius: 10px; text-decoration: none; font-weight: 700; }
.app-card .hint { flex-basis: 100%; margin: 0; }

/* Журнал обновлений («Что нового») и значок «новое» */
.acc-new { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--green); color: var(--on-accent); font-size: 11px; font-weight: 700; vertical-align: 1px; }
.chl-entry { padding: 12px 0; border-bottom: 1px solid var(--line); }
.chl-entry:last-child { border-bottom: 0; }
.chl-date { margin: 2px 0 6px; font-size: 12px; color: var(--muted); }
.chl-entry ul { margin: 0; padding-left: 18px; font-size: 14px; }
.chl-entry li { margin: 3px 0; }
#tabbar .tab.has-news { position: relative; }
#tabbar .tab.has-news::after { content: ""; position: absolute; top: 6px; right: calc(50% - 20px); width: 9px; height: 9px; border-radius: 50%; background: #e5484d; box-shadow: 0 0 0 2px var(--surface); }

/* Объявление для всех (баннер сверху) */
.announce { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 2500; width: min(560px, calc(100vw - 16px)); display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0,0,0,.22); font-size: 14px; animation: pop-in .2s ease-out; }
.announce.warn { border-color: #e0a800; background: #fff6d6; color: #3d3000; }
.announce .an-ic .ic { width: 18px; height: 18px; margin-top: 1px; color: var(--green); }
.announce.warn .an-ic .ic { color: #b07a00; }
.announce .an-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.announce .an-text a { color: inherit; font-weight: 700; text-decoration: underline; }
.announce .an-x { flex: none; width: 28px; height: 28px; padding: 0; border: 0; background: none; color: inherit; opacity: .7; cursor: pointer; }
.announce .an-x:hover { opacity: 1; }

/* Уведомления аккаунта */
.notif { padding: 10px 12px; margin-top: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.notif.unread { border-color: var(--green); background: var(--green-soft); }
.nf-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.nf-date { flex: none; font-size: 12px; color: var(--muted); }
.nf-body { margin-top: 4px; font-size: 14px; overflow-wrap: anywhere; }

.style-cards button[data-style="green"] { grid-column: 1 / -1; }

.pc-row.pc-closed { color: var(--danger, #c0392b); }

/* Теги маршрутов и подборки в ленте */
.tag-row, .tag-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tag-chip { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: inherit; font: inherit; font-size: 13px; cursor: pointer; transition: background .15s, border-color .15s; }
.tag-chip:hover { border-color: var(--green); }
.tag-chip.on { background: var(--green); border-color: var(--green); color: var(--on-accent); }
.tag-chip.featured .ic { width: 12px; height: 12px; vertical-align: -1px; fill: currentColor; }
.tag-add { display: flex; gap: 8px; margin-top: 6px; }
.tag-add input { flex: 1; min-width: 0; }
.tag-add .secondary { width: auto; padding: 8px 14px; }
.feed-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.tag-mini { padding: 1px 8px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 12px; }

/* Встретиться с другом */
.meet-place { display: flex; gap: 10px; align-items: center; margin: 8px 0; }
.meet-place .ic { width: 28px; height: 28px; color: var(--green); flex: none; }
.meet-stats { grid-template-columns: repeat(2, 1fr); margin-bottom: 10px; }
#meet-link { width: 100%; }

/* Мои открытия */
.disc-stats { margin: 10px 0; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.badge-card { padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); opacity: .7; }
.badge-card.have { opacity: 1; border-color: var(--green); background: var(--green-soft); }
.bc-title { font-weight: 700; font-size: 14px; }
.bc-text { font-size: 12px; color: var(--muted); margin: 2px 0 6px; }
.bc-bar { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bc-bar i { display: block; height: 100%; background: var(--green); }
.bc-num { margin-top: 4px; font-size: 12px; color: var(--muted); }
.hint-list { margin: 6px 0 10px; padding-left: 18px; font-size: 14px; }

/* ---------- Обновление свайпом (js/refresh.js) ---------- */
/* «Потянуть вниз» на вкладках «Лента», «Мои маршруты», «Аккаунт»: системный pull-to-refresh и подсветка края выключены */
.page { overscroll-behavior-y: contain; }
.ptr { position: sticky; top: 0; height: 0; z-index: 6; pointer-events: none; }
.ptr-ball {
  position: absolute; left: 50%; top: 0; width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface); color: var(--green); box-shadow: 0 3px 12px rgba(0, 0, 0, .22);
  display: flex; align-items: center; justify-content: center;
  transform: translate(-50%, -44px) scale(.6); opacity: 0; will-change: transform, opacity;
}
.ptr-ball .ic { width: 20px; height: 20px; stroke-width: 2.2; }
.ptr-drag .ptr-ball { transition: none; }
.ptr-back .ptr-ball { transition: transform .22s var(--ease-out, ease-out), opacity .22s ease; }
.ptr-ready .ptr-ball { background: var(--green); color: var(--on-accent); }
.ptr-spin .ptr-ball { background: var(--surface); color: var(--green); }
.ptr-spin .ptr-ball .ic { animation: ptr-rot .8s linear infinite; }
@keyframes ptr-rot { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .ptr-back .ptr-ball { transition: opacity .1s linear; }
  .ptr-spin .ptr-ball .ic { animation-duration: 2.4s; }
}
/* ============ Жалобы: на место, на маршрут, на сайт (openIssue в app.js; панель — «Жалобы и проблемы») ============ */
.pc-act[data-pc-act="report"] .pc-act-ic { background: var(--line); color: var(--muted); }
.issue-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.issue-link .ic { width: 16px; height: 16px; }
.issue-ui-btn { display: flex; margin: 18px auto 0; }
.issue-form .label { margin-top: 12px; }
.issue-subject { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--green-soft); font-size: 14px; overflow-wrap: anywhere; }
.issue-subject .ic { flex: none; width: 18px; height: 18px; }
.issue-reasons { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 4px; }
.issue-reason { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 14px; }
.issue-reason input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--green); }
.issue-reason:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.issue-reason:has(input:focus-visible) { box-shadow: 0 0 0 2px var(--focus); }
.issue-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.4; }
.issue-note .ic { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.issue-tech { margin: 8px 0; font-size: 13px; }
.issue-tech summary { cursor: pointer; color: var(--muted); }
.issue-tech pre { max-height: 220px; overflow: auto; margin: 6px 0 0; padding: 8px; border-radius: 8px; background: var(--line); font-size: 11px; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; }
.issue-form #issue-send { width: 100%; margin-top: 10px; }
.issue-item .issue-note-in { min-height: 56px; margin-top: 8px; font-size: 13px; }
.issue-item .btns:empty { display: none; }
.badge.new { background: var(--soon-bg); color: var(--soon-fg); }
.badge.resolved { background: var(--green-soft); color: var(--green-dark); }
/* маршрут из жалобы на главной карте */
.pin.pin-report { background: var(--danger); color: #fff; }
.report-chip { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 800; display: flex; align-items: center; gap: 8px;
  max-width: calc(100% - 32px); padding: 6px 6px 6px 12px; border-radius: 999px; background: var(--surface); color: var(--text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .2); font-size: 13px; }
.report-chip > .ic { flex: none; width: 16px; height: 16px; color: var(--danger); }
.report-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-chip .icon-btn { flex: none; width: 32px; height: 32px; }
/* ---------- Режим отладки карты (debug.js; владелец и модераторы, право «graph») ---------- */
.dbg-toggle {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.18); cursor: pointer;
}
.dbg-toggle .ic { width: 20px; height: 20px; }
.dbg-toggle.on { background: #ff2bd6; color: #fff; border-color: #ff2bd6; }
.dbg-toggle:focus-visible, .dbg-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.dbg-bar {
  position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 2400; width: min(760px, calc(100vw - 16px));
  box-sizing: border-box; background: var(--surface); color: var(--text); border: 2px solid #ff2bd6; border-radius: 12px; padding: 6px 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,.22); font-size: 13px;
}
.dbg-bar-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dbg-bar-row b { display: inline-flex; align-items: center; gap: 6px; color: #c0159f; }
.dbg-bar-row b .ic { width: 16px; height: 16px; }
.dbg-hint { color: var(--muted); }
.dbg-sp { flex: 1; }
.dbg-btn {
  display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 4px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--text); font-size: 13px; cursor: pointer;
}
.dbg-btn .ic { width: 16px; height: 16px; }
.dbg-btn.on { background: #ff2bd6; color: #fff; border-color: #ff2bd6; }
.dbg-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; color: var(--muted); font-size: 12px; }
.dbg-legend span { display: inline-flex; align-items: center; gap: 5px; }
.dbg-legend i, .dbg-sw { display: inline-block; width: 18px; height: 4px; border-radius: 2px; }
.dbg-legend i.dash, .dbg-sw.closed { background: repeating-linear-gradient(90deg, #d00000 0 5px, transparent 5px 9px); }
.dbg-legend i.green { height: 8px; background: rgba(76,175,80,.45); }
.dbg-legend i.edited { height: 8px; background: rgba(255,43,214,.4); }
.dbg-sw { margin-right: 4px; vertical-align: 3px; }
.dbg-box {
  position: fixed; z-index: 2300; right: 16px; top: 96px; width: 360px; max-height: calc(100vh - 120px); overflow-y: auto;
  box-sizing: border-box; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: pop-in .2s var(--ease-out, ease-out) both;
}
.dbg-box.is-closing { animation: pop-out .17s ease both; }
.dbg-box-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dbg-box-head b { display: inline-flex; align-items: center; gap: 6px; }
.dbg-x { width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--bg-soft); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.dbg-kinds { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; margin: 8px 0; display: grid; gap: 2px; }
.dbg-kinds legend { padding: 0 4px; font-size: 13px; color: var(--muted); }
.dbg-box .check { margin-top: 6px; align-items: center; }
.dbg-kinds .check { margin-top: 4px; }
.dbg-title { display: inline-flex; align-items: center; gap: 6px; border: none; background: none; padding: 0; color: #c0159f; font: inherit; font-weight: 700; cursor: default; }
.dbg-title .ic { width: 16px; height: 16px; }
.dbg-green { margin: 6px 0; }
.dbg-box input[type=text] { width: 100%; box-sizing: border-box; margin: 6px 0; }
.dbg-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.dbg-list { margin-top: 8px; display: grid; gap: 8px; }
.dbg-item { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.dbg-item.revoked { opacity: .6; }
.dbg-item .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.dbg-item-act { display: flex; gap: 12px; margin-top: 4px; }
.dbg-st { color: var(--danger); font-weight: 600; }
.dbg-card { margin-top: 14px; padding: 10px 12px; border: 2px dashed #ff2bd6; border-radius: 12px; display: grid; gap: 8px; }
.dbg-card-head { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: #c0159f; word-break: break-all; }
.dbg-card-head .ic { width: 16px; height: 16px; }
.dbg-card .hint { margin: 0; }
.leaflet-container.dbg-rect-mode { cursor: crosshair; }
html.dbg-mode .leaflet-container { cursor: pointer; }
html.dbg-mode .toast { top: 96px; }   /* не под плашкой «Режим отладки» */
@media (max-width: 800px) {
  .dbg-bar { top: calc(6px + env(safe-area-inset-top, 0px)); padding: 6px 8px; }
  .dbg-btn span { display: none; }
  .dbg-btn { padding: 4px 8px; }
  .dbg-legend { gap: 2px 8px; font-size: 11px; display: none; }
  .dbg-bar.legend-open .dbg-legend { display: flex; }
  .dbg-title { cursor: pointer; }
  .dbg-title::after { content: "▾"; font-size: 11px; }
  .dbg-box {
    left: 8px; right: 8px; top: auto; width: auto; bottom: calc(var(--tabbar-h, 60px) + 8px + env(safe-area-inset-bottom, 0px));
    max-height: 58vh; animation-name: sheet-up;
  }
}
@media (prefers-reduced-motion: reduce) { .dbg-box { animation: none; } }

/* ---------- Главная на телефоне: короче (21.10) ----------
   Компьютер не меняется: чипы лимита и строка описания стиля видны только на телефоне. */
.budget-chips, .style-desc, .w-short { display: none; }
.label-aside { display: none; }
@media (max-width: 800px) {
  #view-settings:not(.hidden) { display: flex; flex-direction: column; }
  #view-settings .f-rp { order: 1; }
  #view-settings .f-who { order: 2; }
  #view-settings .f-budget { order: 3; }
  #view-settings .f-style { order: 4; }
  #view-settings .f-route { order: 5; }
  #view-settings .f-place { order: 6; }
  #view-settings .actions { order: 8; }
  #view-settings .advanced, #view-settings .panel-foot, #who-hint, .place-hint { display: none; }
  #view-settings .field { margin: 8px 0 12px; }
  #view-settings .label { margin-bottom: 6px; font-size: 14px; }
  .label-aside { display: inline; margin-left: auto; font-weight: 600; font-size: 12px; color: var(--muted); }
  .f-budget .label { display: flex; align-items: baseline; }
  #rp-status:empty { display: none; }
  .rp-row { min-height: 42px; }
  .rp-input { min-height: 40px; }
  #view-settings .f-rp > .label { display: none; }   /* поле само говорит «Откуда начнём?» */

  /* Кто идёт — сетка 4 × 2: значок и короткая подпись */
  #who.who-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  #who.who-grid button { flex-direction: column; justify-content: center; gap: 3px; min-height: 52px; padding: 5px 2px; border-radius: 10px; font-size: 12px; text-align: center; }
  #who.who-grid button .ic { width: 19px; height: 19px; }
  #who.who-grid .w-full { display: none; }
  #who.who-grid .w-short { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

  /* Сколько идти — чипы; ползунок и «по расстоянию» — по значку */
  .budget-chips { display: flex; gap: 6px; flex-wrap: wrap; }
  .bchip {
    min-height: 34px; padding: 4px 12px; border: 1px solid var(--line); background: var(--bg-soft); border-radius: 999px;
    font-size: 13.5px; font-weight: 600; color: var(--text);
  }
  .bchip.active { background: var(--green); border-color: var(--green); color: var(--on-accent); }
  .bchip-more { padding: 4px 10px; display: inline-flex; align-items: center; }
  .bchip-more .ic { width: 17px; height: 17px; margin: 0; }
  #view-settings:not(.budget-open) #budget-mode, #view-settings:not(.budget-open) .budget-slider { display: none; }
  #view-settings.budget-open #budget-mode { margin-top: 8px; }
  .budget-slider { margin-top: 6px; }

  /* Как идти — переключатель из трёх, описание только у выбранного */
  .style-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: var(--bg-soft); padding: 3px; border-radius: 12px; }
  .style-cards button, .style-cards button.active { padding: 7px 4px; border: 0; border-radius: 9px; align-items: center; background: transparent; min-height: 36px; justify-content: center; }
  .style-cards button.active { background: var(--green); }
  .style-cards button.active .sc-title, .style-cards button.active .sc-title .ic { color: var(--on-accent); }
  .style-cards button[data-style="green"] { grid-column: auto; }
  .sc-title { font-size: 13.5px; white-space: nowrap; }
  .sc-title .ic { width: 15px; height: 15px; }
  .sc-text { display: none; }
  .style-desc { display: block; margin-top: 5px; font-size: 12.5px; }

  /* Ваш маршрут — строки ниже */
  .route-list { gap: 4px; }
  .route-list li { padding: 3px 4px 3px 4px; gap: 8px; border-radius: 10px; }
  .route-list .num { width: 22px; height: 22px; font-size: 12px; }
  .r-btns button { width: 30px; height: 30px; border-radius: 8px; }
  .r-btns button .ic { width: 15px; height: 15px; }

  /* Куда зайти — папки вкладками, плитки 4 в ряд */
  .cat-groups.tabbed { gap: 8px; }
  .cg-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 8px -16px 0; padding: 0 16px 2px; }
  .cg-tabs::-webkit-scrollbar { display: none; }
  .cg-tab {
    flex: none; display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 4px 12px 4px 9px;
    border: 1px solid var(--line); background: var(--bg-soft); border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--text);
  }
  .cg-tab .ic { width: 16px; height: 16px; color: var(--green); }
  .cg-tab.active { background: var(--green); border-color: var(--green); color: var(--on-accent); }
  .cg-tab.active .ic { color: var(--on-accent); }
  .cg-tab-n { background: var(--orange); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; margin-left: 2px; }
  .cat-groups.tabbed .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; padding: 0; }
  .cat-groups.tabbed .tile { min-height: 62px; padding: 6px 2px; border-radius: 10px; }
  .cat-groups.tabbed .tile-icon .ic { width: 22px; height: 22px; }
  .cat-groups.tabbed .tile-name { font-size: 11px; font-weight: 600; hyphens: auto; overflow-wrap: anywhere; }
  .cat-groups.tabbed .tile-count { font-size: 10px; }
  .cat-groups.tabbed .tile-badge { top: 2px; right: 3px; font-size: 10px; padding: 0 5px; }

  /* Снизу — одна кнопка и две квадратные */
  #view-settings .actions.sticky { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0 6px; }
  #view-settings .actions #btn-build { flex: 1; min-height: 48px; margin: 0; }
  #view-settings .actions #btn-meet, #view-settings .actions #btn-surprise {
    flex: none; width: 48px; min-height: 48px; margin: 0; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  }
  #view-settings .actions #btn-meet .ic, #view-settings .actions #btn-surprise .ic { width: 22px; height: 22px; margin: 0; }
  #view-settings .actions .btn-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  #view-settings .actions #btn-surprise { order: 2; }
  #view-settings .actions #btn-meet { order: 3; }
  #view-settings .actions #btn-last, #view-settings .actions .error { flex-basis: 100%; order: 4; margin: 0; }
}

/* ---------- Профиль: публичная страница и «Настройки» (21.10) ---------- */
#page-account.pf-mode .page-title { display: none; }
.pf-top { display: flex; justify-content: flex-end; gap: 8px; margin: 4px 0 -8px; }
.pf-ic {
  position: relative; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-soft);
  color: var(--text); display: inline-flex; align-items: center; justify-content: center;
}
.pf-ic .ic { width: 21px; height: 21px; }
.pf-dot { position: absolute; top: 7px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); border: 2px solid var(--bg-soft); }
.pf-head { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; margin-bottom: 12px; }
.avatar.lg { width: 84px; height: 84px; font-size: 34px; }
.pf-head .avatar-btn { right: 0; bottom: 0; }
.pf-name { font-size: 21px; font-weight: 800; margin-top: 6px; overflow-wrap: anywhere; }
.pf-since { font-size: 13px; color: var(--muted); }
.pf-vis {
  margin-top: 6px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--bg-soft);
  border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 600; color: var(--text);
}
.pf-vis .ic { width: 14px; height: 14px; color: var(--green); }
.pf-actions { display: flex; gap: 8px; margin-bottom: 14px; }
.pf-actions .secondary { flex: 1 1 0; min-width: 0; margin: 0; padding: 0 8px; min-height: 40px; font-size: 14px; white-space: nowrap; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
@media (max-width: 420px) { .pf-actions { gap: 6px; } .pf-actions .secondary { font-size: 13px; padding: 0 4px; } .pf-actions .secondary .ic { display: none; } }
.pf-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.pf-stat { background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 2px 8px; display: flex; flex-direction: column; align-items: center; color: var(--muted); margin-bottom: -1px; }
.pf-stat b { font-size: 18px; color: var(--text); }
.pf-stat span { font-size: 12.5px; }
.pf-stat.active { border-bottom-color: var(--green); color: var(--green); }
.pf-empty { color: var(--muted); font-size: 14px; text-align: center; padding: 18px 8px; }
.pf-private { display: flex; gap: 8px; align-items: center; justify-content: center; }
.pf-routes { display: flex; flex-direction: column; gap: 8px; }
.pf-review { padding: 10px 0; border-bottom: 1px solid var(--line); }
.pf-review-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.pf-review-head .stars { color: var(--orange); white-space: nowrap; }
.pf-review-text { margin-top: 3px; font-size: 14px; overflow-wrap: anywhere; }
.pf-badges { display: flex; flex-direction: column; gap: 8px; }
.pf-badge { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); }
.pf-badge > .ic { width: 26px; height: 26px; color: var(--orange); flex: none; }
.pf-badge > span { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.pf-badge b { color: var(--text); font-size: 14px; }
.pf-privacy { display: flex; flex-direction: column; gap: 6px; }
.pf-priv {
  display: flex; gap: 10px; align-items: center; text-align: left; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--bg-soft); color: var(--text);
}
.pf-priv > .ic { width: 20px; height: 20px; color: var(--green); flex: none; }
.pf-priv > span { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.pf-priv b { color: var(--text); font-size: 15px; }
.pf-priv.active { border: 2px solid var(--green); padding: 9px 11px; background: var(--green-soft); }
.acc-group { margin: 16px 2px 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: none; }
.acc-group + .acc-menu { margin-top: 0; }
.acc-addbiz { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; }
.pf-link { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.pf-link[data-user]:hover { text-decoration: underline; }

/* ---------- Маршрут на телефоне: короче (21.10) ----------
   Шапка, строка итогов и ряд круглых кнопок видны только на телефоне; там же прячутся прежние блоки. */
.res-m { display: none; }
@media (max-width: 800px) {
  .res-m { display: flex; }
  #view-result > #btn-back, #result > .res-title, #result > .res-sub, #result > .stats, #result > .actions,
  #result > #btn-report-route { display: none; }
  #result:not(.warn-open) > .warn { display: none; }
  #result > .warn { margin-top: 8px; font-size: 13px; }

  .res-m-head { align-items: center; gap: 8px; margin: 2px 0 4px; }
  .res-m-head h2 { margin: 0; font-size: 19px; flex: 1; min-width: 0; }
  .res-m-back { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-soft); color: var(--text); display: inline-flex; align-items: center; justify-content: center; }
  .res-m-back .ic { width: 19px; height: 19px; }
  .res-m-style { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green-dark); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
  .res-m-style .ic { width: 14px; height: 14px; }

  .res-m-line { flex-wrap: wrap; align-items: center; gap: 0 4px; font-size: 14px; color: var(--muted); }
  .res-m-line b { color: var(--text); font-size: 15px; }
  .res-m-low { color: var(--orange); font-weight: 600; }
  .res-m-warn { display: inline-flex; align-items: center; gap: 2px; border: 0; background: var(--warn-bg); color: var(--orange); border-radius: 999px; padding: 2px 8px; margin-left: 2px; font-size: 12px; font-weight: 700; }
  .res-m-warn .ic { width: 15px; height: 15px; }
  #result.warn-open .res-m-warn { outline: 2px solid var(--orange); }

  .res-m-acts { justify-content: space-between; gap: 4px; margin: 12px 0 2px; }
  .res-m-acts button { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; padding: 0; font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
  .ra-c { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-soft); color: var(--green); display: flex; align-items: center; justify-content: center; }
  .ra-c .ic { width: 20px; height: 20px; }
  .ra-c.on { background: var(--green); border-color: var(--green); color: var(--on-accent); }
  .res-m-acts button:active .ra-c { transform: scale(.94); }

  /* Остановки ниже */
  #result .stops { margin-top: 10px; }
  #result .stops li { padding: 6px 0; gap: 10px; }
  #result .stops .num { width: 24px; height: 24px; font-size: 12px; }
  #result .stop-name { font-size: 14.5px; }
  #result .stop-meta { font-size: 12.5px; }

  /* Метро и дорога домой — одной строкой */
  #result .transit-offer { margin: 8px 0 0; padding: 6px 8px; gap: 8px; border-radius: 12px; }
  #result .transit-offer .transit-ic { width: 30px; height: 30px; }
  #result .transit-offer .transit-ic .ic { width: 17px; height: 17px; }
  #result .transit-offer .transit-text { font-size: 13px; }
  #result .transit-offer .transit-text b, #result .transit-offer .transit-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #result .transit-offer .transit-text span { font-size: 11.5px; }
  #result .transit-offer button.secondary { padding: 6px 10px; min-height: 32px; font-size: 13px; }
  #result .transit-offer #btn-home-change { display: none; }   /* дом меняется в «Профиль» → «Изменить» */
}

/* ---------- Вход через VK ID / Яндекс ID (окно входа) ---------- */
.oauth-box { margin-top: 14px; display: grid; gap: 10px; }
.oauth-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.oauth-or::before, .oauth-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.oauth-btns { display: grid; gap: 8px; }
.oauth-btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 10px 16px;
  border-radius: 12px; border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.oauth-btn.vk { background: #0077ff; color: #fff; }
.oauth-btn.phone { background: var(--accent); color: var(--on-accent); }
.oauth-btn .ic { width: 20px; height: 20px; }
.oauth-btn.yandex { background: #000; color: #fff; }
.oauth-btn:disabled { opacity: .6; cursor: default; }
.oauth-btn.phone:disabled { background: var(--bg-soft, #eef2f1); color: var(--muted, #5e6e6b); opacity: 1; }
.oauth-logo { width: 24px; height: 24px; flex: none; display: block; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* Подсказка «Впервые здесь? Видео на минуту» над настройками маршрута (до первого закрытия или перехода) */
.help-hint { display: flex; align-items: center; gap: 4px; margin: 10px 0 2px; padding: 6px 6px 6px 8px; border-radius: 14px; background: var(--green-soft, var(--bg-soft)); border: 1px solid var(--line); }
.help-hint[hidden] { display: none; }
.help-hint-go { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 14px; line-height: 1.3; padding: 4px 2px; border-radius: 10px; }
.help-hint-go b { color: var(--green); }
.help-hint-ic { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: var(--on-accent); display: grid; place-items: center; }
.help-hint-ic .ic { width: 16px; height: 16px; margin-left: 2px; }
.help-hint-x { flex: none; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.help-hint-x:hover { background: var(--bg-soft); color: var(--text); }
.help-hint-go:focus-visible, .help-hint-x:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Скриншоты к жалобам: превью с крестиком в окне жалобы, миниатюры в панели */
.issue-shot-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.issue-shot { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.issue-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.issue-shot button { position: absolute; top: 3px; right: 3px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.issue-shot button .ic { width: 14px; height: 14px; }
.issue-shot-add { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 12px; cursor: pointer; }
.issue-shot-add.hidden { display: none; }
.issue-shot-add:has(input:focus-visible) { box-shadow: 0 0 0 2px var(--focus); }
.issue-shot-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.issue-shot-img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; background: var(--bg-soft); }
.issue-shot-img.big { width: 100%; height: auto; max-height: 70vh; object-fit: contain; cursor: zoom-out; }

/* Подписи мест на карте (жалоба №14): название справа от значка, с «ореолом» цвета фона; по масштабу — .lab-stops / .lab-places */
.pin, .map-place { position: relative; overflow: visible; }
.pin-name, .mp-name { display: none; position: absolute; left: calc(100% + 5px); top: 50%; transform: translateY(-50%); max-width: 130px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 700; line-height: 1.2; color: var(--text); pointer-events: none;
  text-shadow: 0 0 3px var(--surface), 0 0 3px var(--surface), 0 0 2px var(--surface), 0 0 2px var(--surface); }
.lab-stops .pin-name, .lab-places .mp-name { display: block; }
.map-place.cluster .mp-name { display: none; }

/* Метка места с фото заведения (жалоба №11): круглая миниатюра вместо значка категории */
.map-place.photo { width: 38px; height: 38px; margin: -5px 0 0 -5px; padding: 0; border-width: 3px; }
.map-place.photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.map-place.photo .mp-name { left: calc(100% + 5px); }

/* Чат с поддержкой: пузыри сообщений и поле ввода (профиль → «Чат с поддержкой», панель → «Чат поддержки») */
.sp-list { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; min-height: 120px; overflow-y: auto; padding: 8px 2px; margin: 6px 0; }
.sp-msg { max-width: 86%; padding: 8px 12px; border-radius: 14px; background: var(--bg-soft); border: 1px solid var(--line); align-self: flex-start; }
.sp-msg.me { align-self: flex-end; background: var(--green-soft); border-color: var(--green); }
.fn { display: grid; gap: 8px; margin-bottom: 10px; }
.fn-row { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr) minmax(0, 11rem); gap: 10px; align-items: center; }
.fn-k { font-size: 13px; }
.fn-track { height: 14px; background: var(--bg-soft); border-radius: 7px; overflow: hidden; }
.fn-track i { display: block; height: 100%; background: var(--green); border-radius: 7px; }
.fn-v b { font-size: 15px; margin-right: 6px; }
.fn-v span { font-size: 12px; color: var(--muted); }
@media (max-width: 600px) { .fn-row { grid-template-columns: 1fr; gap: 3px; } }
.sp-note { align-self: center; max-width: 90%; text-align: center; font-size: 12px; color: var(--muted); padding: 4px 10px; }
.sp-who { font-size: 11px; font-weight: 700; color: var(--green-dark); margin-bottom: 2px; }
.sp-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.4; }
.sp-time { font-size: 11px; color: var(--muted); margin-top: 3px; text-align: right; }
.sp-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 6px; }
.sp-form textarea { flex: 1; min-width: 0; resize: none; margin: 0; }
.sp-form .primary { flex: none; width: 46px; height: 46px; padding: 0; display: grid; place-items: center; border-radius: 50%; }
.sp-empty { text-align: center; }
.adm-chat-row { display: flex; justify-content: space-between; gap: 8px; }

/* Поворот карты двумя пальцами (maprot.js): контейнер — квадрат в диагональ области карты, повёрнут на --br; значки — обратно (--ur);
   кнопки карты переезжают на подложку #map-overlay, чтобы не вращаться */
html.map-rot #map { position: fixed; inset: auto; left: calc(var(--mx) - var(--md) / 2); top: calc(var(--my) - var(--md) / 2);
  width: var(--md); height: var(--md); transform: rotate(var(--br, 0deg)); }
html.map-rot.map-rot-snap #map { transition: transform .4s ease; }
html.map-rot .pin, html.map-rot .map-place { rotate: var(--ur, 0deg); }
html.map-rot.map-rot-snap .pin, html.map-rot.map-rot-snap .map-place { transition: rotate .4s ease; }
#map-overlay { pointer-events: none; z-index: 1; background: none; overflow: visible; }
#map-overlay .leaflet-control-container { position: absolute; inset: 0; }
.map-compass .ic { width: 24px; height: 24px; transition: none; }
.map-compass.hidden { display: none; }
/* кнопка «на север» — слева от кнопки «Где я» (та же высота и размер 48 px) */
.leaflet-bottom .leaflet-control.map-compass { position: absolute; right: 68px; bottom: 10px; margin: 0; }

/* Повтор дороги (app.js, findRepeats): стрелки направления и пометка «2-й раз» на участке, который идёт второй раз */
.rep-arrow i { display: block; width: 0; height: 0; margin: 2px auto 0; border-left: 7px solid transparent; border-right: 7px solid transparent;
  border-bottom: 14px solid var(--repeat); filter: drop-shadow(0 0 1px var(--route-dash)) drop-shadow(0 0 1px var(--route-dash)); transform: rotate(var(--a, 0deg)); }
.rep-label span { display: inline-block; transform: translate(-50%, -150%); padding: 2px 8px; border-radius: 10px; background: var(--repeat);
  color: var(--repeat-on); font-size: 11px; font-weight: 700; white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.repeat-note { border-color: var(--repeat); }

/* «Поделиться маршрутом»: превью ссылки у получателя и запасное окно со ссылкой */
.share-cover { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 12px; margin-bottom: 10px; background: var(--line); }
.share-url { width: 100%; box-sizing: border-box; font-size: 14px; }
/* «Мы прогулялись» — картинка для сторис в окне */
.story-preview { display: block; width: min(260px, 62vw); height: auto; aspect-ratio: 9 / 16; margin: 0 auto 10px; border-radius: 14px; box-shadow: 0 4px 18px rgba(0, 0, 0, .25); background: var(--line); }
.story-badge { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 12px; border-radius: 12px; background: var(--soon-bg); color: var(--soon-fg); font-weight: 600; }
.story-badge .ic { flex: none; width: 18px; height: 18px; }
