* {
  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;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: #1f2937;
  background: #f3f4f6;
}

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

/* The map+panel row fills exactly the viewport minus the header */
.map-viewport {
  display: flex;
  flex: none;
  height: calc(100vh - 64px); /* header height approx */
}

.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 {
  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;
  }
}

/* ── Quick Stats (Option A) ── */
.quick-stats {
  margin-top: 16px;
  padding: 12px 14px;
  background: #f0fdf9;
  border: 1px solid #99f6e4;
  border-radius: 10px;
}
.qs-title {
  margin: 0 0 10px 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #0f766e;
}
.qs-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  color: #374151;
  margin-bottom: 6px;
  line-height: 1.4;
}
.qs-label {
  color: #6b7280;
  flex-shrink: 0;
}
.qs-row strong {
  color: #111827;
  text-align: right;
}
.qs-divider {
  border-top: 1px solid #ccfbf1;
  margin: 8px 0;
}
.qs-cheapest strong { color: #065f46; }
.qs-costliest strong { color: #9a3412; }

/* ── FAQ Section (Option B) ── */
.faq-section {
  margin-top: 16px;
}
.faq-title {
  margin: 0 0 8px 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #0f766e;
}
.faq-item {
  border-top: 1px solid #f3f4f6;
  padding: 8px 0;
}
.faq-q {
  margin: 0 0 3px 0;
  font-size: 12px;
  font-weight: 600;
  color: #1f2937;
}
.faq-a {
  margin: 0;
  font-size: 11px;
  color: #6b7280;
  line-height: 1.5;
}

/* ── Below-map content section ── */
.content-section {
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  padding: 24px 16px 32px;
}

.content-block {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.content-heading {
  margin: 0 0 4px 0;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}

.content-desc {
  margin: 0 0 12px 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
}

/* State table */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.state-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.state-table thead th {
  background: #f0fdf9;
  color: #0f766e;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 2px solid #99f6e4;
  white-space: nowrap;
}

.state-table thead th:not(:first-child) {
  text-align: right;
}

.tr-even { background: #fff; }
.tr-odd  { background: #f9fafb; }

.state-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
}

.td-state  { font-weight: 500; color: #111827; }
.td-petrol { text-align: right; color: #065f46; font-weight: 500; }
.td-diesel { text-align: right; color: #1e3a8a; font-weight: 500; }
.td-count  { text-align: right; color: #374151; }
.tbl-loading { text-align: center; color: #9ca3af; padding: 20px; }

/* State table + metro table extra columns */
.th-left { text-align: left !important; }
.td-city { color: #374151; text-align: left; }
.td-city--diesel { color: #1e3a8a; }

@media (min-width: 700px) {
  .content-section {
    padding: 28px 32px 40px;
  }
}

/* ── 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;
}
