.weewx-weather {
  --weewx-bg: #f7f9fc;
  --weewx-card: #ffffff;
  --weewx-border: #d7dde5;
  --weewx-text: #1f2933;
  --weewx-muted: #566173;
  --weewx-accent: #1d4ed8;

  background: var(--weewx-bg);
  color: var(--weewx-text);
  border: 1px solid var(--weewx-border);
  border-radius: 12px;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.weewx-weather--dark {
  --weewx-bg: #111827;
  --weewx-card: #1f2937;
  --weewx-border: #2f3b52;
  --weewx-text: #f3f4f6;
  --weewx-muted: #cbd5e1;
  --weewx-accent: #38bdf8;
}

.weewx-weather__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.weewx-weather__title {
  margin: 0 0 4px 0;
  font-size: 20px;
}

.weewx-weather__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 12px;
  color: var(--weewx-muted);
}

.weewx-weather__meta-item {
  white-space: nowrap;
}

.weewx-weather__reload {
  background: var(--weewx-accent);
  color: #ffffff;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
}

.weewx-weather__reload:hover {
  opacity: 0.9;
}

.weewx-weather__grid {
  display: grid;
  gap: 16px;
}

.weewx-weather__columns {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: start;
}

.weewx-weather__column {
  display: grid;
  gap: 16px;
}

.weewx-weather__full-span {
  grid-column: 1 / -1;
}

.weewx-weather__tabs {
  display: grid;
  gap: 12px;
}

.weewx-weather__tab-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.weewx-weather__tab-button {
  border: 1px solid var(--weewx-border);
  background: var(--weewx-card);
  color: var(--weewx-text);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}

.weewx-weather__tab-button.is-active {
  background: var(--weewx-accent);
  border-color: var(--weewx-accent);
  color: #ffffff;
}

.weewx-weather__tab-panel {
  display: none;
}

.weewx-weather__tab-panel.is-active {
  display: block;
}

.weewx-weather__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.weewx-weather__table th,
.weewx-weather__table td {
  border-bottom: 1px solid var(--weewx-border);
  padding: 6px 8px;
  text-align: left;
}

.weewx-weather__table th {
  color: var(--weewx-muted);
  font-weight: 600;
}

.weewx-weather__chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.weewx-weather__chart-card {
  background: var(--weewx-bg);
  border: 1px solid var(--weewx-border);
  border-radius: 8px;
  padding: 8px;
}

.weewx-weather__chart-title {
  font-size: 12px;
  color: var(--weewx-muted);
  margin-bottom: 6px;
}

.weewx-weather__chart-body {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 6px;
  align-items: stretch;
}

.weewx-weather__chart-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 70px;
  font-size: 11px;
  color: var(--weewx-muted);
}

.weewx-weather__chart-plot {
  width: 100%;
}

.weewx-weather__chart-x {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--weewx-muted);
  margin-top: 4px;
}

.weewx-weather__chart-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 4px;
}

.weewx-weather__sparkline {
  width: 100%;
  height: auto;
}

.weewx-weather__sparkline-series {
  fill: none;
  stroke-width: 2;
  stroke: var(--weewx-accent);
}

.weewx-weather__sparkline-series--secondary {
  stroke: #94a3b8;
}

.weewx-weather__sparkline-series--tertiary {
  stroke: #f59e0b;
}

.weewx-weather__chart-empty {
  color: var(--weewx-muted);
  font-size: 12px;
  padding: 6px 0;
}


.weewx-weather__grid--single {
  grid-template-columns: 1fr;
}

.weewx-weather__card {
  background: var(--weewx-card);
  border: 1px solid var(--weewx-border);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.weewx-weather__card-title {
  margin: 0 0 10px 0;
  font-size: 16px;
}

.weewx-weather__metric {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid var(--weewx-border);
  font-size: 14px;
}

.weewx-weather__metric:last-child {
  border-bottom: none;
}

.weewx-weather__metric-label {
  color: var(--weewx-muted);
}

.weewx-weather__metric-value {
  font-weight: 600;
}

.weewx-weather__summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.weewx-weather__summary-item {
  background: var(--weewx-card);
  border: 1px solid var(--weewx-border);
  border-radius: 10px;
  padding: 10px;
}

.weewx-weather__summary-label {
  display: block;
  font-size: 12px;
  color: var(--weewx-muted);
  margin-bottom: 4px;
}

.weewx-weather__summary-value {
  font-size: 16px;
  font-weight: 600;
}

.weewx-weather--error {
  border-color: #ef4444;
  background: #fef2f2;
  color: #991b1b;
  padding: 12px;
  border-radius: 8px;
}
