/* «Карта города» — мобильный в первую очередь, в духе MAX UI: белые карточки, скругления 12–16, синий акцент */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f2f3f5;
  --text: #17181c;
  --muted: #6b7079;
  --line: rgba(0, 0, 0, .08);
  --accent: #2d7ff9;
  --accent-text: #ffffff;
  --shadow: 0 4px 18px rgba(0, 0, 0, .12);
  --ok: #22a35a;
  --warn: #f28c1a;
  --bad: #e5322d;
  --radius: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17181c; --surface: #22242a; --surface-2: #2c2f36; --text: #f1f2f4; --muted: #9aa0aa;
    --line: rgba(255, 255, 255, .08); --shadow: 0 4px 18px rgba(0, 0, 0, .5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17181c; --surface: #22242a; --surface-2: #2c2f36; --text: #f1f2f4; --muted: #9aa0aa;
  --line: rgba(255, 255, 255, .08); --shadow: 0 4px 18px rgba(0, 0, 0, .5); color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font: 15px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
button, input { font: inherit; color: inherit; }
a { color: var(--accent); }
#map { position: fixed; inset: 0; }

.top { position: fixed; left: 0; right: 0; top: 0; padding: calc(10px + var(--safe-top)) 12px 0; z-index: 5;
  pointer-events: none; display: flex; flex-direction: column; gap: 8px; }
.top > * { pointer-events: auto; }
.row { display: flex; gap: 8px; align-items: center; }

.seg { flex: 1; display: flex; background: var(--surface-2); border-radius: 12px; padding: 3px; box-shadow: var(--shadow); }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 0; border-radius: 10px; font-weight: 600; color: var(--muted); }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.12); }

.icon-btn { width: 42px; height: 42px; border: 0; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow);
  display: grid; place-items: center; color: var(--text); }

.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 12px; padding: 4px 4px 4px 12px;
  box-shadow: var(--shadow); color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 8px 0; color: var(--text); font-size: 16px; }
.search .go { border: 0; background: var(--accent); color: var(--accent-text); border-radius: 9px; padding: 8px 12px; font-weight: 600; }

.status { background: var(--surface); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); white-space: pre-line; }
.status .msg { font-weight: 600; }
.status .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.status .actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

.btn { border: 0; border-radius: 10px; padding: 9px 12px; font-weight: 600; background: var(--accent); color: var(--accent-text); text-decoration: none; display: inline-block; }
.btn.ghost { background: var(--surface-2); color: var(--text); }

.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; margin: 0 -12px; padding-left: 12px; padding-right: 12px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 6px 11px;
  background: var(--surface); box-shadow: var(--shadow); font-size: 13px; font-weight: 600; color: var(--text); }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.chip .dot.line { border-radius: 2px; height: 4px; width: 14px; }
.chip .n { color: var(--muted); font-weight: 500; }
.chip[aria-pressed="false"] { opacity: .5; }
.chip[aria-pressed="false"] .dot { background: transparent; box-shadow: inset 0 0 0 2px var(--c); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--safe-bottom)); z-index: 7;
  background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 10px; font-size: 13px; max-width: calc(100% - 32px); }

.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--surface); color: var(--text);
  border-radius: 16px 16px 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,.18); max-height: 72vh; display: flex; flex-direction: column;
  transform: translateY(105%); transition: transform .22s ease; padding-bottom: var(--safe-bottom); }
.sheet.open { transform: none; }
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 2px; flex: none; }
.close { position: absolute; right: 8px; top: 6px; border: 0; background: transparent; font-size: 26px; color: var(--muted); width: 40px; height: 40px; }
.sheet-body { overflow-y: auto; padding: 6px 16px 16px; -webkit-overflow-scrolling: touch; }
.sheet h2 { font-size: 18px; margin: 4px 36px 6px 0; line-height: 1.25; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--c); }
.tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.kv { margin: 10px 0; display: grid; grid-template-columns: 82px 1fr; gap: 6px 10px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.addr { margin: 8px 0 0; padding: 0; list-style: none; font-size: 14px; }
.addr li { padding: 6px 0; border-top: 1px solid var(--line); }
.more { color: var(--muted); font-size: 13px; padding-top: 6px; }
.links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.list-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 0; border-top: 1px solid var(--line); }
.list-item .t { font-weight: 600; }
.list-item .s { color: var(--muted); font-size: 13px; }
.list-item .nomap { font-size: 12px; color: var(--muted); }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 13px; margin: 6px 0 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--c); display: inline-block; }
.empty { color: var(--muted); padding: 12px 0; }

.maplibregl-ctrl-attrib { font-size: 10px; }
.maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left { bottom: var(--safe-bottom); }
.me-marker { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(45,127,249,.25); }
