:root {
  --ds-bg: #f4f7fb;
  --ds-surface: #ffffff;
  --ds-border: #dbe4ee;
  --ds-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --ds-shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
  --ds-primary: #0f766e;
  --ds-primary-hover: #115e59;
  --ds-water-a: #0891b2;
  --ds-water-b: #06b6d4;
  --ds-status-ok: #16a34a;
  --ds-status-warn: #f59e0b;
  --ds-status-critical: #dc2626;
  --ds-status-muted: #94a3b8;
  --ds-text: #0f172a;
  --ds-text-secondary: #64748b;
  --ds-text-disabled: #94a3b8;
  --ds-weather-sun: #f59e0b;
  --ds-weather-rain: #0284c7;
  --ds-weather-cloud: #94a3b8;
  --ds-weather-storm: #7c3aed;
  --ds-chart-fill: #0891b2;
  --ds-chart-fill-alt: #0f766e;
  --ds-chart-rain: #0ea5e9;
  --ds-chart-cons: #14b8a6;
  --ds-chart-warn: #f59e0b;
  --ds-chart-crit: #dc2626;
  --ds-radius: 16px;
  --ds-radius-hero: 20px;
  --ds-transition: 0.2s ease;
  --ds-ok-surface: rgba(22, 163, 74, 0.07);
  --ds-warn-surface: rgba(245, 158, 11, 0.1);
  --ds-danger-surface: rgba(220, 38, 38, 0.07);
  --ds-muted-surface: rgba(148, 163, 184, 0.12);
}

html {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

.dashboard-body {
  margin: 0;
  background: var(--ds-bg);
  color: var(--ds-text);
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

.app-shell {
  max-width: 1160px;
  margin: 0 auto;
  display: block;
  padding: 1rem;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .app-shell {
    padding: 1rem 1rem 2rem;
  }
}

.sidebar {
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius);
  box-shadow: var(--ds-shadow-sm);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand {
  margin: 0;
  color: var(--ds-primary);
  font-weight: 700;
  font-size: 1.2rem;
}

.brand-sub {
  margin: 0.1rem 0 0 0;
  color: var(--ds-water-a);
  font-size: 0.9rem;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 1rem;
}

.side-link {
  color: var(--ds-text-secondary);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--ds-radius);
  padding: 0.7rem 0.85rem;
  background: transparent;
  font-size: 0.95rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: background var(--ds-transition), border-color var(--ds-transition);
}

.side-link:hover {
  border-color: var(--ds-border);
  background: color-mix(in srgb, var(--ds-bg) 70%, white);
}

.side-link.active {
  border-color: color-mix(in srgb, var(--ds-primary) 35%, var(--ds-border));
  background: color-mix(in srgb, var(--ds-primary) 9%, white);
  color: var(--ds-primary);
}

.sidebar-footer {
  margin-top: 1rem;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.topbar {
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius);
  box-shadow: var(--ds-shadow-sm);
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.title {
  margin: 0;
  font-size: 1.85rem;
  line-height: 1.1;
  color: var(--ds-text);
}

.subtitle {
  margin: 0.25rem 0 0 0;
  color: var(--ds-text-secondary);
  font-size: 0.93rem;
}

.settings-btn {
  text-decoration: none;
  color: #ffffff;
  background: var(--ds-primary);
  padding: 0.65rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
  box-shadow: var(--ds-shadow-sm);
  transition: background var(--ds-transition), border-color var(--ds-transition);
}

.settings-btn:hover {
  background: var(--ds-primary-hover);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.kpi-card {
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius);
  box-shadow: var(--ds-shadow-sm);
  padding: 0.95rem 1rem;
}

.kpi-highlight {
  background: linear-gradient(140deg, #d1fae5 0%, #cffafe 100%);
  border-color: #99f6e4;
}

.card {
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius);
  padding: 1.05rem;
  box-shadow: var(--ds-shadow-sm);
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.7rem;
}

.card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.card-meta {
  margin: 0;
  color: var(--ds-text-secondary);
  font-size: 0.8rem;
}

.chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
}

.label {
  color: var(--ds-text-secondary);
  font-size: 0.84rem;
  margin: 0;
}

.value {
  color: var(--ds-text);
  font-size: 1.36rem;
  font-weight: 700;
  margin: 0.23rem 0 0 0;
}

.input {
  width: 100%;
  background: var(--ds-surface);
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  color: var(--ds-text);
  transition: border-color var(--ds-transition), box-shadow var(--ds-transition);
}

.input:hover {
  border-color: #94a3b8;
}

.input:focus {
  outline: none;
  border-color: var(--ds-primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.circle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.circle-card {
  text-align: center;
}

.circle-wrap {
  max-width: 220px;
  margin: 0 auto;
}

.circle-text {
  margin: 0.8rem 0 0 0;
  font-weight: 700;
  color: var(--ds-text);
}

.arc-gauge-card .circle-wrap {
  max-width: none;
}

.arc-gauge-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.arc-gauge-viewport {
  position: relative;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
}

.arc-gauge-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 320 / 198;
  vertical-align: middle;
}

.arc-gauge-center {
  position: absolute;
  left: 50%;
  bottom: 8%;
  transform: translateX(-50%);
  pointer-events: none;
  text-align: center;
}

.arc-gauge-center-num {
  font-size: clamp(2.1rem, 8vw, 2.75rem);
  font-weight: 800;
  color: var(--ds-water-a);
  letter-spacing: -0.03em;
}

.arc-gauge-split {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 340px;
  margin: 0.25rem auto 0 auto;
  padding: 0.65rem 0.5rem;
  background: color-mix(in srgb, var(--ds-bg) 55%, white);
  border-radius: var(--ds-radius);
  border: 1px solid var(--ds-border);
}

.arc-gauge-stat {
  text-align: center;
}

.arc-gauge-stat-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ds-text-secondary);
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.arc-gauge-stat-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ds-text);
}

.arc-gauge-divider {
  width: 1px;
  align-self: stretch;
  min-height: 2.5rem;
  background: #cbd5e1;
}

.arc-gauge-footnote {
  margin-top: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #64748b;
}

.volume-summary-card .card-meta {
  margin: 0;
  font-size: 0.78rem;
}

.volume-bar-stack {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  padding: 0.35rem 0 0.25rem 0;
}

.volume-bar-track {
  height: 18px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  overflow: hidden;
  border: 1px solid var(--ds-border);
}

.volume-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ds-water-a) 0%, var(--ds-primary) 100%);
  transition: width 0.45s ease;
}

.volume-bar-legend {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.85rem;
}

.volume-legend-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.84rem;
  color: #475569;
}

.volume-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.volume-legend-dot-water {
  background: linear-gradient(135deg, #0891b2, #0f766e);
}

.volume-legend-dot-free {
  background: #cbd5e1;
}

.volume-legend-label {
  font-weight: 600;
}

.volume-legend-val {
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

/* Mobile: Tab-Leiste (nur schmale Viewports) */
.mobile-tab-bar {
  display: none;
}

.mobile-tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: 48px;
  padding: 0.25rem 0.35rem;
  margin: 0;
  border: none;
  background: transparent;
  color: var(--ds-text-secondary);
  font-size: 0.65rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  position: relative;
  z-index: 1;
  transition: color var(--ds-transition), background var(--ds-transition);
  border-radius: 12px;
}

.mobile-tab-btn .mobile-tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.mobile-tab-btn.is-active {
  color: var(--ds-primary);
  background: color-mix(in srgb, var(--ds-primary) 9%, white);
}

.mobile-tab-label {
  letter-spacing: 0.02em;
  white-space: nowrap;
}

@media (max-width: 768px) {
  /* Tab-Leiste + Safe Area — nur wenn .app-shell + .dash-layout (nicht durch 980er padding-Shorthand überschreiben!) */
  .app-shell.dash-layout {
    padding-bottom: calc(9rem + env(safe-area-inset-bottom, 0px));
  }

  .dash-settings-desktop {
    display: none !important;
  }

  .dash-footer {
    display: none !important;
  }

  .dash-layout[data-active-tab="weather"] .dash-overview-block,
  .dash-layout[data-active-tab="analysis"] .dash-overview-block {
    display: none !important;
  }

  .dash-two-col {
    grid-template-columns: 1fr;
  }

  .hw-tile {
    min-width: 0;
  }

  .dash-layout canvas {
    max-width: 100%;
  }

  .mobile-tab-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    pointer-events: auto;
    justify-content: space-around;
    align-items: stretch;
    padding: 0.3rem 0.2rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--ds-bg) 94%, white);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--ds-border);
    box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.06);
  }

  .dash-tab-panel:not(.is-active) {
    display: none !important;
  }

  .dash-tab-panel.is-active {
    display: block !important;
  }
}

@media (min-width: 769px) {
  .mobile-tab-bar {
    display: none !important;
  }

  .dash-tab-panel {
    display: block !important;
  }

  .dash-overview-block {
    display: contents;
  }
}

.settings-shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.2rem;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.settings-title {
  margin: 0;
  font-size: 2rem;
  color: #0f172a;
}

.settings-card {
  border-radius: 1.1rem;
}

.settings-note {
  margin: 0;
  color: #64748b;
  font-size: 0.95rem;
}

.settings-label {
  color: #334155;
  font-size: 0.95rem;
}

.save-btn {
  width: 100%;
  margin-top: 1.25rem;
  border: none;
  border-radius: 0.65rem;
  padding: 0.75rem 0.9rem;
  font-size: 1.05rem;
  font-weight: 700;
  background: #84cc16;
  color: #0f172a;
}

.save-btn:hover {
  filter: brightness(1.05);
}

.settings-feedback {
  margin: 0.8rem 0 0 0;
  color: #334155;
  font-size: 0.93rem;
}

.settings-subtitle {
  margin: 0.2rem 0 0.6rem 0;
  font-size: 1.05rem;
  color: #0f172a;
}

.push-settings {
  border: 1px dashed #cbd5e1;
  border-radius: 0.75rem;
  padding: 0.8rem;
  background: #f8fafc;
}

.toggle-row {
  display: block;
  margin: 0.45rem 0;
  color: #334155;
  font-size: 0.95rem;
}

.toggle-row input {
  margin-right: 0.45rem;
}

.push-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

@media (min-width: 1100px) {
  .chart-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 980px) {
  /* Kein padding-Shorthand: würde padding-bottom von .dash-layout überschreiben */
  .app-shell {
    padding-top: 0.8rem;
    padding-left: 0.8rem;
    padding-right: 0.8rem;
  }

  .app-shell:not(.dash-layout) {
    padding-bottom: 0.8rem;
  }

  .sidebar {
    display: none;
  }

  .title {
    font-size: 1.55rem;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-shell {
    padding: 0.9rem 0.9rem calc(5.5rem + env(safe-area-inset-bottom, 0px)) 0.9rem;
  }

  .mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #dbe5f3;
    padding: 0.6rem 0.9rem 0.8rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    z-index: 40;
    backdrop-filter: blur(6px);
  }

  .mobile-link {
    text-decoration: none;
    text-align: center;
    border-radius: 0.65rem;
    padding: 0.65rem 0.55rem;
    color: #334155;
    font-size: 0.9rem;
    border: 1px solid #dbe5f3;
  }

  .mobile-link.active {
    border-color: #99f6e4;
    color: #0f766e;
    background: #ecfeff;
  }
}

@media (max-width: 560px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .settings-btn {
    width: 100%;
    text-align: center;
  }

  .circle-grid {
    grid-template-columns: 1fr;
  }

  .settings-title {
    font-size: 1.6rem;
  }

}

.hw-status-section {
  margin-top: 0;
}

.hw-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 768px) {
  .hw-status-grid {
    grid-template-columns: 1fr;
  }
}

.hw-tile {
  border-radius: var(--ds-radius);
  border: 1px solid var(--ds-border);
  padding: 0.95rem;
  box-shadow: var(--ds-shadow-sm);
  transition: border-color var(--ds-transition), background var(--ds-transition),
    box-shadow var(--ds-transition);
}

.hw-tile-inner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.hw-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 12px;
  background: var(--ds-muted-surface);
  color: var(--ds-text-secondary);
}

.hw-icon svg {
  width: 1.65rem;
  height: 1.65rem;
}

.hw-tile-label {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ds-text-secondary);
  font-weight: 600;
}

.hw-tile-title {
  margin: 0.22rem 0 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ds-text);
}

.hw-tile-detail {
  margin: 0.32rem 0 0 0;
  font-size: 0.84rem;
  line-height: 1.38;
  color: var(--ds-text-secondary);
}

.hw-tile.hw-tone-good {
  border-color: rgba(22, 163, 74, 0.25);
  background: linear-gradient(145deg, var(--ds-ok-surface) 0%, var(--ds-surface) 100%);
}

.hw-tile.hw-tone-good .hw-icon {
  background: rgba(22, 163, 74, 0.12);
  color: var(--ds-status-ok);
}

.hw-tile.hw-tone-warn {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(145deg, var(--ds-warn-surface) 0%, var(--ds-surface) 100%);
}

.hw-tile.hw-tone-warn .hw-icon {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.hw-tile.hw-tone-bad {
  border-color: rgba(220, 38, 38, 0.28);
  background: linear-gradient(145deg, var(--ds-danger-surface) 0%, var(--ds-surface) 100%);
}

.hw-tile.hw-tone-bad .hw-icon {
  background: rgba(220, 38, 38, 0.1);
  color: var(--ds-status-critical);
}

.hw-tile.hw-tone-neutral {
  border-color: var(--ds-border);
  background: var(--ds-surface);
}

.hw-tile.hw-tone-neutral .hw-icon {
  color: var(--ds-text-secondary);
}

.hw-ack-row {
  margin-top: 0.95rem;
  padding-top: 0.95rem;
  border-top: 1px dashed var(--ds-border);
}

.hw-ack-hint {
  margin: 0 0 0.75rem 0;
  font-size: 0.82rem;
  line-height: 1.42;
  color: var(--ds-text-secondary);
}

.hw-ack-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.hw-ack-btn {
  appearance: none;
  border-radius: var(--ds-radius);
  padding: 0.55rem 1rem;
  min-height: 44px;
  font-size: 0.86rem;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  background: var(--ds-surface);
  color: var(--ds-text-secondary);
  cursor: pointer;
  transition: background var(--ds-transition), border-color var(--ds-transition),
    color var(--ds-transition);
}

.hw-ack-btn:hover:not(:disabled) {
  border-color: #94a3b8;
  background: #f8fafc;
}

.hw-ack-btn-primary {
  border-color: var(--ds-primary);
  background: var(--ds-primary);
  color: #ffffff;
}

.hw-ack-btn-primary:hover:not(:disabled) {
  border-color: var(--ds-primary-hover);
  background: var(--ds-primary-hover);
}

.hw-ack-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.hw-ack-feedback {
  margin: 0.6rem 0 0 0;
  font-size: 0.82rem;
  color: var(--ds-primary);
  font-weight: 600;
}

/* ——— Dashboard-Upgrade Layout ——— */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dash-hidden {
  display: none !important;
}

.dash-layout {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  overflow-x: hidden;
  max-width: 100%;
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .dash-header {
    position: sticky;
    top: 0;
    z-index: 40;
    margin: -0.5rem 0 0;
    padding: 0.65rem 0.5rem;
    background: color-mix(in srgb, var(--ds-bg) 88%, white);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--ds-border);
    border-radius: 0 0 var(--ds-radius) var(--ds-radius);
    box-shadow: var(--ds-shadow-sm);
  }
}

.dash-title {
  margin: 0;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ds-text);
}

.dash-status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.dash-status-badge[data-tone="ok"] {
  border-color: rgba(22, 163, 74, 0.35);
  background: var(--ds-ok-surface);
  color: var(--ds-status-ok);
}

.dash-status-badge[data-tone="warn"] {
  border-color: rgba(245, 158, 11, 0.4);
  background: var(--ds-warn-surface);
  color: #b45309;
}

.dash-status-badge[data-tone="danger"] {
  border-color: rgba(220, 38, 38, 0.35);
  background: var(--ds-danger-surface);
  color: var(--ds-status-critical);
}

.dash-status-badge[data-tone="muted"] {
  border-color: rgba(148, 163, 184, 0.35);
  background: var(--ds-muted-surface);
  color: var(--ds-text-secondary);
}

.dash-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dash-icon-btn {
  appearance: none;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 999px;
  width: 2.45rem;
  height: 2.45rem;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dash-icon-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.dash-hero {
  padding: 1.35rem 1.25rem;
  background: linear-gradient(
    145deg,
    var(--ds-surface) 0%,
    color-mix(in srgb, var(--ds-water-a) 6%, white) 45%,
    var(--ds-bg) 100%
  );
  border-radius: var(--ds-radius-hero);
  border: 1px solid var(--ds-border);
  box-shadow: var(--ds-shadow-sm);
}

.dash-hero-inner {
  text-align: center;
}

.dash-hero-percent {
  font-size: clamp(2.8rem, 12vw, 4rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--ds-water-a);
  line-height: 1.05;
}

.dash-hero-volume {
  margin-top: 0.35rem;
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--ds-text-secondary);
}

.dash-hero-status-row {
  margin-top: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-weight: 600;
  color: #475569;
}

.dash-badge {
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

.dash-badge-neutral {
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: var(--ds-muted-surface);
  color: var(--ds-text-secondary);
}

.dash-badge-ok {
  border: 1px solid rgba(22, 163, 74, 0.35);
  background: var(--ds-ok-surface);
  color: var(--ds-status-ok);
}

.dash-badge-warn {
  border: 1px solid rgba(245, 158, 11, 0.4);
  background: var(--ds-warn-surface);
  color: #b45309;
}

.dash-badge-danger {
  border: 1px solid rgba(220, 38, 38, 0.35);
  background: var(--ds-danger-surface);
  color: var(--ds-status-critical);
}

.dash-badge-muted {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: var(--ds-muted-surface);
  color: var(--ds-text-secondary);
}

.dash-hero-meta {
  margin: 0.65rem 0 0 0;
  font-size: 0.88rem;
  color: var(--ds-text-secondary);
}

.dash-hero-sensor {
  text-align: center;
}

.dash-hero-warn-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #c2410c;
}

.dash-hero-warn-sub {
  margin: 0.5rem 0 0 0;
  color: #64748b;
  font-weight: 600;
}

.dash-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
}

.dash-kpi-mini {
  border-radius: 0.85rem;
  border: 1px solid #dbe5f3;
  padding: 0.65rem 0.75rem;
  background: #ffffff;
}

.dash-kpi-mini-label {
  display: block;
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  font-weight: 600;
}

.dash-kpi-mini-val {
  display: block;
  margin-top: 0.2rem;
  font-weight: 800;
  font-size: 0.98rem;
  color: #0f172a;
}

.dash-section-title {
  margin: 0.35rem 0 0 0;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #64748b;
}

.dash-two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.85rem;
}

.dash-two-col.dash-weather-grid {
  align-items: stretch;
}

.diag-list {
  margin: 0;
  padding-left: 1.1rem;
  color: #334155;
  font-size: 0.9rem;
  line-height: 1.55;
}

.diag-list li {
  margin-bottom: 0.35rem;
}

.dash-muted {
  color: #64748b;
}

.dash-small {
  font-size: 0.82rem;
  line-height: 1.45;
}

.weather-live .weather-big {
  font-size: 2.4rem;
  font-weight: 800;
  color: #0284c7;
}

.weather-unit {
  font-size: 1.2rem;
  font-weight: 700;
  margin-left: 0.15rem;
}

.weather-desc {
  margin: 0.35rem 0 0.65rem 0;
  font-weight: 600;
  color: #334155;
}

.weather-dl {
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.weather-dl > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
}

.weather-dl dt {
  color: #64748b;
  font-weight: 600;
}

.weather-dl dd {
  margin: 0;
  font-weight: 700;
  color: #0f172a;
}

.recommend-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
  color: #0f766e;
}

.recommend-detail {
  margin: 0.45rem 0 0 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.dash-chart-wrap {
  margin-top: 0.65rem;
  position: relative;
  height: 200px;
}

.consumption-main {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.consumption-sub {
  margin: 0.35rem 0 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: #475569;
}

.pwa-dl {
  margin: 0.65rem 0;
  display: grid;
  gap: 0.4rem;
}

.pwa-dl > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.88rem;
}

.pwa-dl dt {
  color: #64748b;
  font-weight: 600;
}

.pwa-dl dd {
  margin: 0;
  font-weight: 700;
}

.pwa-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.dash-footer {
  margin-top: 0.5rem;
  padding: 0.75rem 0 1.25rem;
  font-size: 0.8rem;
  color: #64748b;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.dash-footer-sep {
  opacity: 0.45;
}

.rain-table-wrap {
  margin-top: 1rem;
  overflow-x: auto;
}

.rain-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.rain-table th,
.rain-table td {
  border-bottom: 1px solid var(--ds-border);
  padding: 0.45rem 0.35rem;
  text-align: left;
}

.rain-table th {
  color: var(--ds-text-secondary);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.weather-settings {
  border: 1px dashed var(--ds-border);
  border-radius: var(--ds-radius);
  padding: 0.85rem;
  background: color-mix(in srgb, var(--ds-bg) 65%, white);
  margin-bottom: 0.5rem;
}

/* ——— Feinschliff: Live-Pills, Tank, Wetter-SVG, Empfehlung, Mobile ——— */

.dash-header-left {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

@media (min-width: 480px) {
  .dash-header-left {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }
}

.dash-header-live {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: var(--ds-muted-surface);
  color: var(--ds-text-secondary);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ds-status-muted);
}

.live-pill[data-live-tone="ok"] {
  border-color: rgba(22, 163, 74, 0.35);
  background: var(--ds-ok-surface);
  color: var(--ds-status-ok);
}
.live-pill[data-live-tone="ok"] .live-dot {
  background: var(--ds-status-ok);
  animation: live-dot-pulse 2.4s ease-in-out infinite;
}

.live-pill[data-live-tone="warn"] {
  border-color: rgba(245, 158, 11, 0.4);
  background: var(--ds-warn-surface);
  color: #b45309;
}
.live-pill[data-live-tone="warn"] .live-dot {
  background: var(--ds-status-warn);
}

.live-pill[data-live-tone="danger"] {
  border-color: rgba(220, 38, 38, 0.35);
  background: var(--ds-danger-surface);
  color: var(--ds-status-critical);
}
.live-pill[data-live-tone="danger"] .live-dot {
  background: var(--ds-status-critical);
}

.live-pill[data-live-tone="muted"] {
  border-color: rgba(148, 163, 184, 0.35);
  background: var(--ds-muted-surface);
  color: var(--ds-text-secondary);
}
.live-pill[data-live-tone="muted"] .live-dot {
  background: var(--ds-status-muted);
}

.live-pill-api[data-api-tone="ok"] {
  border-color: rgba(22, 163, 74, 0.35);
  background: var(--ds-ok-surface);
  color: var(--ds-status-ok);
}
.live-pill-api[data-api-tone="ok"] .live-dot {
  background: var(--ds-status-ok);
}

.live-pill-api[data-api-tone="danger"] {
  border-color: rgba(220, 38, 38, 0.35);
  background: var(--ds-danger-surface);
  color: var(--ds-status-critical);
}
.live-pill-api[data-api-tone="danger"] .live-dot {
  background: var(--ds-status-critical);
}

.settings-btn-header {
  min-height: 44px;
  padding-left: 1.15rem;
  padding-right: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero-sensor-icon-wrap {
  margin: 0 auto 0.75rem auto;
  width: 4.5rem;
  height: 4.5rem;
  color: var(--ds-status-warn);
}

.hero-sensor-icon-wrap svg {
  width: 100%;
  height: 100%;
}

.dash-hero-warn-hint {
  margin: 0.65rem auto 0 auto;
  max-width: 28rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--ds-text-secondary);
}

/* Füllstand: 270°-Bogen (Canvas + Prozentmitte) */
.fillstand-gauge-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0 0.2rem;
  width: 100%;
}

.fillstand-gauge-box .arc-gauge-viewport {
  width: 100%;
  max-width: min(340px, 100%);
}

.fillstand-gauge-box .arc-gauge-center {
  bottom: 26%;
}

.fillstand-liters-sub {
  margin: 0.35rem 0 0 0;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ds-text-secondary);
  text-align: center;
}

.tank-footnote {
  margin-top: 0.65rem;
}

.weather-live-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}

@media (min-width: 480px) {
  .weather-live-split {
    grid-template-columns: auto 1fr;
    gap: 1.25rem;
  }
}

.weather-live-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.weather-icon-xl {
  width: 5rem;
  height: 5rem;
  color: var(--ds-weather-cloud);
}

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

.weather-temp-block {
  font-size: 2rem;
  font-weight: 800;
  color: var(--ds-primary);
  line-height: 1;
}

.weather-inline-icon {
  display: inline-flex;
  width: 1.15rem;
  height: 1.15rem;
  margin-right: 0.35rem;
  vertical-align: middle;
  color: var(--ds-water-a);
}

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

.weather-row dt {
  display: flex;
  align-items: center;
}

.recommend-card--spotlight {
  border-width: 1px;
  border-color: color-mix(in srgb, var(--ds-primary) 28%, var(--ds-border));
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--ds-primary) 7%, white) 0%,
    var(--ds-surface) 55%
  );
  box-shadow: var(--ds-shadow-md);
}

.recommend-card-inner {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.recommend-priority {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: var(--ds-muted-surface);
  color: var(--ds-text-secondary);
}

.recommend-priority[data-priority="niedrig"] {
  border-color: rgba(22, 163, 74, 0.35);
  background: var(--ds-ok-surface);
  color: var(--ds-status-ok);
}

.recommend-priority[data-priority="mittel"] {
  border-color: rgba(245, 158, 11, 0.4);
  background: var(--ds-warn-surface);
  color: #b45309;
}

.recommend-priority[data-priority="hoch"] {
  border-color: rgba(220, 38, 38, 0.35);
  background: var(--ds-danger-surface);
  color: var(--ds-status-critical);
}

.recommend-headline {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--ds-primary);
  letter-spacing: -0.02em;
}

.recommend-summary {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ds-text);
}

.recommend-rationale {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ds-text-secondary);
}

.consumption-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.consumption-stats-row {
  font-size: 0.95rem;
  font-weight: 600;
}

.dash-chart-wrap--rain {
  height: 140px;
}

.rain-forecast-scroll {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  padding: 0.35rem 0 0.65rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.rain-day-card {
  flex: 0 0 9.5rem;
  scroll-snap-align: start;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius);
  padding: 0.65rem 0.55rem;
  background: var(--ds-surface);
  box-shadow: var(--ds-shadow-sm);
  text-align: center;
}

.rain-day-icon {
  width: 2.25rem;
  height: 2.25rem;
  margin: 0 auto 0.35rem;
  color: var(--ds-weather-cloud);
}

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

.rain-day-weekday {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--ds-text);
}

.rain-day-meta {
  font-size: 0.78rem;
  color: var(--ds-text-secondary);
  margin-top: 0.25rem;
}

.rain-day-temp {
  font-size: 0.78rem;
  color: var(--ds-text-secondary);
  margin-top: 0.2rem;
}

@media (min-width: 768px) {
  .rain-forecast-scroll {
    display: none;
  }
}

@media (max-width: 767px) {
  .rain-table-desktop {
    display: none !important;
  }
}

.rain-th-icon {
  width: 2.5rem;
}

.rain-table-icon {
  display: inline-flex;
  width: 1.75rem;
  height: 1.75rem;
  color: var(--ds-weather-cloud);
}

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

/* Wetter-Icons: Farbe nach Typ (SVG nutzt currentColor) */
#weatherMainIcon[data-icon="sun"],
.weather-icon-xl[data-icon="sun"],
.rain-day-icon[data-icon="sun"],
.rain-table-icon[data-icon="sun"] {
  color: var(--ds-weather-sun);
}

#weatherMainIcon[data-icon="rain"],
#weatherMainIcon[data-icon="rain-heavy"],
.weather-icon-xl[data-icon="rain"],
.weather-icon-xl[data-icon="rain-heavy"],
.rain-day-icon[data-icon="rain"],
.rain-day-icon[data-icon="rain-heavy"],
.rain-table-icon[data-icon="rain"],
.rain-table-icon[data-icon="rain-heavy"] {
  color: var(--ds-weather-rain);
}

#weatherMainIcon[data-icon="cloud"],
#weatherMainIcon[data-icon="partly-cloudy"],
#weatherMainIcon[data-icon="fog"],
#weatherMainIcon[data-icon="snow"],
.weather-icon-xl[data-icon="cloud"],
.weather-icon-xl[data-icon="partly-cloudy"],
.weather-icon-xl[data-icon="fog"],
.weather-icon-xl[data-icon="snow"],
.rain-day-icon[data-icon="cloud"],
.rain-day-icon[data-icon="partly-cloudy"],
.rain-day-icon[data-icon="fog"],
.rain-day-icon[data-icon="snow"],
.rain-table-icon[data-icon="cloud"],
.rain-table-icon[data-icon="partly-cloudy"],
.rain-table-icon[data-icon="fog"],
.rain-table-icon[data-icon="snow"] {
  color: var(--ds-weather-cloud);
}

#weatherMainIcon[data-icon="thunder"],
.weather-icon-xl[data-icon="thunder"],
.rain-day-icon[data-icon="thunder"],
.rain-table-icon[data-icon="thunder"] {
  color: var(--ds-weather-storm);
}

@keyframes live-dot-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.92);
  }
}

@media (max-width: 430px) {
  .dash-title {
    font-size: 1.35rem;
  }
}

/* ——— Premium UI ——— */

.dashboard-body {
  padding-top: env(safe-area-inset-top, 0px);
  -webkit-overflow-scrolling: touch;
}

.sticky-summary {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.45rem 1rem;
  background: color-mix(in srgb, var(--ds-surface) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ds-border);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
  transform: translateY(-110%);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
  pointer-events: none;
}

.sticky-summary.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.sticky-summary-pct {
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--ds-water-a);
  font-variant-numeric: tabular-nums;
}

.sticky-summary-vol {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ds-text-secondary);
}

.sticky-summary-badge {
  font-size: 0.72rem;
}

.dash-hero--premium {
  background: linear-gradient(
    155deg,
    color-mix(in srgb, var(--ds-surface) 92%, white) 0%,
    color-mix(in srgb, var(--ds-water-a) 5%, white) 42%,
    color-mix(in srgb, var(--ds-bg) 70%, white) 100%
  );
  box-shadow: var(--ds-shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.dash-hero-hint {
  margin: 0.5rem 0 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ds-text);
}

.dash-hero-status-label {
  font-size: 0.88rem;
  color: var(--ds-text-secondary);
}

.tank-card--main {
  padding: 1.1rem 1rem 1.25rem;
  background: linear-gradient(
    165deg,
    color-mix(in srgb, var(--ds-surface) 94%, white) 0%,
    color-mix(in srgb, var(--ds-water-a) 5%, white) 50%,
    var(--ds-surface) 100%
  );
  box-shadow: var(--ds-shadow-md);
  border-radius: var(--ds-radius-hero);
}

.tank-main-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.tank-visual--hero {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0.35rem 0 0.15rem;
}

.tank-card--main .tank-shell,
.tank-card--premium .tank-visual .tank-shell {
  width: min(11rem, 42vw);
  height: min(17rem, 58vw);
  max-width: 200px;
  max-height: 300px;
}

.tank-card--premium .tank-visual,
.tank-card--main .tank-visual:not(.tank-visual--disabled) {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0 0.25rem;
}

.tank-shell {
  position: relative;
  width: min(11rem, 42vw);
  height: min(17rem, 58vw);
  border-radius: 1.1rem 1.1rem 0.65rem 0.65rem;
  border: 2px solid color-mix(in srgb, var(--ds-water-a) 35%, var(--ds-border));
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(241, 245, 249, 0.35) 100%
  );
  overflow: hidden;
  box-shadow: inset 0 2px 12px rgba(15, 23, 42, 0.04);
}

.tank-shell.is-empty-data {
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(241, 245, 249, 0.5);
}

.tank-water-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background: linear-gradient(180deg, var(--ds-water-b) 0%, var(--ds-water-a) 55%, #0e7490 100%);
  transition: height 0.85s cubic-bezier(0.33, 1, 0.68, 1);
}

.tank-shell.is-empty-data .tank-water-fill {
  background: transparent;
  height: 0 !important;
}

.tank-shell.is-empty-data .tank-water-surface {
  display: none;
  animation: none;
}

.tank-water-surface {
  position: absolute;
  top: -4px;
  left: -15%;
  width: 130%;
  height: 10px;
  background: color-mix(in srgb, var(--ds-water-b) 70%, white);
  border-radius: 45%;
  opacity: 0.85;
  animation: tank-surface-wave 4.5s ease-in-out infinite;
}

@keyframes tank-surface-wave {
  0%,
  100% {
    transform: translateX(0) scaleY(1);
  }
  50% {
    transform: translateX(4%) scaleY(0.92);
  }
}

.tank-card--main .tank-percent-inner {
  font-size: clamp(1.65rem, 7vw, 2.35rem);
}

.tank-percent-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--ds-text);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
  z-index: 2;
  font-variant-numeric: tabular-nums;
}

.tank-shell.is-empty-data .tank-percent-inner {
  color: var(--ds-text-disabled);
}

.tank-card--main .tank-liters-below {
  margin: 0.85rem 0 0.5rem;
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--ds-text);
}

.tank-liters-below {
  margin: 0.65rem 0 0.25rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ds-text-secondary);
}

.tank-status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.15rem;
}

.tank-status-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ds-text-secondary);
}

.tank-status-below {
  margin: 0;
}

.tank-last-meas,
.tank-water-height {
  margin: 0.35rem 0 0 0;
  font-size: 0.84rem;
  color: var(--ds-text-secondary);
}

.tank-water-height {
  font-weight: 600;
}

.tank-empty-state {
  text-align: center;
  padding: 0.5rem 0.25rem 0.75rem;
}

.tank-empty-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 0.65rem;
  color: var(--ds-status-warn);
}

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

.tank-empty-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: #c2410c;
}

.tank-empty-sub {
  margin: 0.4rem 0 0 0;
  font-weight: 600;
  color: var(--ds-text-secondary);
}

.tank-empty-hint {
  margin: 0.5rem auto 1rem;
  max-width: 22rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--ds-text-secondary);
}

.tank-visual--disabled {
  opacity: 0.85;
  pointer-events: none;
}

.dash-kpi-strip--details {
  grid-template-columns: repeat(2, 1fr);
}

.tank-footnote {
  text-align: center;
  font-size: 0.82rem;
  color: var(--ds-text-secondary);
}

.weather-card--compact .weather-live-compact {
  padding-top: 0.15rem;
}

.weather-compact-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.weather-icon-lg {
  width: 3.25rem;
  height: 3.25rem;
  flex-shrink: 0;
  color: var(--ds-weather-cloud);
}

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

.weather-compact-temp {
  font-size: 2rem;
  font-weight: 900;
  color: var(--ds-primary);
  line-height: 1;
}

.weather-desc-compact {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.92rem;
}

.weather-compact-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
}

.weather-compact-stats li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.45rem 0.4rem;
  border-radius: 0.65rem;
  background: color-mix(in srgb, var(--ds-bg) 55%, white);
  border: 1px solid var(--ds-border);
  min-height: 44px;
}

.weather-stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ds-text-secondary);
}

.weather-stat-val {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ds-text);
}

.recommend-weather-extra {
  margin: 0.35rem 0 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ds-water-a);
}

.diag-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.55rem;
}

.diag-metric {
  border: 1px solid var(--ds-border);
  border-radius: 0.75rem;
  padding: 0.6rem 0.65rem;
  background: color-mix(in srgb, var(--ds-bg) 40%, white);
}

.diag-metric-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ds-text-secondary);
}

.diag-metric-value {
  display: block;
  margin-top: 0.25rem;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--ds-text);
}

.diag-progress {
  margin-top: 0.4rem;
  height: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.diag-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ds-water-a), var(--ds-water-b));
  transition: width 0.7s ease;
}

.live-pill-sensor[data-sensor-tone="ok"] {
  border-color: rgba(22, 163, 74, 0.35);
  background: var(--ds-ok-surface);
  color: var(--ds-status-ok);
}
.live-pill-sensor[data-sensor-tone="ok"] .live-dot {
  background: var(--ds-status-ok);
  box-shadow: 0 0 6px rgba(22, 163, 74, 0.45);
}

.live-pill-sensor[data-sensor-tone="warn"] {
  border-color: rgba(245, 158, 11, 0.4);
  background: var(--ds-warn-surface);
  color: #b45309;
}
.live-pill-sensor[data-sensor-tone="warn"] .live-dot {
  background: var(--ds-status-warn);
}

.live-pill-sensor[data-sensor-tone="danger"],
.live-pill-sensor[data-sensor-tone="muted"] {
  border-color: rgba(148, 163, 184, 0.35);
  background: var(--ds-muted-surface);
  color: var(--ds-text-secondary);
}
.live-pill-sensor[data-sensor-tone="danger"] .live-dot {
  background: var(--ds-status-critical);
}

.pwa-install-banner {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ds-primary);
  background: color-mix(in srgb, var(--ds-primary) 8%, white);
  border: 1px solid color-mix(in srgb, var(--ds-primary) 22%, var(--ds-border));
}

.card--fade-in {
  animation: card-fade-in 0.45s ease both;
}

@keyframes card-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .mobile-tab-bar {
    padding: 0.35rem 0.45rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
    gap: 0.25rem;
    background: color-mix(in srgb, var(--ds-surface) 82%, transparent);
  }

  .mobile-tab-btn {
    min-height: 44px;
    border-radius: 14px;
    padding: 0.35rem 0.25rem;
  }

  .mobile-tab-btn.is-active {
    color: var(--ds-primary);
    background: color-mix(in srgb, var(--ds-water-a) 14%, white);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ds-water-a) 22%, transparent);
  }

  .dash-chart-wrap--line {
    height: min(42vw, 200px);
    min-height: 160px;
  }

  .rain-day-card {
    flex: 0 0 5.6rem;
    padding: 0.5rem 0.4rem;
  }

  .rain-day-card.is-today {
    border-color: color-mix(in srgb, var(--ds-water-a) 45%, var(--ds-border));
    background: color-mix(in srgb, var(--ds-water-a) 6%, white);
    box-shadow: var(--ds-shadow-md);
  }

  .rain-day-weekday {
    font-size: 0.82rem;
  }

  .rain-day-meta,
  .rain-day-temp {
    font-size: 0.7rem;
  }

  .rain-day-icon {
    width: 1.85rem;
    height: 1.85rem;
  }
}

/* iOS Toggle Switches */
.ios-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 44px;
  padding: 0.35rem 0;
  cursor: pointer;
  user-select: none;
}

.ios-toggle-label {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ds-text);
}

.ios-toggle-switch {
  position: relative;
  flex-shrink: 0;
  width: 3.1rem;
  height: 1.85rem;
}

.ios-toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}

.ios-toggle-track {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.25s ease;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.12);
}

.ios-toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
  transition: transform 0.25s cubic-bezier(0.33, 1, 0.68, 1);
}

.ios-toggle-switch input:checked + .ios-toggle-track {
  background: var(--ds-primary);
}

.ios-toggle-switch input:checked + .ios-toggle-track::after {
  transform: translateX(1.25rem);
}

.ios-toggle-switch input:focus-visible + .ios-toggle-track {
  outline: 2px solid var(--ds-water-a);
  outline-offset: 2px;
}

.settings-field {
  display: block;
  margin: 0.65rem 0;
}

.settings-field .input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  box-sizing: border-box;
}

.settings-card {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 1.1rem;
}

.dash-chart-wrap--line canvas {
  max-height: 220px;
}

@media (prefers-reduced-motion: reduce) {
  .tank-water-fill,
  .tank-water-surface,
  .sticky-summary,
  .card--fade-in,
  .live-pill[data-live-tone="ok"] .live-dot,
  .diag-progress-bar {
    animation: none !important;
    transition: none !important;
  }
}
