* {
  box-sizing: border-box;
}

/* Shrink OSM attribution — required legally but needn't dominate */
.leaflet-control-attribution {
  font-size: 9px !important;
  opacity: 0.55;
  background: rgba(255,255,255,0.6) !important;
  padding: 1px 4px !important;
}
.leaflet-control-attribution:hover {
  opacity: 1;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: #1f2937;
  background: #f3f4f6;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #0f766e, #0ea5e9);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 1000;
}

.app-header .title h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.app-header .subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: 0.9;
}

.search-wrap {
  position: relative;
  width: 320px;
  max-width: 45vw;
}

#search {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  outline: none;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.95);
  color: #111827;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  color: #111827;
  border-radius: 8px;
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  z-index: 1001;
}

.search-results li {
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.search-results li:hover,
.search-results li.active {
  background: #e0f2fe;
}

.search-results li .region {
  font-size: 12px;
  color: #6b7280;
}

.hidden {
  display: none !important;
}

main {
  flex: 1;
  display: flex;
  min-height: 0;
}

#map {
  flex: 1;
  height: 100%;
}

.info-panel {
  width: 320px;
  border-left: 1px solid #e5e7eb;
  background: #ffffff;
  padding: 16px 18px;
  overflow-y: auto;
}

.info-panel h2 {
  margin: 0 0 6px 0;
  font-size: 16px;
  color: #0f766e;
}

.hint {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 14px 0;
}

.price-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px;
  background: #f9fafb;
  margin-bottom: 12px;
}

.price-card-header h3 {
  margin: 0;
  font-size: 18px;
  color: #111827;
}

.price-card-header p {
  margin: 2px 0 12px 0;
  font-size: 12px;
  color: #6b7280;
}

.prices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.price {
  padding: 10px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: #fff;
}

.price .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  opacity: 0.9;
}

.price .value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 2px;
}

.price .unit {
  font-size: 11px;
  opacity: 0.85;
}

.price.petrol {
  background: linear-gradient(135deg, #065f46, #10b981);
}

.price.diesel {
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
}

.distance {
  font-size: 12px;
  color: #6b7280;
  margin: 10px 0 0 0;
}

.disclaimer {
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.4;
  margin-top: 10px;
}

.leaflet-popup-content-wrapper {
  border-radius: 10px;
}

.popup-inner {
  min-width: 180px;
}
.popup-inner .name {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 2px;
}
.popup-inner .region {
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 8px;
}
.popup-inner .row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 2px 0;
}
.popup-inner .row .k {
  color: #374151;
}
.popup-inner .row .v {
  font-weight: 700;
  color: #0f766e;
}

.data-status {
  margin: 12px 0 4px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  color: #0f766e;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  border-radius: 6px;
}
.data-status.is-stale {
  color: #92400e;
  background: #fef3c7;
  border-color: #fde68a;
}

@media (max-width: 820px) {
  .app-header {
    flex-direction: column;
    align-items: stretch;
  }
  .search-wrap {
    width: 100%;
    max-width: 100%;
  }
  main {
    flex-direction: column;
  }
  .info-panel {
    width: 100%;
    max-height: 40vh;
    border-left: none;
    border-top: 1px solid #e5e7eb;
  }
}

/* ── Footer ── */
.site-footer {
  background: #1f2937;
  color: #9ca3af;
  font-size: 9px;
  line-height: 1.5;
  padding: 8px 24px;
  text-align: center;
  flex-shrink: 0;
}
.site-footer p {
  margin: 2px 0;
}
.site-footer a {
  color: #6b7280;
  text-decoration: none;
}
.site-footer a:hover {
  color: #d1d5db;
}
