:root {
	--brand-color: #29689e;
}

/* ── BOTONERA ───────────────────────────────── */
.botonera {
  background-color: var(--brand-color);
  border: 1px solid var(--brand-color);
  margin-bottom: 20px;
  border-radius: 10px;
  cursor: pointer;
}

.boton {
  justify-content: center;
  gap: 2px;
}

.boton.select {
  background-color: #1a4a72;
}

.boton:not(.select):hover {
  background-color: #235a8a;
}

.lower-navbar {
  background-color: var(--brand-color);
}

.upper-navbar {
  padding: 0 20px;
}

/* ── LOGO ───────────────────────────────── */
.logo img {
  height: 70px;
  margin: 9px 6px;
}

.table-title {
  background-color: #4a8abf;
}

.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
  left: 0;
}

.chem-sub {
  font-size: 0.875em;
}

.unit-sup {
  font-size: 0.875em;
}

.unselected_th {
  color: #cccccc;
}

.unselected_th .fa-ellipsis-h {
  color: #cccccc;
}

.smart-form .label {
  text-align: center;
}

/* ── TWO-COLUMN LAYOUT ───────────────────────────────── */
#devicesLastDataSection {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

#devicesLastDataSection>.sub-section {
  width: calc(50% - 6px);
  box-sizing: border-box;
  margin-bottom: 0;
  height: fit-content;
}

.chart-container {
  margin-top: 0;
}

/* ── CARD ──────────────────────────────────────── */
.sub-section-title {
  align-items: start;
  padding: 10px 10px 4px;
}

.sub-section-title .title {
  font-size: 1.4rem;
}

.sub-section-tag {
  font-size: 0.8rem;
  color: #888;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.sub-section-chart-container {
  height: auto;
  flex: unset;
  justify-content: unset;
  align-items: unset;
}

.sub-section-content-aqi-chart {
  padding: 10px;
  gap: 10px;
}

.sub-section-texts {
  justify-content: unset;
}

/* ── AQI SQUARE ──────────────────────────────────────── */
.aqi-square {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  width: 50px;
  height: 60px;
}

.aqi-square-label {
  font-size: 0.85rem;
  color: black;
  font-weight: 600;
}

.aqi-square-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: black;
}

.aqi-square-pollutant {
  font-size: 0.75rem;
  color: black;
}

.aqi-square-nodata {
  background-color: rgb(111, 111, 111);
}

.no-data-label,
.unit-label {
  font-size: 1.2rem;
}

/* ── DATE IN CONTENT ─────────────────────────────────── */
.sub-section-date {
  color: #999;
  font-size: 0.85em;
  margin-top: 4px;
}

/* ── DATE IN TITLE (METEO) ─────────────────────────────────── */
.value-date {
  font-size: 1rem;
  text-align: initial;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── EXPAND / COLLAPSE DEVICE CARD ────────────────────── */
.sub-section-hidden {
  display: none;
}

#devicesLastDataSection.expanded-mode {
  justify-content: center;
  align-items: center;
}

#devicesLastDataSection > .sub-section-expanded {
  width: 100%;
  max-width: 500px;
}

.sub-section-expanded .sub-section-title .title {
  font-size: 1.8rem;
}

.sub-section-expanded .aqi-square {
  width: 70px;
  height: 70px;
}

.sub-section-expanded .aqi-square-label {
  font-size: 1.2rem;
}

.sub-section-expanded .aqi-square-pollutant {
  font-size: 1rem;
}

#sub-section-back-btn {
  cursor: pointer;
  font-size: 1.4rem;
  color: #555;
  margin-bottom: 8px;
  align-self: flex-start;
}

#sub-section-back-btn:hover {
  color: #000;
}

/* ── TABS ─────────────────────────────────────────────── */
.stations-tabs {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 2px solid #ddd;
}

.station-tab {
  background: none;
  border: 1px solid transparent;
  border-bottom: none;
  padding: 8px 16px;
  cursor: pointer;
  color: #555;
  border-radius: 4px 4px 0 0;
  margin-bottom: -2px;
  transition: background 0.15s, color 0.15s;
}

.station-tab:hover {
  background: #f5f5f5;
  color: #333;
}

.station-tab.active,
.station-tab[aria-selected="true"] {
  background: #fff;
  color: #333;
  border-color: #ddd;
  border-bottom-color: #fff;
  font-weight: 600;
}

.station-panel {
  padding: 8px 18px;
}

.station-figure {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 0 0 16px 0;
}

.station-img {
  border-radius: 4px;
  height: clamp(230px, 28vw, 610px);
  object-fit: cover;
  object-position: center;
  width: clamp(230px, 32vw, 610px);
}

.station-figure figcaption {
  text-align: center;
  font-size: 0.85em;
  color: #666;
  margin-top: 6px;
}

.station-details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 12px;
  align-items: baseline;
}

.station-details dt {
  font-size: 1em;
  font-weight: 600;
  white-space: nowrap;
}

.station-details dt::after {
  content: ":";
}

.station-details dt:first-child {
  margin-top: 0;
}

.station-details dd {
  font-size: 2rem;
  margin: 0;
}

.station-params-title {
  font-size: 1em;
  font-weight: 600;
  margin: 24px 0 10px;
  color: #555;
  letter-spacing: 0.04em;
}

.station-params-table thead {
  background-color: #f0f0f0;
}

#limitsTableInfo td {
  text-align: initial;
}

/* ── TABLA AQI ───────────────────────────────────────── */
.aqi-lvl0 {
	background-color: rgb(0, 228, 0)!important;
	color: black;
}
.aqi-lvl1 {
	background-color: rgb(255, 255, 0)!important;
	color: black;
}
.aqi-lvl2 {
	background-color: rgb(255, 126, 0)!important;
	color: white;
}
.aqi-lvl3 {
	background-color: rgb(255, 0, 0)!important;
	color: white;
}
.aqi-lvl4 {
	background-color: rgb(143, 63, 151)!important;
	color: white;
}
.aqi-lvl5 {
	background-color: rgb(126, 0, 35)!important;
	color: white;
}

/* ── DROPDOWN GROUP HEADERS ───────────────────────────── */
.dropdown-group-header {
  padding-top: 6px;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  pointer-events: none;
  cursor: default;
  border-top: 1px solid #e0e0e0;
}

.dropdown-group-header.first-group-header{
  border-top: none;
}

.dropdown-group-header.last-group-header {
  margin-top: 10px;
}

/* ── DISCLAIMER ───────────────────────────────────────── */
.info-disclaimer {
  background-color: #fff8e1;
  border-left: 4px solid #f9a825;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 0.92em;
  line-height: 1.5;
  color: #333;
}

/* ── RESPONSIVE: móvil ─────────────────────────────────── */
@media all and (max-width: 575px) {
  .lower-navbar {
    background-color: #f3f3f3;
  }

  #devicesLastDataSection>.sub-section {
    width: 100%;
  }

  .stations-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .station-tab {
    white-space: nowrap;
  }

  .station-header {
    flex-direction: column;
  }
}