/* Общие стили: мобильный экран в первую очередь, крупные цели для пальцев, высокий контраст на улице. */
:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #12161f;
  --muted: #5d6675;
  --line: #e2e5ea;
  --accent: #ffc400;        /* сигнальный жёлтый — как маячок эвакуатора */
  --accent-ink: #1a1400;
  --dark: #12161f;
  --good: #128a4f;
  --good-bg: #e5f6ec;
  --bad: #c62828;
  --bad-bg: #fdecec;
  --info-bg: #fff7d6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 22, 31, .06), 0 4px 16px rgba(16, 22, 31, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1117; --card: #171b23; --ink: #eef1f6; --muted: #9aa3b2; --line: #2a303b;
    --good-bg: #10301f; --bad-bg: #3a1616; --info-bg: #2e2810; --dark: #eef1f6;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px 40px; }

/* шапка */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; max-width: 560px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.01em; text-decoration: none; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 18px;
}
.city { color: var(--muted); font-size: 14px; }

h1 { font-size: 28px; line-height: 1.15; margin: 8px 0 6px; letter-spacing: -.02em; }
h2 { font-size: 20px; margin: 0 0 10px; }
.lead { color: var(--muted); margin: 0 0 18px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin: 12px 0;
}
.card.flat { box-shadow: none; border: 1px solid var(--line); }

/* поля */
label.f { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
input[type=text], input[type=tel], input[type=number], input[type=password], input[type=date], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--card);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 14px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--ink); }
textarea { min-height: 72px; resize: vertical; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 9px 14px; font: inherit; font-size: 15px; cursor: pointer;
}
.chip.on { background: var(--dark); border-color: var(--dark); color: var(--bg); }

.check { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; font-size: 14px; color: var(--muted); }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--dark); }

/* кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; border: 0; border-radius: 12px; cursor: pointer;
  padding: 15px 18px; min-height: 52px; text-decoration: none;
  background: var(--card); color: var(--ink); border: 1.5px solid var(--line);
}
.btn.block { width: 100%; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-size: 17px; }
.btn.dark { background: var(--dark); color: var(--bg); border-color: var(--dark); }
.btn.good { background: var(--good); color: #fff; border-color: var(--good); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 40px; padding: 8px 12px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* карта */
.map { height: 240px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--line); }
.map.tall { height: 300px; }
.locate { margin-top: 8px; }

/* уведомления */
.note { border-radius: 12px; padding: 12px 14px; margin: 12px 0; font-size: 15px; }
.note.info { background: var(--info-bg); }
.note.good { background: var(--good-bg); }
.note.bad { background: var(--bad-bg); color: var(--bad); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--dark); color: var(--bg); padding: 12px 18px; border-radius: 12px;
  max-width: calc(100% - 32px); z-index: 1000; box-shadow: var(--shadow); font-size: 15px;
}

/* поиск */
.pulse { display: flex; align-items: center; gap: 14px; }
.pulse .dot {
  width: 14px; height: 14px; border-radius: 50%; background: var(--accent); flex: none;
  box-shadow: 0 0 0 0 rgba(255, 196, 0, .7); animation: pulse 1.6s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 16px rgba(255, 196, 0, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 196, 0, 0); } }

/* предложения */
.offer { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.offer .price { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.offer .eta { font-weight: 700; text-align: right; }
.offer .who { color: var(--muted); font-size: 14px; grid-column: 1 / -1; }
.offer .btn { grid-column: 1 / -1; margin-top: 8px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--line); font-size: 13px; font-weight: 600; }
.badge.best { background: var(--accent); color: var(--accent-ink); }

/* шаги статуса */
.steps { display: flex; gap: 6px; margin: 14px 0 4px; }
.steps span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.steps span.on { background: var(--good); }
.steplabels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.plate { display: inline-block; border: 2px solid var(--ink); border-radius: 6px; padding: 1px 8px; font-weight: 800; letter-spacing: .04em; }

.stars { display: flex; gap: 6px; }
.stars button { font-size: 34px; background: none; border: 0; cursor: pointer; color: var(--line); padding: 0 2px; }
.stars button.on { color: var(--accent); }

.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }

/* водитель */
.tabs { display: flex; gap: 6px; background: var(--line); padding: 4px; border-radius: 12px; margin: 4px 0 8px; }
.tabs button { flex: 1; border: 0; background: none; font: inherit; font-weight: 600; padding: 10px; border-radius: 9px; color: var(--muted); cursor: pointer; }
.tabs button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.online {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); margin: 12px 0;
}
.online.on { background: var(--good); color: #fff; }
.online .title { font-size: 20px; font-weight: 800; }
.switch { position: relative; width: 64px; height: 36px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 18px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 28px; height: 28px; left: 4px; top: 4px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: #0b5c34; }
.switch input:checked + span::before { transform: translateX(28px); }

.order-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.order-head .dist { font-size: 22px; font-weight: 800; }
.route { margin: 8px 0; font-size: 15px; }
.route div { padding-left: 18px; position: relative; margin: 4px 0; }
.route div::before { content: ""; position: absolute; left: 3px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.route div.to::before { background: var(--accent); }
.quick { display: flex; gap: 6px; margin-top: 6px; }
.quick .chip { flex: 1; padding: 7px 0; font-size: 14px; white-space: nowrap; }

.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.totals div { background: var(--card); border-radius: 12px; padding: 12px; box-shadow: var(--shadow); }
.totals b { display: block; font-size: 20px; }
.list-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }

/* админка */
.admin { max-width: 1200px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tiles div { background: var(--card); border-radius: 12px; padding: 14px; box-shadow: var(--shadow); }
.tiles b { display: block; font-size: 26px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }
td.wrap { white-space: normal; min-width: 180px; }
.st { font-weight: 700; }
.st.new { color: #b26b00; } .st.active { color: var(--good); } .st.blocked { color: var(--bad); }

.hidden { display: none !important; }
footer { color: var(--muted); font-size: 13px; text-align: center; margin-top: 28px; }

/* ---- карта и подсказки адресов ---- */
.field { position: relative; }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 50;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  overflow: hidden; max-height: 320px; overflow-y: auto;
}
.suggest button {
  display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 14px;
  font: inherit; color: var(--ink); cursor: pointer; border-bottom: 1px solid var(--line);
}
.suggest button:last-child { border-bottom: 0; }
.suggest button:hover, .suggest button.on { background: var(--bg); }
.suggest b { display: block; font-weight: 600; font-size: 15px; }
.suggest span { display: block; color: var(--muted); font-size: 13px; }
.pin {
  --pin: #e53935; width: 34px; height: 42px; position: relative; cursor: grab;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.35));
}
.pin::before {
  content: ""; position: absolute; left: 3px; top: 0; width: 28px; height: 28px; background: var(--pin);
  border: 2px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-sizing: border-box;
}
.pin span { position: absolute; left: 0; right: 0; top: 4px; text-align: center; font-size: 15px; line-height: 20px; }
.pin.me::before { border-radius: 50%; transform: none; width: 22px; height: 22px; left: 6px; top: 10px; }
.pin.me span { display: none; }
.maplibregl-ctrl-attrib { font-size: 11px; }
.trip { display: flex; gap: 14px; align-items: center; margin-top: 8px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.trip b { color: var(--ink); }
.legend { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 18px; height: 4px; border-radius: 2px; display: inline-block; }
.map.small { height: 200px; }
.maplibregl-ctrl-attrib-inner { font-size: 10px; }
.maplibregl-ctrl-bottom-right .maplibregl-ctrl-attrib.maplibregl-compact { margin: 0 6px 6px 0; }
