/* Топливо — мобильный интерфейс в первую очередь, на широком экране — карта + боковая панель */

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef1f4;
  --text: #0f172a;
  --muted: #5b6676;
  --line: #e2e7ed;
  --brand: #0f766e;
  --brand-ink: #ffffff;
  --shadow: 0 6px 24px rgba(15, 23, 42, .14);
  --radius: 16px;
  --top: 56px;
  --bar: 56px;

  --yes: #16a34a;      --yes-bg: #dcfce7;      --yes-fg: #166534;
  --maybe: #84cc16;    --maybe-bg: #ecfccb;    --maybe-fg: #3f6212;
  --low: #f59e0b;      --low-bg: #fef3c7;      --low-fg: #92400e;
  --mixed: #8b5cf6;    --mixed-bg: #ede9fe;    --mixed-fg: #5b21b6;
  --unlikely: #f97316; --unlikely-bg: #ffedd5; --unlikely-fg: #9a3412;
  --no: #ef4444;       --no-bg: #fee2e2;       --no-fg: #991b1b;
  --unknown: #94a3b8;  --unknown-bg: #eef1f4;  --unknown-fg: #5b6676;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220; --surface: #141c2e; --surface-2: #1c2640; --text: #e8edf6; --muted: #98a3b8; --line: #263250;
    --brand: #2dd4bf; --brand-ink: #062a27; --shadow: 0 6px 24px rgba(0, 0, 0, .5);
    --yes-bg: #12301f; --yes-fg: #86efac; --maybe-bg: #26330f; --maybe-fg: #bef264; --low-bg: #3a2a0a; --low-fg: #fcd34d;
    --mixed-bg: #2a1f4d; --mixed-fg: #c4b5fd; --unlikely-bg: #3a1f0e; --unlikely-fg: #fdba74; --no-bg: #3b1515; --no-fg: #fca5a5;
    --unknown-bg: #1c2640; --unknown-fg: #98a3b8;
  }
  .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9) saturate(.8); }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior: none;
}
button { font: inherit; color: inherit; }
button, [role=button] { cursor: pointer; }
[hidden] { display: none !important; }
.ic { width: 22px; height: 22px; fill: currentColor; flex: none; }
.ic.sm { width: 16px; height: 16px; }

/* ---------- каркас ---------- */
#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
.topbar {
  position: relative; z-index: 1200; display: flex; gap: 8px; align-items: center;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 6px; background: var(--bg);
}
.search {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px;
  background: var(--surface); border-radius: 14px; box-shadow: 0 1px 2px rgba(15, 23, 42, .08), inset 0 0 0 1px var(--line);
}
.search .ic { color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear { border: 0; background: var(--surface-2); color: var(--muted); width: 24px; height: 24px; border-radius: 50%; line-height: 22px; font-size: 18px; padding: 0; }
.icon-btn {
  width: 44px; height: 44px; border: 0; border-radius: 14px; display: grid; place-items: center; flex: none;
  background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(15, 23, 42, .08), inset 0 0 0 1px var(--line);
}
.icon-btn.on { background: var(--brand); color: var(--brand-ink); }

.suggest {
  position: absolute; left: 12px; right: 12px; top: calc(env(safe-area-inset-top) + 56px); z-index: 1300;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; max-height: 60vh; overflow-y: auto;
}
.suggest h4 { margin: 0; padding: 10px 14px 4px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.suggest button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 14px; border-top: 1px solid var(--line); }
.suggest button:first-of-type { border-top: 0; }
.suggest small { display: block; color: var(--muted); font-size: 13px; }
.suggest .empty { padding: 14px; color: var(--muted); }

.filterbar { display: flex; gap: 8px; align-items: center; padding: 2px 12px 8px; background: var(--bg); position: relative; z-index: 1100; }
.chips { display: flex; gap: 8px; overflow-x: auto; flex: 1; scrollbar-width: none; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 36px; padding: 0 14px; border-radius: 999px; border: 0; display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); color: var(--text); font-weight: 650; box-shadow: inset 0 0 0 1px var(--line); transition: background .15s, transform .1s;
}
.chip:active { transform: scale(.96); }
.chip.on { background: var(--brand); color: var(--brand-ink); box-shadow: none; }
.chip.ghost { background: transparent; }
.chip b { background: var(--brand); color: var(--brand-ink); min-width: 18px; height: 18px; border-radius: 9px; font-size: 12px; display: grid; place-items: center; padding: 0 5px; }

#main { position: relative; flex: 1; min-height: 0; }
.view { position: absolute; inset: 0; }
#view-map { z-index: 1; }
.panel {
  z-index: 5; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 16px;
}
.panel-head { padding: 6px 16px 10px; }
.panel-head h2 { margin: 0; font-size: 20px; }
.panel-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
#map { position: absolute; inset: 0; background: var(--surface-2); }
.map-status {
  position: absolute; left: 12px; top: 8px; z-index: 500; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface); color: var(--muted); box-shadow: var(--shadow); pointer-events: none;
}
.fab {
  position: absolute; right: 12px; bottom: 36px; z-index: 500; width: 48px; height: 48px;
  border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.fab.spin .ic { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.tabbar {
  position: relative; z-index: 1150; display: flex; height: calc(var(--bar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); box-shadow: 0 -1px 0 var(--line);
}
.tabbar button { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); }
.tabbar button { position: relative; }
.tabbar button.on { color: var(--brand); }
.tabbar button.on::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }

/* ---------- маркеры ---------- */
.s-yes { --c: var(--yes); } .s-maybe { --c: var(--maybe); } .s-low { --c: var(--low); } .s-mixed { --c: var(--mixed); }
.s-unlikely { --c: var(--unlikely); } .s-no { --c: var(--no); } .s-unknown { --c: var(--unknown); }
.pin {
  width: 34px; height: 34px; border-radius: 50% 50% 50% 8px; transform: rotate(-45deg); background: var(--c); border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35); display: grid; place-items: center;
}
.pin span { transform: rotate(45deg); font-size: 13px; font-weight: 800; color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .35); }
.pin.s-maybe span { color: #1a2e05; text-shadow: none; }
.pin.sel { outline: 3px solid var(--text); outline-offset: 1px; z-index: 900; }
.leaflet-container { font: inherit; background: var(--surface-2); }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #2563eb; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(37, 99, 235, .25); }

/* ---------- список ---------- */
.list { padding: 0 12px; display: grid; gap: 8px; }
.row {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left;
  border: 0; background: var(--surface); border-radius: var(--radius); padding: 12px; box-shadow: inset 0 0 0 1px var(--line);
}
.row:active { background: var(--surface-2); }
.badge {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 16px; color: #fff;
  background: var(--bc, #64748b); text-shadow: 0 1px 1px rgba(0, 0, 0, .25);
}
.badge.dark { color: #1f2937; text-shadow: none; }
.row-main { min-width: 0; display: grid; gap: 3px; }
.row-title { font-weight: 700; display: flex; gap: 6px; align-items: baseline; }
.row-title small { font-weight: 500; color: var(--muted); font-size: 13px; white-space: nowrap; }
.row-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-note { font-size: 12.5px; color: var(--unlikely-fg); font-weight: 600; }
.pills { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 8px; font-size: 12.5px; font-weight: 700;
  background: var(--unknown-bg); color: var(--unknown-fg);
}
.pill.s-yes { background: var(--yes-bg); color: var(--yes-fg); } .pill.s-maybe { background: var(--maybe-bg); color: var(--maybe-fg); }
.pill.s-low { background: var(--low-bg); color: var(--low-fg); } .pill.s-mixed { background: var(--mixed-bg); color: var(--mixed-fg); }
.pill.s-unlikely { background: var(--unlikely-bg); color: var(--unlikely-fg); } .pill.s-no { background: var(--no-bg); color: var(--no-fg); }
.pill.dim { opacity: .55; }
.row-side { display: grid; justify-items: end; gap: 6px; text-align: right; }
.ago { font-size: 12px; color: var(--muted); white-space: nowrap; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c, var(--unknown)); }
.empty-state { text-align: center; color: var(--muted); padding: 40px 24px; }
.empty-state b { display: block; color: var(--text); font-size: 17px; margin-bottom: 6px; }
.feed-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; }

/* ---------- карточка АЗС ---------- */
.sheet {
  position: absolute; z-index: 1400; left: 0; right: 0; bottom: 0; max-height: 82%; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgba(15, 23, 42, .28);
  animation: up .22s ease-out; padding-bottom: env(safe-area-inset-bottom);
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 8px auto 0; flex: none; }
.sheet-head { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px 16px 8px; flex: none; }
.sheet-head .badge { width: 44px; height: 44px; font-size: 18px; }
.sheet-head h3 { margin: 0; font-size: 18px; line-height: 1.2; }
.sheet-head p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.sheet-actions { display: flex; gap: 4px; }
.sheet-actions button { border: 0; background: var(--surface-2); width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.sheet-actions .fav.on { color: #e11d48; }
.sheet-body { overflow-y: auto; padding: 0 16px 16px; -webkit-overflow-scrolling: touch; }
.banner { margin: 6px 0 10px; padding: 10px 12px; border-radius: 12px; font-weight: 600; font-size: 14px; background: var(--no-bg); color: var(--no-fg); }
.banner.info { background: var(--low-bg); color: var(--low-fg); }
.frow { border-top: 1px solid var(--line); padding: 10px 0; }
.frow:first-of-type { border-top: 0; }
.fhead { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 0; text-align: left; }
.fhead b { font-size: 16px; min-width: 64px; }
.spill { padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--c, var(--unknown)); color: #fff; }
.spill.s-maybe { color: #1a2e05; }
.spill.s-unknown { background: var(--unknown-bg); color: var(--unknown-fg); }
.fhead .price { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.fhead .chev { color: var(--muted); transition: transform .15s; }
.frow.open .chev { transform: rotate(180deg); }
.fmeta { color: var(--muted); font-size: 13px; margin-top: 3px; }
.fsrc { display: none; margin-top: 8px; border-radius: 12px; background: var(--surface-2); padding: 4px 12px; }
.frow.open .fsrc { display: block; }
.srow { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.srow:first-child { border-top: 0; }
.srow b { font-weight: 700; }
.srow .st { font-weight: 700; color: var(--fg, var(--text)); }
.srow small { grid-column: 1 / -1; color: var(--muted); }
.sheet-section { margin-top: 14px; }
.sheet-section h4 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.hist { display: grid; gap: 4px; font-size: 13.5px; }
.hist div { display: flex; gap: 8px; }
.hist time { color: var(--muted); min-width: 92px; }
.btns { display: flex; gap: 8px; margin-top: 14px; }
.btn {
  flex: 1; height: 46px; border-radius: 14px; border: 0; font-weight: 700; display: inline-flex; gap: 8px; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text); text-decoration: none;
}
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.note { margin-top: 12px; font-size: 12px; color: var(--muted); }

/* ---------- модальные окна ---------- */
.modal { position: fixed; inset: 0; z-index: 2000; background: rgba(8, 12, 22, .55); display: flex; align-items: flex-end; justify-content: center; }
.dialog {
  width: 100%; max-width: 520px; max-height: 92%; overflow-y: auto; background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: up .2s ease-out;
}
.dialog { position: relative; }
.dialog > .sheet-grip { margin: -6px auto 10px; }
.dlg-x { position: absolute; right: 12px; top: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; padding: 0; }
.dialog h3 { margin: 0 0 4px; font-size: 21px; padding-right: 40px; letter-spacing: -.01em; }
.dialog .sub { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.dialog h5 { margin: 16px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { padding: 9px 14px; border-radius: 12px; border: 0; background: var(--surface-2); font-weight: 600; box-shadow: inset 0 0 0 1px transparent; }
.opt.on { background: var(--brand); color: var(--brand-ink); }
.opt.yes.on { background: var(--yes); color: #fff; } .opt.low.on { background: var(--low); color: #fff; } .opt.no.on { background: var(--no); color: #fff; }
.rrow { display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 10px; padding: 6px 0; }
.rrow b { font-size: 15px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg .opt { text-align: center; padding: 9px 4px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
/* переключатель */
.switch input {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 50px; height: 30px; margin: 0; border-radius: 15px;
  background: var(--line); transition: background .18s; cursor: pointer;
}
.switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .18s;
}
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(20px); }
.switch small { color: var(--muted); font-weight: 400; }
.dialog .btns { position: sticky; bottom: -18px; padding-top: 12px; background: linear-gradient(transparent, var(--surface) 30%); }
.src-list { display: grid; gap: 8px; margin-top: 8px; }
.src-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--surface-2); border-radius: 12px; font-size: 14px; }
.src-item span:last-child { color: var(--muted); }
.src-item.bad span:last-child { color: var(--no); font-weight: 700; }
.legal { font-size: 12.5px; color: var(--muted); margin-top: 14px; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--bar) + env(safe-area-inset-bottom) + 20px); transform: translateX(-50%); z-index: 3000; max-width: 90%;
  background: #0f172a; color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 600; font-size: 14px;
}

/* ---------- широкий экран: карта справа, панели слева ---------- */
@media (min-width: 900px) {
  :root { --side: 420px; }
  #app { display: grid; grid-template-columns: var(--side) 1fr; grid-template-rows: auto auto 1fr auto; grid-template-areas: "top map" "flt map" "main map" "tab map"; }
  .topbar { grid-area: top; } .filterbar { grid-area: flt; } .tabbar { grid-area: tab; position: relative; }
  #main { grid-area: main; display: block; }
  #view-map { position: fixed; left: var(--side); top: 0; right: 0; bottom: 0; }
  .panel { padding-bottom: 16px; }
  .tabbar button[data-view=map] { display: none; }
  .fab { bottom: 24px; }
  .sheet { left: 0; right: auto; width: var(--side); top: 0; bottom: 0; max-height: none; border-radius: 0; animation: none; }
  .modal { align-items: center; }
  .dialog { border-radius: 22px; max-height: 88%; }
  .suggest { left: 12px; right: auto; width: calc(var(--side) - 24px); }
  .toast { bottom: 24px; }
}

/* узкие экраны: «Фильтры» только значком, чтобы все марки помещались в строку */
@media (max-width: 460px) {
  #btnFilters span { display: none; }
  #btnFilters { padding: 0 11px; position: relative; }
  #btnFilters b { position: absolute; top: -3px; right: -3px; }
  .chip { padding: 0 13px; }
  .chips { gap: 6px; }
}


/* ---------- кластеры на карте ---------- */
.cluster {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff;
  border: 3px solid #fff; box-shadow: 0 2px 10px rgba(15, 23, 42, .35); font-weight: 800; font-size: 14px; text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
}
.cluster.s-maybe { color: #1a2e05; text-shadow: none; }
.cluster.s-unknown { color: #fff; }

/* ---------- карточка: итог и строки марок ---------- */
.hero { display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; padding: 12px 14px; border-radius: 16px; background: var(--hbg, var(--surface-2)); color: var(--hfg, var(--text)); }
.hero .big { font-size: 17px; font-weight: 800; line-height: 1.2; }
.hero .when { font-size: 13px; opacity: .85; margin-top: 2px; }
.hero .ring { width: 38px; height: 38px; border-radius: 50%; background: var(--c); flex: none; box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 25%, transparent); }
.hero.s-yes { --hbg: var(--yes-bg); --hfg: var(--yes-fg); } .hero.s-maybe { --hbg: var(--maybe-bg); --hfg: var(--maybe-fg); }
.hero.s-low { --hbg: var(--low-bg); --hfg: var(--low-fg); } .hero.s-mixed { --hbg: var(--mixed-bg); --hfg: var(--mixed-fg); }
.hero.s-unlikely { --hbg: var(--unlikely-bg); --hfg: var(--unlikely-fg); } .hero.s-no { --hbg: var(--no-bg); --hfg: var(--no-fg); }
.hero.s-unknown { --hbg: var(--unknown-bg); --hfg: var(--unknown-fg); }
.frow { border: 0; border-radius: 14px; padding: 11px 12px 11px 15px; margin-bottom: 8px; background: var(--surface-2); position: relative; overflow: hidden; }
.frow::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--unknown)); }
.frow.sel { background: color-mix(in srgb, var(--c, var(--unknown)) 12%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c, var(--unknown)) 40%, transparent); }
.frow:first-of-type { border-top: 0; }
.fsrc { background: var(--surface); }
.fhead .price { font-size: 15px; }

/* ---------- пустые состояния ---------- */
.empty-state .em { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 18px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.empty-state .em .ic { width: 28px; height: 28px; }

/* ---------- мелочи ---------- */
.row { transition: background .12s, transform .1s; }
.row:active { transform: scale(.992); }
.row-title { font-size: 15.5px; }
.sheet-head h3 { letter-spacing: -.01em; }
.opt { transition: background .15s; }
.link-more { display: block; width: 100%; margin-top: 14px; padding: 12px; border-radius: 14px; text-align: center; background: var(--surface-2); color: var(--brand); font-weight: 700; text-decoration: none; }

.fmeta .stale { color: var(--unlikely-fg); font-weight: 600; }

/* ---------- страница «Как это работает» ---------- */
body.doc { height: auto; min-height: 100%; overflow-y: auto; overscroll-behavior: auto; }
.doc-top { position: sticky; top: 0; z-index: 10; padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.doc-back { display: inline-flex; align-items: center; gap: 4px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--surface); color: var(--text); text-decoration: none; font-weight: 700; box-shadow: inset 0 0 0 1px var(--line); }
.doc-main { max-width: 720px; margin: 0 auto; padding: 4px 14px calc(40px + env(safe-area-inset-bottom)); display: grid; gap: 14px; }
.doc-hero { text-align: center; padding: 28px 20px 26px; border-radius: 24px; color: #fff; background: radial-gradient(120% 140% at 0% 0%, #14b8a6 0%, #0f766e 45%, #0f172a 100%); box-shadow: var(--shadow); }
.doc-hero img { border-radius: 16px; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.doc-hero h1 { margin: 12px 0 6px; font-size: 32px; letter-spacing: -.02em; }
.doc-hero p { margin: 0 auto 18px; max-width: 520px; font-size: 16px; opacity: .95; }
.doc-cta { display: inline-block; padding: 13px 26px; border-radius: 14px; background: #fff; color: #0f172a; font-weight: 800; text-decoration: none; }
.doc-card { background: var(--surface); border-radius: 20px; padding: 18px 18px 16px; box-shadow: inset 0 0 0 1px var(--line); }
.doc-card h2 { margin: 0 0 10px; font-size: 20px; letter-spacing: -.01em; }
.doc-card h3 { margin: 16px 0 6px; font-size: 15px; }
.doc-card p { margin: 0 0 10px; }
.doc-card .hint { margin: 12px 0 0; padding: 11px 13px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 14px; }
.doc-card.warn { background: var(--low-bg); box-shadow: none; }
.doc-card.warn h2, .doc-card.warn li { color: var(--low-fg); }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { counter-increment: s; position: relative; padding-left: 44px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 800; display: grid; place-items: center; }
.legend { display: grid; gap: 10px; }
.legend > div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: start; }
.legend .pill { justify-self: start; font-size: 13.5px; padding: 4px 11px; }
.legend p { margin: 0; color: var(--muted); font-size: 14.5px; }
.src { display: grid; gap: 10px; }
.src > div { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.src b { display: block; margin-bottom: 2px; }
.src p { margin: 0; color: var(--muted); font-size: 14.5px; }
.plain { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.doc-foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 6px 12px; }
@media (max-width: 460px) { .legend > div { grid-template-columns: 1fr; gap: 4px; } }
.fhead .price { white-space: nowrap; }
.fhead .spill { white-space: nowrap; }

/* ---------- ряд марок без прокрутки: пять равных кнопок, «Фильтры» только значком ---------- */
.filterbar .chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; overflow: visible; }
.filterbar .chip { padding: 0; justify-content: center; min-width: 0; }
#btnFilters { flex: none; width: 44px; height: 44px; padding: 0; justify-content: center; position: relative; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
#btnFilters span { display: none; }
#btnFilters .ic { width: 20px; height: 20px; }
#btnFilters b { position: absolute; top: -4px; right: -4px; box-shadow: 0 0 0 2px var(--bg); }

/* пятая вкладка — ссылка на страницу «Как это работает» */
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; }

/* ---------- страница состояния источников ---------- */
.st-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.st-sum > div { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; }
.st-sum b { display: block; font-size: 18px; }
.st-sum span { font-size: 12px; color: var(--muted); }
.st-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.st-kind { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.st-chip { padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.st-ok { background: var(--yes-bg); color: var(--yes-fg); } .st-slow { background: var(--low-bg); color: var(--low-fg); }
.st-down { background: var(--no-bg); color: var(--no-fg); } .st-off { background: var(--unknown-bg); color: var(--unknown-fg); }
.st-gives { margin: 8px 0 10px !important; color: var(--muted); font-size: 14px; }
.st-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.st-grid > div { background: var(--surface-2); border-radius: 12px; padding: 9px 12px; }
.st-grid span { display: block; font-size: 12px; color: var(--muted); }
.st-grid b { font-size: 15px; }
.st-bars { margin-top: 12px; display: grid; gap: 6px; }
.st-bar { display: grid; grid-template-columns: 64px 1fr 38px; gap: 8px; align-items: center; font-size: 13px; }
.st-bar span { color: var(--muted); }
.st-bar i { height: 8px; border-radius: 4px; background: var(--surface-2); position: relative; overflow: hidden; }
.st-bar i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--brand); border-radius: 4px; }
.st-bar b { text-align: right; font-variant-numeric: tabular-nums; }
.st-jobs { margin-top: 12px; font-size: 13px; }
.st-jobs summary { cursor: pointer; color: var(--brand); font-weight: 700; }
.st-jobs table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.st-jobs th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 4px 6px; }
.st-jobs td { padding: 6px; border-top: 1px solid var(--line); }
.st-jobs tr.late td { color: var(--low-fg); } .st-jobs tr.err td { color: var(--no-fg); font-size: 12px; }

/* ссылка «Сверить с Яндекс Картами» под таблицей марок */
.xlink { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 2px; padding: 11px 14px; border-radius: 14px; background: var(--surface-2); color: var(--text); text-decoration: none; }
.xlink b { display: block; color: var(--brand); font-size: 14.5px; }
.xlink small { color: var(--muted); font-size: 12.5px; }
.xlink .ic { color: var(--muted); }

/* логотип сети вместо буквы (если файл положен в assets/brands) */
.badge.logo { background: #fff; box-shadow: inset 0 0 0 1px var(--line); padding: 5px; }
.badge.logo img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* логотип сети внутри булавки на карте */
.pin .lg { transform: rotate(45deg); width: 22px; height: 22px; border-radius: 50%; background: #fff; display: grid; place-items: center; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
.pin .lg img { width: 18px; height: 18px; object-fit: contain; display: block; }
