* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f0f4f7;
  color: #1a1a1a;
}

header {
  background: #0a4d68;
  color: #fff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

header h1 { font-size: 18px; font-weight: 600; }

.badge {
  background: #e63946;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.hidden { display: none !important; }

#waterbody-nav {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  overflow-x: auto;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  scrollbar-width: none;
}
#waterbody-nav::-webkit-scrollbar { display: none; }

.wb-chip {
  flex-shrink: 0;
  padding: 6px 12px;
  border: 1px solid #0a4d68;
  background: #fff;
  color: #0a4d68;
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.wb-chip.active {
  background: #0a4d68;
  color: #fff;
}

#map {
  width: 100%;
  height: 42vh;
  background: #ddd;
}

.fab {
  position: fixed;
  bottom: 70px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #0a4d68;
  color: #fff;
  font-size: 28px;
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  cursor: pointer;
  z-index: 200;
}
.fab:active { transform: scale(0.95); }

#feed { padding: 16px; }

#feed h2 {
  font-size: 16px;
  margin-bottom: 12px;
  color: #0a4d68;
}

.report-card {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.report-card h3 {
  font-size: 15px;
  margin-bottom: 4px;
  color: #0a4d68;
}

.report-card .meta {
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
}

.report-card .note {
  font-size: 13px;
  color: #333;
  margin-top: 6px;
}

/* ========== Модалки ========== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 16px;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h2 {
  font-size: 18px;
  margin-bottom: 16px;
  color: #0a4d68;
}

.modal-content label {
  display: block;
  font-size: 13px;
  color: #444;
  margin-bottom: 10px;
}

.modal-content input,
.modal-content textarea,
.modal-content select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  margin-top: 4px;
  font-family: inherit;
  background: #fff;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.modal-actions button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

#cancel-btn {
  background: #e0e0e0;
  color: #333;
}

.modal-actions button[type="submit"] {
  background: #0a4d68;
  color: #fff;
}

.modal-content select optgroup {
  font-weight: 700;
  color: #0a4d68;
  background: #f0f4f7;
}

.modal-content select option {
  font-weight: 400;
  color: #1a1a1a;
  background: #fff;
  padding: 6px;
}

/* ========== Модалка списка отчётов по водоёму ========== */
.wb-reports-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.wb-reports-header h2 {
  margin-bottom: 0;
  font-size: 16px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #888;
  cursor: pointer;
  padding: 0 4px;
}

.close-btn:active { color: #0a4d68; }

.wb-reports-list {
  max-height: 60vh;
  overflow-y: auto;
}

.wb-report-item {
  background: #f8fafb;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-left: 3px solid #0a4d68;
  cursor: pointer;
}

.wb-report-item:hover {
  background: #eef4f8;
}

.wb-report-item h4 {
  font-size: 14px;
  color: #0a4d68;
  margin-bottom: 4px;
}

.wb-report-item .meta {
  font-size: 12px;
  color: #666;
}

.wb-report-item .note {
  font-size: 12px;
  color: #333;
  margin-top: 6px;
  font-style: italic;
}

.wb-no-reports {
  text-align: center;
  color: #888;
  padding: 20px;
  font-size: 14px;
}

#site-footer {
  text-align: center;
  padding: 20px 16px 90px 16px;
  margin-top: 20px;
  border-top: 1px solid #e0e0e0;
  color: #888;
  font-size: 12px;
  background: #f0f4f7;
}

#site-footer p { margin: 4px 0; }

#site-footer .footer-note {
  font-size: 11px;
  color: #aaa;
}

#site-footer a {
  color: #0a4d68;
  text-decoration: none;
  font-weight: 600;
}

#site-footer a:hover { text-decoration: underline; }

.map-hint {
  position: absolute;
  top: 110px;
  left: 50%;
  transform: translateX(-50%);
  background: #0a4d68;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 150;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 90%;
  text-align: center;
}

.map-hint button {
  background: #fff;
  color: #0a4d68;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.map-hint button:active { transform: scale(0.95); }

/* Подсказка автоопределения региона */
.auto-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #eaf6ee;
  color: #1a6e3a;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  margin-top: -4px;
  margin-bottom: 10px;
  border: 1px solid #a8d5b5;
}

.auto-hint button {
  background: #fff;
  color: #1a6e3a;
  border: 1px solid #a8d5b5;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
  white-space: nowrap;
}

.auto-hint button:active {
  background: #1a6e3a;
  color: #fff;
}

/* Заблокированный селект (автоопределённый регион) */
.modal-content select:disabled {
  background: #eaf6ee;
  border-color: #a8d5b5;
  color: #1a1a1a;
  font-weight: 600;
}
/* Кликабельные карточки в ленте */
.report-card {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.report-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}
.report-card:active {
  transform: scale(0.99);
}

/* Кликабельные отчёты в модалке */
.wb-report-item {
  cursor: pointer;
  transition: background 0.15s;
}