/* Карта потолочника - стили страницы. Тема: светлая/темная (data-theme на html или системная). */

:root {
  --accent: #2f6bff;
  --accent-ink: #fff;
  --bg: #eef1f6;
  --surface: #ffffff;
  --surface-2: #f4f6fa;
  --surface-3: #e9edf4;
  --line: #e2e7ef;
  --ink: #0f172a;
  --ink-2: #475467;
  --ink-3: #8592a6;
  --ok: #12b76a;
  --warn: #f79009;
  --bad: #e5484d;
  --vip: #f5a524;
  --vip-2: #ff6a1a;
  --fuel: #0fa76e;
  --ya: #5b6b82;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-2: 0 6px 20px rgba(16, 24, 40, .12);
  --shadow-3: 0 18px 48px rgba(16, 24, 40, .2);
  --r-s: 10px;
  --r-m: 14px;
  --r-l: 20px;
  --r-xl: 26px;
  --panel-w: 410px;
  --nav-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0a101c;
  --surface: #121a2a;
  --surface-2: #172135;
  --surface-3: #1e2a42;
  --line: #24314b;
  --ink: #e8edf6;
  --ink-2: #a8b3c7;
  --ink-3: #6e7b93;
  --ya: #9aa8bd;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, .45);
  --shadow-3: 0 18px 48px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a101c;
    --surface: #121a2a;
    --surface-2: #172135;
    --surface-3: #1e2a42;
    --line: #24314b;
    --ink: #e8edf6;
    --ink-2: #a8b3c7;
    --ink-3: #6e7b93;
    --ya: #9aa8bd;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 8px 24px rgba(0, 0, 0, .45);
    --shadow-3: 0 18px 48px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 15px/1.45 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.ic { display: inline-flex; width: 20px; height: 20px; flex: none; }
.ic svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------ каркас */

.app { position: fixed; inset: 0; display: flex; }
.map-wrap { position: relative; flex: 1; min-width: 0; }
.map { position: absolute; inset: 0; z-index: 0; isolation: isolate; background: var(--surface-3); }

.panel {
  width: var(--panel-w); flex: none; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line); z-index: 20; min-height: 0;
  box-shadow: 4px 0 24px rgba(16, 24, 40, .06);
}
.panel-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 10px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; color: var(--ink); }
.brand-logo { width: 38px; height: 38px; border-radius: 11px; flex: none; box-shadow: var(--shadow-1); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text b { font-size: 17px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-actions { display: flex; gap: 6px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 0; display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-2); transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }

.tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 4px 12px 10px; }
.tab {
  border: 0; background: none; border-radius: 12px; padding: 8px 2px 7px; display: flex; flex-direction: column;
  align-items: center; gap: 4px; color: var(--ink-3); font-size: 12px; font-weight: 600; transition: background .15s, color .15s;
}
.tab:hover { background: var(--surface-2); color: var(--ink-2); }
.tab.is-on { background: color-mix(in srgb, var(--accent) 11%, transparent); color: var(--accent); }
.tab .ic { width: 22px; height: 22px; }

.panel-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 12px 24px; min-height: 0; }
.panel-body::-webkit-scrollbar { width: 10px; }
.panel-body::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 3px solid var(--surface); }

.sheet-grab { display: none; }

/* ------------------------------------------------------------ поиск и фильтры */

.search { display: flex; flex-direction: column; gap: 10px; }
.search-slot { padding: 0 12px 10px; }
.map-top .search-slot { padding: 0; }
.search-box { position: relative; display: flex; align-items: center; }
.search-ic { position: absolute; left: 14px; color: var(--ink-3); pointer-events: none; }
.search-box input {
  width: 100%; height: 46px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2);
  padding: 0 44px 0 44px; outline: none; transition: border-color .15s, background .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.search-box input::-webkit-search-cancel-button { display: none; }
.search-box input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.search-clear {
  position: absolute; right: 6px; width: 34px; height: 34px; border-radius: 10px; border: 0; background: none;
  color: var(--ink-3); display: grid; place-items: center;
}
.search-clear:hover { background: var(--surface-3); color: var(--ink); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 1px; margin: -1px; }
.chips::-webkit-scrollbar { display: none; }
/* В панели компьютера чипсы переносятся на следующую строку: прокрутку вбок без полосы мышью не найти, и слои за краем
   ("Замеры", "Замерщики") не было видно (23.10.2026). Над картой (телефон) строка листается, а край гаснет, если за
   ним есть еще чипсы (more-left / more-right ставит app.js). */
.panel .chips { flex-wrap: wrap; overflow: visible; }
.chips.more-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
.chips.more-left { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px); mask-image: linear-gradient(to right, transparent, #000 40px); }
.chips.more-left.more-right {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent);
}
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px 0 10px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font-size: 13.5px; font-weight: 600; white-space: nowrap; transition: all .15s;
}
.chip .ic { width: 17px; height: 17px; }
.chip:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--ink); }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.chip-fuel.is-on { background: var(--fuel); border-color: var(--fuel); }
.chip.chip-vip.is-on { background: linear-gradient(135deg, var(--vip), var(--vip-2)); border-color: transparent; color: #fff; }
.chip.chip-ya.is-on { background: var(--ya); border-color: var(--ya); color: #fff; }
.chip .cnt { opacity: .75; font-weight: 700; }

/* ------------------------------------------------------------ список */

.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 6px 4px 8px; }
.list-head b { font-size: 15px; }
.list-head span { color: var(--ink-3); font-size: 12.5px; }
.sec-title {
  display: flex; align-items: center; gap: 6px; margin: 14px 4px 8px; color: var(--ink-3);
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.sec-title .ic { width: 15px; height: 15px; }
.rows { display: flex; flex-direction: column; gap: 6px; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 10px; border-radius: var(--r-m);
  background: var(--surface); border: 1px solid var(--line); text-align: left; width: 100%;
  transition: border-color .15s, box-shadow .15s, transform .15s; content-visibility: auto; contain-intrinsic-size: 74px;
}
.row:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); box-shadow: var(--shadow-1); }
.row:active { transform: scale(.995); }
.row.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.row-ic {
  width: 46px; height: 46px; border-radius: 13px; flex: none; display: grid; place-items: center; overflow: hidden;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent);
}
.row-ic img { width: 100%; height: 100%; object-fit: cover; }
.row-ic.fuel { background: color-mix(in srgb, var(--fuel) 14%, var(--surface)); color: var(--fuel); }
.row-ic.ya { background: var(--surface-2); color: var(--ya); }
.row-ic.vip { background: linear-gradient(135deg, var(--vip), var(--vip-2)); color: #fff; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-weight: 650; font-size: 15px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.row-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { color: var(--ink-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { display: flex; gap: 10px; font-size: 12.5px; color: var(--ink-3); flex-wrap: wrap; }
.row-end { color: var(--ink-3); font-size: 12.5px; font-weight: 600; white-space: nowrap; align-self: flex-start; padding-top: 2px; }
.dot-open { color: var(--ok); font-weight: 600; }
.dot-closed { color: var(--bad); font-weight: 600; }
.dot-soon { color: var(--warn); font-weight: 600; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; flex: none;
}
.badge .ic { width: 13px; height: 13px; }
.badge.vip { background: linear-gradient(135deg, var(--vip), var(--vip-2)); color: #fff; }
.badge.open { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.badge.closed { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.badge.fuel { background: color-mix(in srgb, var(--fuel) 14%, transparent); color: var(--fuel); }
.more-btn { margin: 10px auto 0; display: block; }
.ya-note { margin: 8px 4px 0; font-size: 12px; color: var(--ink-3); display: flex; gap: 6px; align-items: flex-start; }
.ya-note .ic { width: 15px; height: 15px; margin-top: 1px; }

/* ------------------------------------------------------------ карточка */

.card { display: flex; flex-direction: column; gap: 14px; padding-top: 2px; }
.card-top { display: flex; align-items: center; gap: 8px; }
.card-top .icon-btn { width: 36px; height: 36px; }
.card-top .spacer { flex: 1; }
.card-photo {
  width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r-l); overflow: hidden; background: var(--surface-2);
  box-shadow: var(--shadow-1);
}
.card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card h2 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -.015em; }
.card-sub { color: var(--ink-2); margin-top: 4px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.act {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px 9px; border-radius: var(--r-m);
  background: var(--surface-2); border: 0; color: var(--accent); font-size: 12.5px; font-weight: 650; text-align: center;
  transition: background .15s, transform .1s;
}
.act:hover { background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); }
.act:active { transform: scale(.97); }
.act.primary { background: var(--accent); color: var(--accent-ink); }
.act.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.act[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.info { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.info-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-top: 1px solid var(--line); }
.info-row:first-child { border-top: 0; }
.info-row > .ic { color: var(--ink-3); margin-top: 1px; }
.info-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.info-main small { color: var(--ink-3); font-size: 12.5px; }
.info-row .mini-btn { margin: -6px -6px -6px 0; }
.mini-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 0; background: none; color: var(--ink-3);
  display: grid; place-items: center; flex: none;
}
.mini-btn:hover { background: var(--surface-2); color: var(--ink); }
.week { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; font-size: 13.5px; color: var(--ink-2); }
.week .today { color: var(--ink); font-weight: 650; }
.phones a { display: block; font-weight: 600; font-size: 15.5px; }
.note { white-space: pre-line; color: var(--ink-2); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: 12.5px; color: var(--ink-2); }
.attrib { font-size: 12px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; }
.attrib .ic { width: 15px; height: 15px; }
.route-menu { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.route-menu a {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: var(--r-m);
  background: var(--surface-2); font-size: 12.5px; font-weight: 650; text-align: center;
}

/* ------------------------------------------------------------ кнопки, формы */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: 13px; border: 1px solid transparent; font-weight: 650; background: var(--accent); color: var(--accent-ink);
  transition: background .15s, transform .1s, opacity .15s;
}
.btn:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn.secondary { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--surface-3); }
.btn.block { width: 100%; }
.btn .ic { width: 18px; height: 18px; }

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 11px 13px;
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
}
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 13px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: block; text-align: center; padding: 8px 4px; border-radius: 10px; font-size: 13.5px; font-weight: 650; color: var(--ink-2); cursor: pointer; }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { font-size: 13.5px; color: var(--bad); }

/* ------------------------------------------------------------ разделы */

.view-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 4px 12px; }
.view-head h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.view-lead { margin: -4px 4px 14px; color: var(--ink-2); font-size: 14px; }

.cat-list { display: flex; flex-direction: column; gap: 10px; }
.cat { border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); overflow: hidden; }
.cat-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; border: 0; background: none; text-align: left; }
.cat-logo {
  width: 64px; height: 44px; border-radius: 10px; background: #fff; display: grid; place-items: center; overflow: hidden;
  flex: none; border: 1px solid var(--line);
}
.cat-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cat-logo b { color: var(--accent); font-size: 18px; }
.cat-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cat-name b { font-size: 15px; }
.cat-name small { color: var(--ink-3); font-size: 12.5px; }
.cat-head .ic { color: var(--ink-3); transition: transform .2s; }
.cat.is-open .cat-head .ic.chev { transform: rotate(180deg); }
.files { display: none; border-top: 1px solid var(--line); padding: 6px; }
.cat.is-open .files { display: block; }
.file { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 11px; color: var(--ink); }
.file:hover { background: var(--surface-2); }
.file .ic { color: var(--accent); }
.file span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.file small { color: var(--ink-3); white-space: nowrap; }

.banners { display: grid; grid-template-columns: 1fr; gap: 12px; }
.banner { display: block; border-radius: var(--r-l); overflow: hidden; box-shadow: var(--shadow-1); background: var(--surface-2); transition: transform .15s, box-shadow .15s; }
.banner:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.banner img { width: 100%; display: block; }
.banner-cap { padding: 10px 14px; font-weight: 650; background: var(--surface); }
.panel-banner { margin: 2px 0 10px; }

.contacts { display: flex; flex-direction: column; gap: 8px; }
.contact {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-m); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.contact:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); box-shadow: var(--shadow-1); }
.contact-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); flex: none; }
.contact-ic.telegram { background: #e7f4fd; color: #229ed9; }
.contact-ic.whatsapp { background: #e6f9ee; color: #1faa53; }
.contact div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.contact small { color: var(--ink-3); }

.empty { text-align: center; padding: 34px 18px; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty > .ic { width: 46px; height: 46px; color: var(--ink-3); padding: 10px; border-radius: 16px; background: var(--surface-2); box-sizing: content-box; }
.empty b { color: var(--ink); font-size: 16px; }
.empty p { margin: 0; font-size: 14px; max-width: 320px; }
.done { text-align: center; padding: 30px 10px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.done > .ic { width: 56px; height: 56px; color: #fff; background: var(--ok); border-radius: 50%; padding: 12px; box-sizing: content-box; }

.skeleton { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; }
.skeleton i {
  display: block; height: 68px; border-radius: var(--r-m);
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%; animation: shimmer 1.2s infinite linear;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ------------------------------------------------------------ карта: кнопки, метки */

.map-top { display: none; }
.map-ctrls { position: absolute; right: 16px; bottom: 34px; display: flex; flex-direction: column; gap: 8px; z-index: 10; }
.map-ctrls .grp { display: flex; flex-direction: column; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-2); overflow: hidden; }
.map-ctrls button { width: 44px; height: 44px; border: 0; background: var(--surface); color: var(--ink); display: grid; place-items: center; }
.map-ctrls .grp button + button { border-top: 1px solid var(--line); }
.map-ctrls button:hover { background: var(--surface-2); }
.map-ctrls .solo { border-radius: 14px; box-shadow: var(--shadow-2); }
.map-ctrls .solo.is-on { color: var(--accent); }
.map-note {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 9; background: var(--surface);
  color: var(--ink-2); font-size: 12.5px; padding: 7px 12px; border-radius: 999px; box-shadow: var(--shadow-2); white-space: nowrap;
}

.mk { position: absolute; width: 0; height: 0; cursor: pointer; }
.mk-pin {
  position: absolute; left: 0; top: 0; width: 30px; height: 30px; transform: translate(-50%, -50%);
  border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff;
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(15, 23, 42, .3), 0 0 0 1px rgba(15, 23, 42, .08);
  transition: transform .16s cubic-bezier(.2, .8, .2, 1), box-shadow .16s;
}
.mk-pin .ic { width: 16px; height: 16px; }
.mk-pin .ic svg { stroke-width: 2; }
.mk:hover .mk-pin { transform: translate(-50%, -50%) scale(1.12); }
.mk-fuel .mk-pin { background: var(--fuel); }
.mk-ya .mk-pin { width: 22px; height: 22px; background: #fff; color: var(--ya); border: 2px solid var(--ya); }
.mk-ya .mk-pin .ic { width: 12px; height: 12px; }
.mk-vip .mk-pin { width: 42px; height: 42px; background: linear-gradient(135deg, var(--vip), var(--vip-2)); border-width: 3px; }
.mk-vip .mk-pin .ic { width: 20px; height: 20px; }
.mk.is-active .mk-pin {
  transform: translate(-50%, -50%) scale(1.3);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 30%, transparent), 0 6px 14px rgba(15, 23, 42, .35);
}
.mk-label {
  position: absolute; left: 0; top: 18px; transform: translateX(-50%); display: none; pointer-events: none;
  font: 650 11.5px/1.25 var(--font); color: var(--ink); background: color-mix(in srgb, var(--surface) 94%, transparent);
  padding: 2px 7px; border-radius: 7px; white-space: nowrap; max-width: 170px; overflow: hidden; text-overflow: ellipsis;
  box-shadow: var(--shadow-1);
}
.mk-vip .mk-label { top: 25px; display: block; }
.show-labels .mk-label, .mk.is-active .mk-label { display: block; }
.mk-cl {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font: 800 13px/1 var(--font); cursor: pointer; border: 2px solid #fff;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent), 0 4px 12px rgba(15, 23, 42, .25);
  transition: transform .16s;
}
.mk-cl:hover { transform: translate(-50%, -50%) scale(1.08); }
.mk-cl.fuel { background: var(--fuel); box-shadow: 0 0 0 6px color-mix(in srgb, var(--fuel) 22%, transparent), 0 4px 12px rgba(15, 23, 42, .25); }
.mk-cl.ya { background: var(--ya); box-shadow: 0 0 0 6px color-mix(in srgb, var(--ya) 22%, transparent), 0 4px 12px rgba(15, 23, 42, .25); }
.mk-me { position: absolute; width: 18px; height: 18px; transform: translate(-50%, -50%); border-radius: 50%; background: #1a73e8; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.mk-me::after { content: ""; position: absolute; inset: -12px; border-radius: 50%; background: rgba(26, 115, 232, .22); animation: pulse 2s infinite; }
@keyframes pulse { 0% { transform: scale(.5); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
.mk-found { position: absolute; transform: translate(-50%, -100%); color: var(--bad); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3)); }
.mk-found .ic { width: 34px; height: 34px; }
.mk-found .ic svg { fill: var(--bad); stroke: #fff; stroke-width: 1.5; }
.lf-mk { background: none; border: 0; }
.leaflet-dark .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9) saturate(.6); }
.leaflet-container { font: inherit; background: var(--surface-3); }

/* ------------------------------------------------------------ мобильная раскладка */

.bottom-nav { display: none; }
.page { display: none; }

@media (max-width: 899px) {
  .panel {
    position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b)); width: auto;
    height: calc(100dvh - var(--nav-h) - var(--safe-b) - 64px - var(--safe-t)); border-right: 0;
    border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: 0 -8px 30px rgba(15, 23, 42, .16);
    transform: translateY(var(--sheet-y, 70%)); will-change: transform; z-index: 30;
  }
  .panel.anim { transition: transform .32s cubic-bezier(.2, .85, .25, 1); }
  .panel-head, .tabs, .panel .search-slot { display: none; }
  .sheet-grab { display: flex; justify-content: center; padding: 9px 0 7px; cursor: grab; touch-action: none; flex: none; }
  .sheet-grab span { width: 42px; height: 5px; border-radius: 5px; background: var(--surface-3); }
  .panel-body { padding: 0 12px calc(24px + var(--safe-b)); }
  .panel:not(.is-full) .panel-body { overflow: hidden; }

  .map-top {
    display: flex; flex-direction: column; gap: 8px; position: absolute; left: 10px; right: 10px;
    top: calc(10px + var(--safe-t)); z-index: 15;
  }
  .map-top .search-box input { background: var(--surface); box-shadow: var(--shadow-2); border-color: transparent; height: 48px; border-radius: 16px; }
  .map-top .chip { box-shadow: var(--shadow-1); border-color: transparent; }
  .top-banner { border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-2); position: relative; }
  .top-banner img { width: 100%; display: block; max-height: 90px; object-fit: cover; }
  .top-banner .x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .45); color: #fff; display: grid; place-items: center; }
  .top-banner .x .ic { width: 14px; height: 14px; }

  .map-ctrls { right: 10px; bottom: calc(var(--nav-h) + var(--safe-b) + var(--peek, 150px) + 12px); transition: opacity .2s; }
  .map-ctrls .zoom { display: none; }
  .sheet-high .map-ctrls { opacity: 0; pointer-events: none; }
  .map-note { top: auto; bottom: calc(var(--nav-h) + var(--safe-b) + var(--peek, 150px) + 12px); }

  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: var(--surface);
    border-top: 1px solid var(--line);
  }
  .bottom-nav button {
    border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--ink-3); font-size: 11px; font-weight: 650;
  }
  .bottom-nav button .ic { width: 23px; height: 23px; }
  .bottom-nav button.is-on { color: var(--accent); }

  .page {
    display: flex; flex-direction: column; position: fixed; left: 0; right: 0; top: 0; bottom: calc(var(--nav-h) + var(--safe-b));
    background: var(--bg); z-index: 35; animation: pageIn .26s cubic-bezier(.2, .85, .25, 1);
  }
  .page[hidden] { display: none !important; }
  .page-head {
    display: flex; align-items: center; justify-content: space-between; padding: calc(12px + var(--safe-t)) 14px 10px 18px;
    background: var(--surface); border-bottom: 1px solid var(--line);
  }
  .page-head h2 { margin: 0; font-size: 20px; }
  .page-body { flex: 1; overflow-y: auto; padding: 16px 14px 28px; overscroll-behavior: contain; }
  @keyframes pageIn { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
}

@media (min-width: 1600px) {
  :root { --panel-w: 440px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 20px); transform: translate(-50%, 20px);
  background: #111827; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 100;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { .toast { bottom: 28px; } }

.cookie {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + var(--safe-b) + 12px); z-index: 90; max-width: 460px;
  margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow-3);
  padding: 12px 14px; display: flex; gap: 12px; align-items: center; font-size: 13px; color: var(--ink-2);
}
@media (min-width: 900px) { .cookie { bottom: 20px; left: auto; right: 20px; } }

/* ------------------------------------------------------------ кабинет, вход, формы кабинета */

.tabs { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 899px) {
  .bottom-nav { grid-template-columns: repeat(6, 1fr); }
  .bottom-nav button { font-size: 10.5px; gap: 2px; }
}
.icon-btn { position: relative; }
.icon-btn.is-on { color: var(--accent); }
.icon-btn .dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); border: 2px solid var(--surface); box-sizing: content-box; }
.badge.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.badge.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.badge.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.badge.muted { color: var(--ink-3); }
.row-title .ic.ok { width: 15px; height: 15px; color: var(--ok); flex: none; overflow: visible; }
.mk-verified .mk-pin::after { content: ""; position: absolute; right: -4px; top: -4px; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); border: 2px solid #fff; box-sizing: border-box; }
.heart.is-on { color: var(--bad); }
.heart.is-on .ic svg { fill: var(--bad); }
.hint { font-size: 12.5px; color: var(--ink-3); margin: 0; }
.field > small.hint { font-weight: 400; margin-top: -2px; }
.field input[type=checkbox], .field input[type=radio] { width: auto; padding: 0; border: 0; box-shadow: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .grid2 { grid-template-columns: 1fr; } }
.seg.two { grid-template-columns: 1fr 1fr; }
.chk { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); }
.chk input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.week-ed { display: grid; grid-template-columns: 30px auto 1fr 1fr; gap: 6px 8px; align-items: center; }
.week-ed b { font-size: 13.5px; }
.week-ed .chk { align-items: center; font-size: 13px; }
.week-ed input[type=time] { min-width: 0; width: 100%; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 7px 8px; }
.week-ed input[type=time]:disabled { opacity: .45; }
.phones-ed { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.phone-row { display: flex; gap: 6px; align-items: center; width: 100%; }
.phone-row input { flex: 1; min-width: 0; }
.addr-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.addr-row input { flex: 1; min-width: 140px; }
.picker-wrap { display: flex; flex-direction: column; gap: 8px; }
.picker { display: flex; flex-direction: column; gap: 6px; }
.pick-map { height: 240px; border-radius: var(--r-m); overflow: hidden; position: relative; border: 1px solid var(--line); background: var(--surface-3); }
.pick-map .map { position: absolute; inset: 0; }
.img-ed { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.img-ed img { width: 120px; height: 80px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); }
.empty-img { width: 120px; height: 80px; border-radius: 10px; border: 1px dashed var(--line); display: grid; place-items: center; color: var(--ink-3); font-size: 12px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btn.small { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.danger { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); border-color: transparent; }
.login-box { display: flex; flex-direction: column; gap: 10px; }
.login-box input.code { font-size: 22px; letter-spacing: .3em; text-align: center; }
.dev-code { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); padding: 8px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 650; }
.acc { display: flex; flex-direction: column; gap: 12px; }
.acc-sub-head { display: flex; align-items: center; gap: 8px; margin: 2px 0 2px; }
.acc-sub-head h2 { margin: 0; font-size: 19px; letter-spacing: -.01em; }
.acc-sub-head .icon-btn { width: 36px; height: 36px; }
.acc-card { border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.acc-card h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.acc-card h3 .ic { color: var(--ink-3); width: 18px; height: 18px; }
.acc-user { flex-direction: row; align-items: center; }
.acc-ava { width: 46px; height: 46px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); display: grid; place-items: center; flex: none; }
.acc-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.acc-who b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-who small { color: var(--ink-3); }
.acc-kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 13.5px; }
.acc-kv span:nth-child(odd) { color: var(--ink-3); }
.acc-list { display: flex; flex-direction: column; gap: 6px; }
.acc-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--surface-2); width: 100%; text-align: left; color: var(--ink); font: inherit; }
button.acc-item:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.acc-item > .ic { color: var(--ink-3); }
.acc-item .main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.acc-item .main b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-item .main small { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.members { display: flex; flex-direction: column; gap: 6px; }
.member { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 11px; background: var(--surface-2); }
.member > .ic { color: var(--ink-3); }
.member .main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.member small { color: var(--ink-3); font-size: 12.5px; }
.add-member { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: center; }
.add-member input, .add-member select { border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.notif { display: flex; flex-direction: column; gap: 6px; }
.notif-item { padding: 10px 12px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
.notif-item.is-new { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.notif-item b { font-size: 14px; }
.notif-item small { color: var(--ink-3); }
.claim { display: flex; flex-direction: column; gap: 8px; }
.claim-note { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--ink-2); padding: 10px 12px; border-radius: var(--r-m); background: var(--surface-2); }
.claim-note .ic { color: var(--warn); flex: none; }
@media (max-width: 420px) { .add-member { grid-template-columns: 1fr; } }
.verif-box { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: var(--r-m); background: var(--surface-2); }
.verif-box .hint { margin: 0; }
.docs { display: flex; flex-direction: column; gap: 12px; }
.doc-kind { display: flex; flex-direction: column; gap: 6px; }
.doc-kind-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.doc-kind-head b { font-size: 13.5px; }
.acc-card .check { font-size: 13.5px; }

/* ------------------------------------------------------------ слой "Монтажи" (jobs.js) */

:root { --job: #e8711a; }
.chip.chip-job.is-on { background: var(--job); border-color: var(--job); color: #fff; }
.mk-job .mk-pin { background: var(--job); }
.mk-job.mk-own .mk-pin { box-shadow: 0 0 0 3px color-mix(in srgb, var(--job) 35%, transparent), 0 2px 6px rgba(15, 23, 42, .3); }
.mk-cl.job { background: var(--job); box-shadow: 0 0 0 6px color-mix(in srgb, var(--job) 22%, transparent), 0 4px 12px rgba(15, 23, 42, .25); }
.row-ic.job { background: color-mix(in srgb, var(--job) 14%, var(--surface)); color: var(--job); }
.row-ic.job.own { box-shadow: inset 0 0 0 2px var(--job); }
.row-title .badge { font-size: 11px; padding: 1px 7px; }
.job-filter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 8px; }
.job-filter select { min-width: 0; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 7px 8px; font: inherit; font-size: 13px; color: var(--ink); }
.list-hint { padding: 4px 2px 10px; }
.job-card .card-sub .ic { width: 14px; height: 14px; color: var(--ok); vertical-align: -2px; margin-left: 4px; }
.job-card .info-main .ic.ok { width: 14px; height: 14px; color: var(--ok); vertical-align: -2px; margin-left: 4px; }
.job-items { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.job-items th, .job-items td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.job-items th { font-size: 12px; color: var(--ink-3); font-weight: 650; }
.job-items td:not(:first-child), .job-items th:not(:first-child) { text-align: right; white-space: nowrap; }
.job-actions { display: flex; flex-direction: column; gap: 10px; }
.resp { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: var(--r-m); background: var(--surface-2); font-size: 13.5px; }
.resp-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.resp p { margin: 0; white-space: pre-wrap; }
.resp .reply { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-left: 3px solid var(--line); border-radius: 0 var(--r-m) var(--r-m) 0; background: var(--surface); }
.resp .reply small { color: var(--ink-3); }
.resp .claim-note { background: var(--surface); }
.resp-form { padding: 12px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--surface); }
.items-ed { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.item-row { display: grid; grid-template-columns: 1fr 64px 52px 80px auto; gap: 4px; width: 100%; align-items: center; }
.item-row input { min-width: 0; width: 100%; }
@media (max-width: 420px) { .item-row { grid-template-columns: 1fr 56px 44px 70px auto; } }
.info-main .files, .info-main .week { margin-top: 4px; }
.acc-sub { font-size: 13px; color: var(--ink-2); }
.docs .row-btns select { border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 7px 8px; font: inherit; font-size: 13px; color: var(--ink); }

/* ------------------------------------------------------------ слой "Монтажники" (installers.js) */

:root { --inst: #7c5cff; }
.chip.chip-inst.is-on { background: var(--inst); border-color: var(--inst); color: #fff; }
.mk-inst .mk-pin { background: var(--inst); }
.mk-inst.mk-busy .mk-pin { background: color-mix(in srgb, var(--inst) 45%, var(--surface-3)); }
.mk-cl.inst { background: var(--inst); box-shadow: 0 0 0 6px color-mix(in srgb, var(--inst) 22%, transparent), 0 4px 12px rgba(15, 23, 42, .25); }
.row-ic.inst { background: color-mix(in srgb, var(--inst) 14%, var(--surface)); color: var(--inst); }
.row-ic.inst.busy { opacity: .6; }
.inst-filter { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin: 0 0 8px; align-items: center; }
.inst-filter select { min-width: 0; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 7px 8px; font: inherit; font-size: 13px; color: var(--ink); }
.inst-filter .chk { font-size: 13px; align-items: center; }
.inst-card .info-main .tags { margin-top: 4px; }

/* ------------------------------------------------------------ слои "Замеры" и "Замерщики" (jobs.js, installers.js) */

:root { --meas: #0891b2; }
.chip.chip-meas.is-on, .chip.chip-msr.is-on { background: var(--meas); border-color: var(--meas); color: #fff; }
.mk-meas .mk-pin, .mk-msr .mk-pin { background: var(--meas); }
.mk-meas.mk-own .mk-pin { box-shadow: 0 0 0 3px color-mix(in srgb, var(--meas) 35%, transparent), 0 2px 6px rgba(15, 23, 42, .3); }
.mk-msr.mk-busy .mk-pin { background: color-mix(in srgb, var(--meas) 45%, var(--surface-3)); }
.mk-cl.meas, .mk-cl.msr { background: var(--meas); box-shadow: 0 0 0 6px color-mix(in srgb, var(--meas) 22%, transparent), 0 4px 12px rgba(15, 23, 42, .25); }
.row-ic.meas, .row-ic.msr { background: color-mix(in srgb, var(--meas) 14%, var(--surface)); color: var(--meas); }
.row-ic.meas.own { box-shadow: inset 0 0 0 2px var(--meas); }
.row-ic.msr.busy { opacity: .6; }
.roles { display: flex; flex-direction: column; gap: 6px; }

/* ------------------------------------------------------------ отзывы и рейтинг (этап 4) */

.stars { display: inline-flex; gap: 1px; align-items: center; }
.stars .ic { width: 14px; height: 14px; color: var(--ink-3); }
.stars .ic.on { color: var(--vip); }
.stars .ic.on svg { fill: var(--vip); }
.rate { display: inline-flex; align-items: center; gap: 3px; color: var(--vip); font-weight: 650; font-size: 12.5px; margin-left: 6px; }
.rate .ic { width: 13px; height: 13px; }
.rate .ic svg { fill: var(--vip); }
.row-meta .rate { margin-left: 0; }
.star-pick { display: flex; gap: 6px; }
.star-pick button {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-3);
  display: grid; place-items: center; cursor: pointer;
}
.star-pick button .ic { width: 20px; height: 20px; }
.star-pick button.on { color: var(--vip); border-color: var(--vip); background: color-mix(in srgb, var(--vip) 12%, var(--surface)); }
.star-pick button.on .ic svg { fill: var(--vip); }
.acc-item .badges { flex: none; justify-content: flex-end; }
