@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Nunito:wght@400;600;700&display=swap');

:root {
  --bg: #FFF8F0;
  --card: #FFFFFF;
  --text: #2B2118;
  --text-soft: #8A7A6B;
  --strom: #FFC94A;
  --gas: #FF8552;
  --wasser: #4FB6E8;
  --wallbox: #8B7CE8;
  --einspeisung: #5B8FA8;
  --balkonkraftwerk: #06A77D;
  --wechselrichter: #F2B705;
  --success: #06A77D;
  --error: #E25555;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow: 0 8px 24px rgba(43, 33, 24, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, .brand {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  margin: 0;
}

button {
  font-family: inherit;
  border: none;
  cursor: pointer;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 88px; /* Platz für Bottom-Nav */
}

.screen { padding: 24px 20px 8px; }
.hidden { display: none !important; }

/* --- Desktop/Browser-Ansicht: Arbeitsbereich deutlich breiter, Bottom-Nav
   bleibt bewusst unverändert schmal & zentriert (siehe .bottom-nav weiter
   unten - hat ihre eigene, von #app unabhängige Breite/Zentrierung). Erst
   ab echter Desktop-Breite aktiv, damit Tablets im Hochformat noch die
   normale, für Touch optimierte Mobil-Ansicht bekommen. */
@media (min-width: 900px) {
  #app {
    max-width: 1040px;
    padding-bottom: 100px;
  }
  .screen { padding: 32px 48px 8px; }

  /* Listen mit vielen gleichartigen Karten nutzen die Breite als
     Mehrspalten-Raster statt einer langen Einzelspalte - betrifft bewusst
     nur diese "Listen"-Bereiche, nicht z.B. Formulare oder Berichte mit
     Tabellen, die als durchgehender Textfluss weiterhin gut lesbar bleiben
     sollen. */
  #meter-list-full .meter-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 14px;
    align-items: start;
  }
  #meter-list-full .meter-card,
  #meter-list-full .meter-card-inactive {
    margin-bottom: 0;
  }
  #dash-due-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 12px;
  }
  #share-list, #capture-link-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
  }
}

/* --- Onboarding --- */
.onboarding {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 24px;
  text-align: center;
}

.logo-mark {
  width: 84px;
  height: 84px;
  margin: 0 auto 20px;
  border-radius: 26px;
  background: linear-gradient(135deg, var(--gas), var(--strom));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.logo-mark svg { width: 44px; height: 44px; }

/* --- Maskottchen "Ablo" --- */
.mascot {
  display: block;
  margin: 0 auto 12px;
  width: auto;
  filter: drop-shadow(0 10px 16px rgba(255, 133, 82, 0.25));
}
.mascot-lg { height: 150px; }
.mascot-md { height: 110px; }
.mascot-sm { height: 76px; margin-bottom: 8px; }

@keyframes mascot-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.mascot-bounce { animation: mascot-bounce 1.1s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .mascot-bounce { animation: none; }
}

.onboarding h1 { font-size: 30px; margin-bottom: 8px; }
.onboarding-brand {
  font-size: 40px;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.onboarding-brand span { color: var(--gas); font-weight: 700; }
.onboarding p.subtitle { color: var(--text-soft); margin-bottom: 32px; font-size: 15px; }

.field {
  text-align: left;
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text-soft);
}
.field input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 2px solid #F0E6D8;
  background: var(--card);
  font-size: 18px;
  letter-spacing: 2px;
  font-family: 'Nunito', sans-serif;
  color: var(--text);
}
.field input:focus { outline: none; border-color: var(--gas); }
.field small { display: block; margin-top: 6px; color: var(--text-soft); font-size: 12px; letter-spacing: 0; }

.btn-primary {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--gas);
  color: #fff;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 16px;
  box-shadow: var(--shadow);
}
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  margin-top: 12px;
  border: 2px solid #F0E6D8;
}

.btn-danger-link {
  width: 100%;
  padding: 10px;
  background: none;
  border: none;
  color: var(--error);
  font-weight: 700;
  font-size: 13.5px;
  margin-top: 16px;
  text-align: center;
}

.link-toggle {
  margin-top: 20px;
  color: var(--text-soft);
  font-size: 14px;
}
.link-toggle button { background: none; color: var(--gas); font-weight: 700; text-decoration: underline; }

.hero-lead {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.55;
  text-align: left;
  margin: -16px 0 24px;
}

.landing-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}
.landing-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow);
  text-align: left;
}
.landing-feature img {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}
.landing-feature h3 {
  font-size: 14.5px;
  margin: 0 0 4px;
}
.landing-feature p {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.4;
  margin: 0;
}

.login-prompt-card {
  background: #FFF3E0;
  border: 2px solid #F5D9B8;
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 20px 0 8px;
  text-align: center;
}
.login-prompt-card p {
  font-weight: 700;
  font-size: 14px;
  margin: 0 0 10px;
  color: var(--text);
}
.login-prompt-card .btn-secondary {
  width: 100%;
  border-color: var(--gas);
  color: var(--gas);
  font-weight: 700;
}

.legal-link {
  margin-top: 10px;
  text-align: center;
  font-size: 11.5px;
}
.legal-link a { color: var(--text-soft); text-decoration: underline; }

.highlights-card {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  text-align: left;
}
.highlight-item {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  padding: 5px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.highlight-item span { font-size: 15px; }

.dsgvo-badge {
  display: block;
  width: 92px;
  height: auto;
  margin: 18px 0 0 auto;
  border-radius: 14px;
  opacity: 0.9;
  box-shadow: 0 4px 12px rgba(43, 33, 24, 0.08);
}

.id-reveal {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.id-reveal .big-id {
  font-family: 'Fredoka', sans-serif;
  font-size: 42px;
  letter-spacing: 8px;
  color: var(--gas);
  margin: 12px 0;
}

.callout-warning {
  background: #FFF3E0;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 13px;
  color: #8A5A2B;
  text-align: left;
}

/* --- Header --- */
.top-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px 4px;
}
.top-bar .brand { font-size: 22px; }
.top-bar .brand span { color: var(--gas); }
.brand-mark span { color: var(--gas); }
.topbar-mascot {
  width: 38px;
  height: 38px;
  object-fit: cover;
  object-position: center bottom;
  border-radius: 50%;
  background: #FFF3E8;
  border: 2px solid #FFDFC7;
  filter: drop-shadow(0 3px 6px rgba(255, 133, 82, 0.2));
}

/* --- Hero capture button --- */
.capture-hero {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  margin: 8px 0 24px;
}
.capture-hero p { color: var(--text-soft); margin: 6px 0 20px; font-size: 14px; }
.capture-btn {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 10px 28px rgba(255, 133, 82, 0.35);
}
.capture-btn-icon { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.capture-btn:active { transform: scale(0.96); }

/* --- Meter cards --- */
.section-title {
  font-size: 15px;
  color: var(--text-soft);
  font-weight: 700;
  margin: 20px 0 10px;
  text-transform: none;
}

.meter-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s;
}
.meter-card.dragging {
  box-shadow: 0 12px 28px rgba(43, 33, 24, 0.22);
  opacity: 0.9;
  z-index: 5;
  position: relative;
}
.drag-handle {
  flex-shrink: 0;
  width: 28px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-soft);
  cursor: grab;
  touch-action: none;
}
.drag-handle:active { cursor: grabbing; }
.meter-card-inactive {
  opacity: 0.6;
  box-shadow: none;
  border: 2px dashed #E5DBCC;
}
.inactive-meters-divider {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 22px 0 14px;
  padding-top: 14px;
  border-top: 1px solid #EDE1D1;
  color: var(--text-soft);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 13.5px;
}
.badge-inactive {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-soft);
  background: #EFE7DA;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}
.meter-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.meter-icon svg { width: 24px; height: 24px; }
.meter-icon.strom { background: color-mix(in srgb, var(--strom) 25%, white); }
.meter-icon.gas { background: color-mix(in srgb, var(--gas) 20%, white); }
.meter-icon.wasser { background: color-mix(in srgb, var(--wasser) 20%, white); }

.meter-info { flex: 1; min-width: 0; }
.meter-info .name { font-weight: 700; font-size: 15px; }
.meter-info .meta { color: var(--text-soft); font-size: 13px; }
.meter-value { text-align: right; font-family: 'Fredoka', sans-serif; font-weight: 600; }
.meter-value .unit { font-size: 11px; color: var(--text-soft); font-family: 'Nunito', sans-serif; }
.last-reading-note {
  font-size: 10.5px;
  color: var(--text-soft);
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  margin-top: 3px;
  white-space: nowrap;
}
.last-reading-note.overdue {
  color: var(--error);
}
.plan-lapsed-note {
  color: #A0691F !important;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.link-inline {
  background: none;
  border: none;
  padding: 0;
  color: #A0691F;
  font-weight: 700;
  font-size: inherit;
  font-family: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.crop-viewport {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #1a1a1a;
  touch-action: none;
  cursor: grab;
}
.crop-viewport:active { cursor: grabbing; }
.crop-viewport img {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
}
.crop-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 84%;
  height: 56%;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  border-radius: 10px;
  box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.meter-value .value-row { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.value-edit-btn {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #FFF3E8;
  font-size: 12px;
  font-family: 'Nunito', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}
.value-edit-btn:active { transform: scale(0.9); }

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-soft);
}

.fab-add {
  position: fixed;
  right: 50%;
  transform: translateX(178px);
  bottom: 100px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}
@media (max-width: 460px) {
  .fab-add { right: 20px; transform: none; }
}

/* --- Ablo-Chat: schwebende Sprechblase + Chat-Fenster --- */
.chatbot-panel {
  position: fixed;
  right: 12px;
  bottom: 96px;
  width: min(360px, calc(100vw - 24px));
  height: min(520px, calc(100vh - 180px));
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(43, 33, 24, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 41;
}
.chatbot-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px;
  background: #FFF3E8;
  flex-shrink: 0;
}
.chatbot-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.chatbot-title { font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 15px; }
.chatbot-subtitle { font-size: 11px; color: var(--text-soft); }
.chatbot-close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 16px;
  color: var(--text-soft);
  padding: 6px;
}
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chatbot-msg {
  max-width: 85%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
}
.chatbot-msg.assistant {
  background: #FFF3E8;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chatbot-msg.user {
  background: var(--gas);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chatbot-msg.thinking { color: var(--text-soft); font-style: italic; }
.chatbot-support-note {
  margin: 0 14px 10px;
  padding: 10px 12px;
  background: #FBF3E8;
  border-radius: 12px;
  font-size: 12.5px;
  color: var(--text-soft);
}
.chatbot-support-note a { color: var(--gas); font-weight: 700; }
.chatbot-input-row {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #F0E6D8;
  flex-shrink: 0;
}
.chatbot-input-row input {
  flex: 1;
  border: 1px solid #E5DCCB;
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 13.5px;
  font-family: inherit;
}
.chatbot-input-row button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gas);
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
}
.chatbot-input-row button:disabled { opacity: 0.5; }

/* --- Bottom nav --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -6px 20px rgba(43, 33, 24, 0.08);
  display: flex;
  justify-content: space-around;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}
.nav-item {
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 700;
  padding: 6px 8px;
  border-radius: 14px;
}
.nav-item svg { width: 20px; height: 20px; }
.nav-item-chatbot img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.nav-item.active { color: var(--gas); background: #FFF3E8; }

/* --- Modal (add meter / confirm reading) --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(43, 33, 24, 0.4);
  display: flex;
  align-items: flex-end;
  z-index: 50;
}
.modal-sheet {
  background: var(--bg);
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  border-radius: 28px 28px 0 0;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  max-height: 88vh;
  overflow-y: auto;
}
.modal-sheet h2 { margin-bottom: 16px; }

select {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 2px solid #F0E6D8;
  background: var(--card);
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  color: var(--text);
}

.type-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.type-chip {
  flex: 1;
  padding: 14px 8px;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 2px solid #F0E6D8;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
}
.type-chip.selected.strom { border-color: var(--strom); background: color-mix(in srgb, var(--strom) 20%, white); }
.type-chip.selected.gas { border-color: var(--gas); background: color-mix(in srgb, var(--gas) 15%, white); }
.type-chip.selected.wasser { border-color: var(--wasser); background: color-mix(in srgb, var(--wasser) 15%, white); }
.type-chip.selected.wallbox { border-color: var(--wallbox); background: color-mix(in srgb, var(--wallbox) 15%, white); }
.type-chip.selected.einspeisung { border-color: var(--einspeisung); background: color-mix(in srgb, var(--einspeisung) 15%, white); }
.type-chip.selected.balkonkraftwerk { border-color: var(--balkonkraftwerk); background: color-mix(in srgb, var(--balkonkraftwerk) 15%, white); }
.type-chip.selected.wechselrichter { border-color: var(--wechselrichter); background: color-mix(in srgb, var(--wechselrichter) 15%, white); }

/* Horizontal scrollbares Icon-Menü zum Durchwechseln zwischen Zählern
   (z.B. in den Berichten) - ersetzt ein simples <select>-Dropdown durch
   eine schönere, mit dem Finger durchwischbare Pillen-Leiste. */
.meter-slider-wrap { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.meter-slider-arrow {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #F0E6D8;
  background: var(--card);
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(43,33,24,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 2px;
  transition: opacity 0.15s;
}

.meter-slider {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 4px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.meter-slider::-webkit-scrollbar { display: none; }
.meter-slider-item {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  padding: 7px 16px 7px 7px;
  border-radius: 999px;
  border: 2px solid #F0E6D8;
  background: var(--card);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-soft);
  scroll-snap-align: start;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.meter-slider-item .meter-icon { width: 30px; height: 30px; flex-shrink: 0; }
.meter-slider-item .meter-icon svg { width: 16px; height: 16px; }
.meter-slider-item.selected { color: var(--text); }
.meter-slider-item.selected.strom { border-color: var(--strom); background: color-mix(in srgb, var(--strom) 18%, white); }
.meter-slider-item.selected.gas { border-color: var(--gas); background: color-mix(in srgb, var(--gas) 15%, white); }
.meter-slider-item.selected.wasser { border-color: var(--wasser); background: color-mix(in srgb, var(--wasser) 15%, white); }
.meter-slider-item.selected.wallbox { border-color: var(--wallbox); background: color-mix(in srgb, var(--wallbox) 15%, white); }
.meter-slider-item.selected.einspeisung { border-color: var(--einspeisung); background: color-mix(in srgb, var(--einspeisung) 15%, white); }
.meter-slider-item.selected.balkonkraftwerk { border-color: var(--balkonkraftwerk); background: color-mix(in srgb, var(--balkonkraftwerk) 15%, white); }
.meter-slider-item.selected.wechselrichter { border-color: var(--wechselrichter); background: color-mix(in srgb, var(--wechselrichter) 15%, white); }
.meter-slider-item .sub { display: block; font-weight: 500; color: var(--text-soft); font-size: 10.5px; }

.monthly-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
  margin-bottom: 10px;
  cursor: pointer;
}
.monthly-toggle input[type="checkbox"] { width: 17px; height: 17px; accent-color: #FF8552; }

.photo-preview {
  width: 100%;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  max-height: 260px;
  object-fit: cover;
}

.suggested-value {
  text-align: center;
  margin-bottom: 16px;
}
.suggested-value .big-number {
  font-family: 'Fredoka', sans-serif;
  font-size: 40px;
  color: var(--gas);
}
.confidence-note {
  text-align: center;
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 16px;
}

/* --- Reports --- */
.report-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.report-card-inactive {
  opacity: 0.6;
  box-shadow: none;
  border: 2px dashed #E5DBCC;
}

/* --- Zusatzpakete / Billing --- */
.interval-picker {
  display: flex;
  gap: 6px;
  background: #F5EEE3;
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 16px;
}
.interval-pill {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 8px 6px;
  font-size: 10.5px;
  line-height: 1.25;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  color: var(--text-soft);
  cursor: pointer;
  text-align: center;
}
.interval-pill.active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.plan-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.plan-card {
  position: relative;
  border: 2px solid #F5EEE3;
  border-radius: var(--radius-md);
  padding: 16px;
  background: #FFFDFA;
}
.plan-card.plan-unlocked {
  border-color: var(--success);
  background: #F3FBF7;
}
.plan-card.plan-bundle {
  border-color: #FF8552;
  background: #FFF6F0;
}
.plan-bundle-tag {
  position: absolute;
  top: -11px;
  left: 14px;
  background: #FF8552;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.plan-card-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.plan-icon { font-size: 24px; line-height: 1; }
.plan-title { font-weight: 700; font-size: 15px; font-family: 'Fredoka', sans-serif; }
.plan-pitch { font-size: 12.5px; color: var(--text-soft); margin-top: 3px; line-height: 1.4; }
.plan-price-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.plan-price { font-size: 22px; font-weight: 700; font-family: 'Fredoka', sans-serif; }
.plan-price-unit { font-size: 12.5px; color: var(--text-soft); }
.plan-savings {
  display: block;
  width: 100%;
  font-size: 11px;
  font-weight: 700;
  color: var(--success);
  margin-top: 4px;
}
.plan-action { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.plan-badge-active {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--success);
  background: #E3F6EE;
  padding: 5px 12px;
  border-radius: 999px;
}

.api-token-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #F5EEE3;
}
.api-token-row:last-child { border-bottom: none; }
.api-token-label { font-weight: 700; font-size: 13px; }
.api-token-meta { font-size: 11.5px; color: var(--text-soft); margin-top: 2px; }
.api-docs-link {
  display: block;
  margin-top: 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gas);
  text-decoration: underline;
}

.ff-celebration {
  text-align: center;
  padding: 8px 4px 4px;
  position: relative;
}
.ff-mascot {
  width: 88px;
  height: 88px;
  object-fit: contain;
  margin: 0 auto 10px;
  display: block;
}
.ff-celebration h3 {
  font-size: 17px;
  margin: 0 0 8px;
}
.ff-celebration > p {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.5;
  margin: 0 0 18px;
}
.ff-share {
  background: #FFF3E0;
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: left;
}
.ff-share-label {
  font-weight: 700;
  font-size: 13px;
  margin: 0 0 10px;
  text-align: center;
}
.ff-share-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.ff-share-btn {
  flex: 1;
  min-width: 96px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  font-weight: 700;
  font-size: 12.5px;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  color: #fff;
  display: inline-block;
}
.ff-share-btn.whatsapp { background: #25D366; }
.ff-share-btn.email { background: #5B9BD5; }
.ff-share-btn.copy { background: var(--gas); }

.confetti-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 5;
  border-radius: inherit;
}
.confetti-piece {
  position: absolute;
  top: -14px;
  width: 8px;
  height: 14px;
  opacity: 0.9;
  border-radius: 2px;
  animation-name: confetti-fall;
  animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1);
  animation-fill-mode: forwards;
}
@keyframes confetti-fall {
  to {
    transform: translateY(380px) rotate(var(--rot, 360deg));
    opacity: 0;
  }
}

.report-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #F5EEE3;
  font-size: 14px;
}
.report-row:last-child { border-bottom: none; }
.report-row .date { color: var(--text-soft); }
.report-row .cost { color: var(--success); font-weight: 700; }
.report-row .cost.income { color: var(--success); }
.reading-correction-btn {
  background: none;
  border: none;
  font-size: 15px;
  cursor: pointer;
  padding: 0 0 0 8px;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.75;
}
.reading-correction-btn:hover { opacity: 1; }
.self-consumption-line {
  font-size: 11.5px;
  color: var(--text-soft);
  padding: 0 0 8px;
  margin-top: -4px;
}
.badge-predecessor {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  color: #5B8FA8;
  background: #E7EFF3;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}
.meter-change-row {
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-soft);
  background: #F5EEE3;
  border-radius: 999px;
  padding: 6px 10px;
  margin: 8px 0;
}

.alert-inline {
  background: #FFF3E0;
  color: #8A5A2B;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12.5px;
  margin-bottom: 16px;
}

.alert-danger {
  background: #FDEBEB;
  color: #A02020;
  border: 1.5px solid #F0B8B8;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.alert-danger strong { display: block; margin-bottom: 4px; font-size: 13px; }

/* --- Pill-Buttons (Kopfzeilen-Aktionen) --- */
.btn-pill {
  background: var(--card);
  border: 2px solid #F0E6D8;
  color: var(--text);
  font-weight: 700;
  font-size: 12.5px;
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.btn-pill:active { transform: scale(0.97); }

/* --- KPI-Karten --- */
.kpi-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.kpi-card {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow);
}
.kpi-card .label { font-size: 11.5px; color: var(--text-soft); font-weight: 700; margin-bottom: 4px; }
.kpi-card .value { font-family: 'Fredoka', sans-serif; font-size: 20px; color: var(--text); }
.kpi-card .value.positive { color: var(--error); }
.kpi-card .value.negative { color: var(--success); }
.kpi-card .sub { font-size: 11px; color: var(--text-soft); margin-top: 2px; }

/* --- Sparpotenzial-Karte --- */
.savings-card {
  background: linear-gradient(135deg, #E8F7F1, #F3FBF8);
  border: 2px solid #CDEEE1;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}
.savings-card .headline { font-weight: 700; color: #067A5A; font-size: 14px; margin-bottom: 4px; }
.savings-card .fun-compare {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  background: rgba(255,255,255,0.6);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 10px;
  display: inline-block;
}
.savings-card .detail { font-size: 12.5px; color: var(--text-soft); margin-bottom: 12px; }

.plz-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.plz-pencil {
  background: rgba(255,255,255,0.7);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}
.plz-pencil:hover { transform: scale(1.12) rotate(-8deg); }
.plz-pencil:active { transform: scale(0.95); }
.savings-card .plz-prompt { font-size: 13px; color: var(--text); margin-bottom: 10px; }
.savings-card .plz-inline { display: flex; gap: 8px; margin-bottom: 10px; }
.savings-card .plz-inline input {
  flex: 1; padding: 10px 12px; border-radius: var(--radius-sm); border: 2px solid #CDEEE1;
  font-size: 15px; letter-spacing: 1px;
}

/* --- Vertragshistorie --- */
.contract-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #F5EEE3;
  font-size: 13px;
  gap: 8px;
}
.contract-row:last-child { border-bottom: none; }
.contract-row .period { color: var(--text-soft); font-size: 12px; }
.contract-row .provider { font-weight: 700; }
.contract-row .price { text-align: right; white-space: nowrap; }
.contract-row .badge-current {
  display: inline-block; font-size: 10px; font-weight: 700; color: var(--success);
  background: #E3F6EE; padding: 2px 7px; border-radius: 999px; margin-left: 6px;
}
.contract-row .badge-cancelled {
  display: inline-block; font-size: 10px; font-weight: 700; color: #A02020;
  background: #FDEBEB; padding: 2px 7px; border-radius: 999px; margin-left: 6px;
}
.contract-edit-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #FFF3E8;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.contract-edit-btn:active { transform: scale(0.92); }

.chart-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.chart-card canvas { max-height: 220px; }

/* --- Share-Link-Liste --- */
.share-row {
  padding: 12px 0;
  border-bottom: 1px solid #F5EEE3;
}
.share-row:last-child { border-bottom: none; }
.share-row .top-line { display: flex; justify-content: space-between; align-items: center; }
.share-row .label { font-weight: 700; font-size: 14px; }
.share-row .meta { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.share-row .actions { display: flex; gap: 8px; margin-top: 8px; }
.share-row .actions button {
  background: #F5EEE3; border-radius: var(--radius-sm); padding: 6px 12px; font-size: 12px; font-weight: 700;
}
.share-row .actions button.revoke { color: var(--error); }
.share-row.revoked { opacity: 0.5; }
.status-dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; }
.status-dot.active { background: var(--success); }
.status-dot.inactive { background: var(--error); }

.meter-icon.wallbox { background: color-mix(in srgb, var(--wallbox) 22%, white); }
.meter-icon.einspeisung { background: color-mix(in srgb, var(--einspeisung) 22%, white); }
.meter-icon.balkonkraftwerk { background: color-mix(in srgb, var(--balkonkraftwerk) 22%, white); }
.meter-icon.wechselrichter { background: color-mix(in srgb, var(--wechselrichter) 22%, white); }

/* --- Verbrauchsänderungs-Notiz (dezent, standardmäßig eingeklappt) --- */
#event-note-section { margin: 14px 0; }
.event-note-toggle {
  background: none;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 0;
  text-align: left;
  width: 100%;
}
.event-note-toggle .muted-inline { font-weight: 400; color: var(--text-soft); }

.manual-entry-link {
  display: block;
  width: 100%;
  background: none;
  color: var(--text-soft);
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  padding: 12px 0;
  text-decoration: underline;
}

/* --- Toggle-Switch --- */
.toggle-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #E5DBCC; border-radius: 999px; transition: 0.2s;
}
.toggle-slider::before {
  content: ""; position: absolute; height: 20px; width: 20px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--gas); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
.event-note-hint { font-size: 12px; color: var(--text-soft); margin: 4px 0 10px; }
.event-chip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.event-chip {
  background: var(--card);
  border: 2px solid #F0E6D8;
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  font-size: 12.5px;
  font-weight: 700;
  text-align: left;
  line-height: 1.3;
}
.event-chip.selected { border-color: var(--gas); background: #FFF3E8; color: var(--gas); }

.event-note-line {
  font-size: 11.5px;
  color: var(--gas);
  padding: 0 0 8px;
  margin-top: -4px;
}

/* --- Zähler-Mehrfachauswahl (Checkbox-Chips) --- */
.meter-checkbox-list { display: flex; flex-direction: column; gap: 8px; }
.meter-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 2px solid #F0E6D8;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
}
.meter-checkbox.selected { border-color: var(--gas); background: #FFF3E8; }
.meter-checkbox input { width: 18px; height: 18px; accent-color: var(--gas); }
.meter-checkbox .mc-name { font-weight: 700; font-size: 13.5px; }
.meter-checkbox .mc-meta { font-size: 11.5px; color: var(--text-soft); }

.factor-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.factor-item { text-align: center; }
.factor-item label { font-size: 10.5px; color: var(--text-soft); font-weight: 700; display: block; margin-bottom: 4px; }
.factor-item input {
  width: 100%; padding: 8px 4px; text-align: center; border-radius: 10px;
  border: 2px solid #F0E6D8; font-size: 13px; font-family: inherit;
}

.reverse-meter-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #FFF3E8;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
}
.reverse-meter-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--gas); flex-shrink: 0; }
.reverse-meter-check span { font-weight: 700; font-size: 13.5px; }

.period-toggle {
  display: flex;
  border: 2px solid #F0E6D8;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.period-toggle button {
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  background: var(--card);
  white-space: nowrap;
}
.period-toggle button.active { background: var(--gas); color: #fff; }

.skeleton-loading {
  color: var(--text-soft);
  font-size: 12.5px;
  padding: 8px 0;
}

/* --- Dashboard: kompakte Stat-Zeile + fällige Ablesungen --- */
.dash-stat-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.dash-stat {
  flex: 1;
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  text-align: center;
}
.dash-stat .value { font-family: 'Fredoka', sans-serif; font-size: 24px; color: var(--text); line-height: 1; }
.dash-stat .value.warn { color: var(--gas); }
.dash-stat .label { font-size: 11px; color: var(--text-soft); font-weight: 700; margin-top: 4px; }

.dash-catchup-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 12px;
  box-shadow: var(--shadow);
}
.dash-catchup-card .icon { font-size: 22px; flex-shrink: 0; }
.dash-catchup-card .text { flex: 1; font-size: 13px; font-weight: 700; color: var(--text-soft); }
.dash-catchup-btn {
  flex-shrink: 0;
  background: none;
  border: 2px solid #F0E6D8;
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}

.dash-due-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.dash-due-item .meter-icon { width: 40px; height: 40px; flex-shrink: 0; }
.dash-due-item .info { flex: 1; min-width: 0; }
.dash-due-item .name { font-weight: 700; font-size: 13.5px; }
.dash-due-item .meta { font-size: 11.5px; color: var(--error); font-weight: 700; }
.dash-due-item button {
  background: var(--gas);
  color: #fff;
  font-weight: 700;
  font-size: 12.5px;
  padding: 9px 14px;
  border-radius: 999px;
  flex-shrink: 0;
}

.dash-all-good {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  color: var(--text-soft);
  font-size: 13.5px;
}
.dash-all-good img { width: 56px; margin-bottom: 8px; }

/* --- Teilen-Buttons (WhatsApp / Mail / Kopieren) --- */
.share-channel-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 14.5px;
  margin-bottom: 10px;
  border: none;
  text-decoration: none;
  color: #fff;
  box-sizing: border-box;
}
.share-channel-btn span { font-size: 18px; }
.share-channel-btn.whatsapp { background: #25D366; }
.share-channel-btn.mail { background: #4A90D9; }
.share-channel-btn.copy { background: var(--card); color: var(--text); border: 2px solid #F0E6D8; }

.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  z-index: 100;
}
.toast.error { background: var(--error); }
