/* ---------- Controls ---------- */
#left-upper-upper-container,
#inner-lower-upper-container {
  width: min(100%, 440px);
}

#inner-lower-upper-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.info-button {
  border: none;
  background: none;
  padding: 0;
  margin-bottom: 0.5rem;
  color: blue;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.info-button:focus-visible,
.range-preset:focus-visible,
.table-toggle:focus-visible {
  outline: 2px solid #3556d8;
  outline-offset: 2px;
}

.range-presets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.range-presets-label {
  font-size: 0.85rem;
  color: #666666;
  margin-right: 2px;
}

.range-preset {
  border: 1px solid #3556d8;
  background: #ffffff;
  color: #3556d8;
  border-radius: 8px;
  padding: 3px 12px;
  font-size: 0.85rem;
  cursor: pointer;
}

.range-preset:hover:not(:disabled) {
  background: #3556d8;
  color: #ffffff;
}

.range-preset:disabled {
  border-color: #c2c2c2;
  color: #9c9c9c;
  cursor: default;
}

.data-availability {
  min-height: 1.2em;
  margin-top: 6px;
  font-size: 0.85rem;
  color: #666666;
  text-align: center;
}

/* ---------- Graph ---------- */
.graph-subtitle {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 8px 0;
  min-height: 1.5em;
  font-size: 0.95rem;
  color: #666666;
  text-align: center;
}

.graph-subtitle strong {
  color: #191919;
  font-weight: 600;
}

/* ---------- Summary tiles ---------- */
.summary-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 8px;
}

.summary-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 8px 0 12px;
}

.summary-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.summary-range {
  font-size: 0.9rem;
  color: #666666;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.stat-tile {
  background: #ffffff;
  border: 1px solid rgba(11, 11, 11, 0.10);
  border-radius: 8px;
  padding: 14px 16px;
}

.stat-tile-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #191919;
}

.stat-tile-parameter {
  color: #666666;
  font-weight: 400;
}

.stat-tile-parameter::before {
  content: "· ";
}

.series-key {
  display: inline-block;
  flex: none;
}

.series-key-bar {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.series-key-line {
  width: 16px;
  height: 3px;
  border-radius: 2px;
}

.stat-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin: 12px 0 0;
}

.stat dt {
  font-size: 0.8rem;
  font-weight: 400;
  color: #666666;
}

.stat dd {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #191919;
}

.stat-detail {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  color: #666666;
}

.stat-empty {
  margin: 12px 0 0;
  color: #666666;
}

/* ---------- Table view ---------- */
.table-section {
  max-width: 1400px;
  margin: 16px auto 0;
  padding: 0 8px;
}

.table-toggle {
  border: none;
  background: none;
  padding: 4px 0;
  color: #3556d8;
  text-decoration: underline;
  cursor: pointer;
}

.data-table-scroll {
  max-height: 360px;
  overflow: auto;
  margin-top: 10px;
  border: 1px solid #e7e7e7;
  border-radius: 8px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.data-table caption {
  caption-side: top;
  padding: 8px 10px;
  font-weight: 600;
  color: #191919;
}

.data-table th,
.data-table td {
  padding: 4px 10px;
  border-bottom: 1px solid #e7e7e7;
  text-align: right;
  white-space: nowrap;
}

.data-table th:first-child,
.data-table td:first-child {
  text-align: left;
}

.data-table thead th {
  position: sticky;
  top: 0;
  background: #f9f9f9;
  font-weight: 600;
}

/* ---------- Download modal ---------- */
.download-note {
  font-size: 0.85rem;
  color: #666666;
  margin-bottom: 8px;
}

/* ---------- Small screens ---------- */
@media (max-width: 768px) {
  #top-thin-banner {
    padding: 12px 16px !important;
    font-size: 14px !important;
  }

  #banner {
    padding: 8px 12px !important;
  }

  #inner-banner img {
    height: 52px !important;
  }

  #banner h1 {
    font-size: 1.45rem;
  }

  #left-upper-upper-container h3 {
    font-size: 1.4rem;
  }

  .graph-subtitle {
    font-size: 0.85rem;
  }

  .range-presets {
    gap: 4px;
  }

  .range-preset {
    padding: 3px 9px;
  }

  .stat-tile {
    padding: 12px 14px;
  }

  .stat dd {
    font-size: 1rem;
  }
}

/* Keep the five range buttons on one line on phones */
@media (max-width: 420px) {
  .range-presets-label {
    display: none;
  }
}
