:root {
  --ww-primary: #64b986;
  --ww-primary-dark: #4e8f68;
  --ww-primary-light: #f4a94d;
  --ww-bg: #ffffff;
  --ww-surface: #ffffff;
  --ww-surface-alt: #eee;
  --ww-text: #2e2e2e;
  --ww-text-muted: #6b6560;
  --ww-text-light: #98918a;
  --ww-border: #e6e0d8;
  --ww-rain: #5b9bd5;
  --ww-rain-light: #d6e8f7;
  --ww-shadow: rgba(46, 46, 46, 0.08);
  --ww-radius: 3px;
  --ww-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

/* ---- Container ---- */
.ww-container {
  font-family: var(--ww-font);
  color: var(--ww-text);
  background: var(--ww-bg);
  border: 1px solid var(--ww-border);
  border-radius: var(--ww-radius);
  box-shadow: 0 2px 8px var(--ww-shadow);
  overflow: hidden;
  line-height: 1.4;
  max-width: 100%;
}

.ww-container *,
.ww-container *::before,
.ww-container *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ---- Header ---- */
.ww-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--ww-surface-alt);
  color: var(--ww-text-muted);
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--ww-border);
}

.ww-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ww-date {
  font-size: 13px;
  font-weight: 500;
}

.ww-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
}

.ww-minmax {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.ww-minmax-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ww-text-light);
}

.ww-minmax-value {
  font-weight: 600;
  font-size: 14px;
  color: var(--ww-text);
}

.ww-minmax-divider {
  width: 1px;
  height: 18px;
  background: var(--ww-border);
}

/* ---- Forecast Strip ---- */
.ww-forecast {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--ww-border) transparent;
  padding: 0;
  background: var(--ww-surface);
}

.ww-forecast::-webkit-scrollbar {
  height: 4px;
}

.ww-forecast::-webkit-scrollbar-track {
  background: transparent;
}

.ww-forecast::-webkit-scrollbar-thumb {
  background: var(--ww-border);
  border-radius: 2px;
}

/* ---- Hour Card ---- */
.ww-hour {
  flex: 1 1 0;
  min-width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 6px 10px;
  scroll-snap-align: start;
  border-right: 1px solid var(--ww-border);
  transition: background 0.15s ease;
  position: relative;
}

.ww-hour:last-child {
  border-right: none;
}

.ww-hour:hover {
  background: var(--ww-surface-alt);
}

.ww-hour.ww-hour--now {
  background: var(--ww-surface-alt);
}

.ww-hour.ww-hour--now::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--ww-primary);
  border-radius: 0 0 2px 2px;
}

.ww-time {
  font-size: 12px;
  font-weight: 600;
  color: var(--ww-text);
}

.ww-hour--now .ww-time {
  color: var(--ww-primary-dark);
}

.ww-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.ww-icon svg {
  width: 100%;
  height: 100%;
}

.ww-temp {
  font-size: 15px;
  font-weight: 700;
  color: var(--ww-text);
}

.ww-precip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-height: 28px;
  justify-content: center;
}

.ww-precip-prob {
  font-size: 11px;
  font-weight: 500;
  color: var(--ww-rain);
}

.ww-precip-amount {
  font-size: 10px;
  color: var(--ww-text-light);
}

.ww-precip-bar {
  width: 32px;
  height: 3px;
  border-radius: 2px;
  background: var(--ww-rain-light);
  overflow: hidden;
  margin-top: 2px;
}

.ww-precip-bar-fill {
  height: 100%;
  background: var(--ww-rain);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ---- Loading State ---- */
.ww-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  color: var(--ww-text-muted);
  font-size: 14px;
  gap: 10px;
  background: var(--ww-surface);
}

.ww-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--ww-border);
  border-top-color: var(--ww-primary);
  border-radius: 50%;
  animation: ww-spin 0.7s linear infinite;
}

@keyframes ww-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- Hidden (Fehler / keine Daten) ---- */
.ww-container.ww-hidden {
  display: none;
}

/* ============================================
   Responsive · Mobile
   Einzeilig, max. 100px Gesamthöhe
   ============================================ */
@media (max-width: 600px) {
  .ww-container {
    border-radius: 8px;
    max-height: 100px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100vw;
    border-radius: 0;
  }

  .ww-header {
    padding: 4px 10px;
    gap: 4px;
    flex-wrap: nowrap;
    min-height: 0;
    flex-shrink: 0;
  }

  .ww-date {
    font-size: 11px;
  }

  .ww-header-right {
    gap: 8px;
  }

  .ww-minmax-label {
    font-size: 9px;
  }

  .ww-minmax-value {
    font-size: 11px;
  }

  .ww-minmax-divider {
    height: 12px;
  }

  /* Kompakte Stunden-Karten – horizontal scrollbar */
  .ww-forecast {
    flex: 1;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .ww-hour {
    flex: 0 0 auto;
    min-width: auto;
    width: auto;
    flex-direction: row;
    gap: 5px;
    padding: 4px 10px;
    justify-content: center;
    align-items: center;
  }

  .ww-icon {
    width: 20px;
    height: 20px;
  }

  .ww-temp {
    font-size: 12px;
    white-space: nowrap;
  }

  .ww-time {
    font-size: 10px;
    white-space: nowrap;
  }

  .ww-precip {
    flex-direction: row;
    gap: 2px;
    min-height: auto;
    white-space: nowrap;
  }

  .ww-precip-prob {
    font-size: 9px;
  }

  .ww-precip-amount {
    display: none;
  }

  .ww-precip-bar {
    display: none;
  }

  .ww-hour.ww-hour--now::before {
    width: 3px;
    height: auto;
    top: 0;
    bottom: 0;
    right: auto;
    left: 0;
    border-radius: 0 2px 2px 0;
  }

  .ww-loading {
    padding: 10px;
    font-size: 12px;
  }

  .ww-spinner {
    width: 14px;
    height: 14px;
  }
}
