: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;
  --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; }

/* ---------- Лимит ---------- */
.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: 14px 20px; font-weight: 700;
  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; }
/* «Назад» в левом верхнем углу карты (телефон, панель свёрнута) */
.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-block; }
  #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: 24px; height: 24px; stroke-width: 2.2; }
  #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); }
.leaflet-bar a, .leaflet-bar a:hover { background-color: var(--surface); color: var(--text); border-bottom-color: var(--line); }
.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-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; }
.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-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; }
