:root {
  --bg: #ffffff;
  --text: #1c1c1e;
  --hint: #8e8e93;
  --card: #f2f2f7;
  --accent: #2481cc;
  --accent-text: #ffffff;
  --yes: #2e9e44;
  --no: #d83b3b;
  --border: rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

/* ─── Шапка ─── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 500;
}
.title { display: flex; align-items: center; gap: 10px; }
.logo { font-size: 26px; }
.topbar h1 { font-size: 17px; margin: 0; }
.status { margin: 2px 0 0; font-size: 12px; color: var(--hint); }
.icon-btn {
  border: none;
  background: var(--card);
  border-radius: 10px;
  font-size: 18px;
  width: 40px;
  height: 40px;
  cursor: pointer;
}

/* ─── Карта ─── */
#map {
  height: 38vh;
  min-height: 220px;
  width: 100%;
  z-index: 1;
}
.fuel-pin div {
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  border: 2px solid #fff;
}
.fuel-pin div::first-letter { transform: rotate(45deg); }

/* ─── Фильтры ─── */
.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.chip.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}
.toggle { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--hint); }

/* ─── Список ─── */
.list { flex: 1; padding: 4px 12px 24px; }
.empty { text-align: center; color: var(--hint); padding: 24px; }
.card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: none;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  color: var(--text);
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-title { font-weight: 600; font-size: 15px; }
.card-dist { color: var(--hint); font-size: 13px; white-space: nowrap; }
.card-addr { color: var(--hint); font-size: 12px; margin-top: 2px; }
.card-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.fc { font-size: 12px; padding: 3px 8px; border-radius: 10px; background: rgba(0,0,0,0.05); }
.fc-yes { background: rgba(46, 158, 68, 0.15); color: var(--yes); }
.fc-no { background: rgba(216, 59, 59, 0.12); color: var(--no); }
.fc-unknown { color: var(--hint); }

/* ─── Нижняя панель ─── */
.sheet { position: fixed; inset: 0; z-index: 1000; }
.sheet.hidden { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.4); }
.sheet-body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--bg);
  border-radius: 18px 18px 0 0;
  padding: 8px 18px calc(24px + env(safe-area-inset-bottom));
  max-height: 88vh;
  overflow-y: auto;
}
.sheet-handle { width: 40px; height: 4px; background: var(--hint); opacity: 0.4; border-radius: 2px; margin: 6px auto 10px; }
.sheet-close { position: absolute; top: 12px; right: 14px; border: none; background: var(--card); border-radius: 50%; width: 30px; height: 30px; font-size: 14px; cursor: pointer; color: var(--text); }
.sheet-body h2 { margin: 4px 0; font-size: 18px; padding-right: 36px; }
.sheet-body h3 { margin: 18px 0 8px; font-size: 14px; }
.muted { color: var(--hint); font-size: 13px; }

.statuses { display: flex; flex-direction: column; gap: 6px; }
.st { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--card); font-size: 13px; }
.st b { font-size: 13px; }
.st-yes { border-left: 3px solid var(--yes); }
.st-no { border-left: 3px solid var(--no); }
.st-unknown { border-left: 3px solid var(--hint); }

/* ─── Форма отчёта ─── */
.report-form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field .label { font-size: 13px; color: var(--hint); }
.field input {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
}
.btn {
  border: none;
  border-radius: 12px;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn:disabled { opacity: 0.6; }
.report-msg { text-align: center; font-size: 13px; min-height: 16px; margin: 0; }

/* ─── История ─── */
.history { display: flex; flex-direction: column; gap: 4px; }
.hrow { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--border); }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1e; --text: #f2f2f7; --hint: #8e8e93;
    --card: #2c2c2e; --border: rgba(255,255,255,0.1);
  }
}
