/* ================================================================
   home&smart Rechner-Hub — Shared Design Tokens
   ----------------------------------------------------------------
   Basis-Design-System für alle Rechner. Jeder Rechner lädt diese
   Datei ZUERST und ergänzt dann eigene spezifische Styles in seiner
   lokalen style.css.

   Enthält:
     - CSS-Custom-Properties (Boston Blue, Golden Grass, Warm Coffee,
       Boticelli, Mercury, Mine Shaft)
     - Basis-Typographie (Inter via Google Fonts)
     - Chip-, Button-, Input-, Progress-Bar-Styles
     - Produkt-Karten-Basis
     - Utility-Klassen
   ================================================================ */

/* ---------- Farben & Tokens ---------- */
:root {
  /* Primärfarben home&smart */
  --c-primary:       #378CB5;   /* Boston Blue */
  --c-primary-dark:  #155A7B;
  --c-primary-light: #EAF1F6;   /* Boticelli */
  --c-primary-mid:   #96B7D2;

  /* Sekundärfarben */
  --c-coffee:        #816050;   /* Warm Coffee */
  --c-coffee-light:  #D5C4BC;

  --c-accent:        #D5A91A;   /* Golden Grass */
  --c-accent-light:  #F6E6A8;

  /* Neutralfarben */
  --c-bg:            #FFFFFF;
  --c-bg-soft:       #F7F9FB;
  --c-border:        #E3E3E3;   /* Mercury */
  --c-border-strong: #B7B7B7;
  --c-text:          #222222;   /* Mine Shaft */
  --c-text-soft:     #555555;
  --c-text-muted:    #888888;

  /* Semantik */
  --c-success:       #2E7D32;
  --c-warning:       #E6A700;
  --c-danger:        #C62828;

  /* Radii & Spacing */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(34,34,34,.06);
  --shadow-md: 0 4px 12px rgba(34,34,34,.08);
  --shadow-lg: 0 8px 24px rgba(34,34,34,.10);

  /* Fonts */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* Mobile-Safety — verhindert horizontalen Overflow in schmalen iframes
   (WordPress-Sidebar-Embeds können unter 320 px fallen). */
html, body { max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

h1, h2, h3, h4 { margin: 0 0 12px; font-weight: 700; line-height: 1.25; color: var(--c-text); }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
p { margin: 0 0 12px; }

a { color: var(--c-primary-dark); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--c-primary); }

small { font-size: 13px; color: var(--c-text-soft); }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 10px 16px;
  background: #fff;
  border: 1.5px solid var(--c-border);
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text);
  cursor: pointer;
  transition: all .15s;
}
.chip:hover { border-color: var(--c-border-strong); }
.chip.active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
  font-weight: 600;
}
.chips-lg .chip { padding: 12px 18px; font-size: 15px; }

/* Empfehlungs-Marker: goldener Rand + Stern-Badge oben rechts. */
.chip.is-recommended {
  position: relative;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 1px var(--c-accent) inset;
}
.chip.is-recommended::after {
  content: "★";
  position: absolute;
  top: -7px;
  right: -7px;
  width: 18px;
  height: 18px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: var(--c-accent);
  background: #fff;
  border: 1.5px solid var(--c-accent);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chip.is-recommended.active {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 1.5px var(--c-accent) inset;
}
.chip.is-recommended.active::after {
  background: var(--c-accent);
  color: #fff;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: var(--r-md);
  border: 1.5px solid transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all .15s;
}
.btn-primary {
  background: var(--c-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--c-primary-dark); color: #fff; }
.btn-secondary {
  background: #fff;
  color: var(--c-text);
  border-color: var(--c-border);
}
.btn-secondary:hover { border-color: var(--c-primary); color: var(--c-primary); }
.btn-ghost {
  background: transparent;
  color: var(--c-text-soft);
  border: none;
  padding: 10px 14px;
}
.btn-ghost:hover { color: var(--c-primary); }

/* ---------- Inputs ---------- */
.input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 15px;
  color: var(--c-text);
  background: #fff;
  transition: border-color .15s;
}
.input:focus {
  outline: none;
  border-color: var(--c-primary);
}
.input-suffix {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  background: #fff;
  overflow: hidden;
}
.input-suffix input {
  flex: 1;
  padding: 12px 14px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  color: var(--c-text);
  outline: none;
}
.input-suffix span {
  padding: 0 16px;
  color: var(--c-text-soft);
  font-size: 14px;
  border-left: 1px solid var(--c-border);
  font-weight: 500;
  display: flex;
  align-items: center;
}

/* ---------- Progress-Bar ---------- */
.progress-wrap { margin-bottom: 20px; }
.progress-label {
  font-size: 13px;
  color: var(--c-text-soft);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}
.progress-label strong { color: var(--c-primary-dark); font-weight: 800; }
.progress-bar {
  height: 6px;
  background: var(--c-border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--c-primary), var(--c-primary-dark));
  border-radius: 999px;
  transition: width .3s ease;
}

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* ---------- Disclaimer / Meta-Text ---------- */
.disclaimer {
  font-size: 12px;
  color: var(--c-text-muted);
  margin-top: 16px;
  line-height: 1.5;
}
.note {
  font-size: 13px;
  color: var(--c-text-soft);
  background: var(--c-primary-light);
  border-left: 3px solid var(--c-primary);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  margin: 12px 0;
}

/* ---------- Mobile-Basis ---------- */
@media (max-width: 520px) {
  body { font-size: 15px; }
  h1 { font-size: 24px; }
  h2 { font-size: 20px; }
  .btn { padding: 11px 18px; font-size: 14px; }
}

/* Schmale Screens (~iPhone SE, Sidebar-Embeds): kompaktere Steuerelemente,
   damit Chip-Rows wrappen und nicht horizontal scrollen. */
@media (max-width: 380px) {
  body { font-size: 14px; line-height: 1.5; }
  h1 { font-size: 20px; }
  h2 { font-size: 17px; }
  h3 { font-size: 15px; }
  .chip { padding: 8px 12px; font-size: 13px; }
  .chips { gap: 6px; }
  .chips-lg .chip { padding: 10px 14px; font-size: 14px; }
  .btn { padding: 10px 14px; font-size: 13px; }
  .card { padding: 14px; }
  .input, .input-suffix input { padding: 10px 12px; font-size: 14px; }
  .input-suffix span { padding: 0 12px; font-size: 13px; }
}

/* Sehr schmale Screens (<= 340 px) — Fallback für Sidebar-Embeds auf Phones */
@media (max-width: 340px) {
  .chip { padding: 7px 10px; font-size: 12px; }
  .chips-lg .chip { padding: 9px 12px; font-size: 13px; }
  .btn { padding: 9px 12px; font-size: 12.5px; }
  .card { padding: 12px; }
}

/* Mobile-Header: Meta-Zusatz ("kostenlos & unverbindlich" / "pro Jahr" etc.)
   wird unter 440 px ausgeblendet, damit der Titel Platz hat. Höhere Spezifität
   (.app-header > …) gewinnt über die rechner-lokalen Regeln. */
@media (max-width: 440px) {
  .app-header .app-header-meta { display: none; }
}

/* ================================================================
   Redaktionelle Elemente — shared across all calculators
   ----------------------------------------------------------------
   h&s Tipp-Box · Methodik-Panel · Changelog-Panel im Trust-Strip
   Aliases: --c-text-mute / --c-text-muted, --radius-sm / --r-md
   ================================================================ */

/* ---------- h&s Tipp (warme Redaktions-Box) ---------- */
.hs-tip {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: linear-gradient(135deg, #FFF9E6, #FCE9B7);
  border-left: 4px solid var(--c-accent);
  border-radius: var(--r-md, 10px);
  padding: 12px 14px;
  margin: 14px 0 4px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--c-text);
}
.hs-tip-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--c-accent);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  margin-top: 1px;
}
.hs-tip-body > strong {
  display: block;
  color: #8A6A00;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
  font-weight: 800;
}
.hs-tip-verdict { margin: 18px 0 6px; font-size: 14px; padding: 16px 18px; }
.hs-tip-verdict[hidden] { display: none; }
.hs-tip-verdict-good { background: linear-gradient(135deg, #E6F5D8, #CDE9A8); border-left-color: var(--c-success, #78B330); }
.hs-tip-verdict-good .hs-tip-icon { background: var(--c-success, #78B330); }
.hs-tip-verdict-good .hs-tip-body > strong { color: #3D6A0D; }
.hs-tip-verdict-ok { background: linear-gradient(135deg, #FFF9E6, #FCE9B7); border-left-color: var(--c-accent); }
.hs-tip-verdict-warn { background: linear-gradient(135deg, #FDE6E1, #FAD0C7); border-left-color: var(--c-danger, #C74333); }
.hs-tip-verdict-warn .hs-tip-icon { background: var(--c-danger, #C74333); }
.hs-tip-verdict-warn .hs-tip-body > strong { color: #A52F22; }

.hs-verdict-headline { display: block; font-size: 18px; font-weight: 800; color: var(--c-text); line-height: 1.2; margin: 2px 0 6px; letter-spacing: -0.015em; }
.hs-verdict-lead { display: block; font-size: 14px; font-weight: 500; color: var(--c-text); line-height: 1.45; margin-bottom: 8px; }
.hs-verdict-lead strong { font-weight: 800; }
.hs-verdict-body { display: block; font-size: 13px; color: var(--c-text-soft); line-height: 1.5; }

/* ---------- Methodik-Panel (kompakt, zurückhaltend) ---------- */
.methodology { margin: 12px 0; overflow: hidden; }
.methodology-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  background: transparent;
  border: none;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: var(--c-text);
  transition: background .15s;
}
.methodology-toggle:hover { background: var(--c-primary-light); }
.methodology-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-soft);
}
.methodology-title svg { color: var(--c-text-mute, var(--c-text-muted, #8A8A8A)); width: 15px; height: 15px; }
.methodology-chevron { color: var(--c-text-mute, var(--c-text-muted, #8A8A8A)); transition: transform .2s ease; flex-shrink: 0; }
.methodology-toggle[aria-expanded="true"] .methodology-chevron { transform: rotate(180deg); }
.methodology-body { padding: 4px 14px 14px; border-top: 1px solid var(--c-border); color: var(--c-text-soft); }
.methodology-body[hidden] { display: none; }
.method-block { padding-top: 12px; }
.method-block:first-child { padding-top: 4px; }
.method-head { font-size: 13px; font-weight: 800; color: var(--c-text); margin: 0 0 4px; letter-spacing: -0.01em; }
.method-formula {
  display: block;
  background: var(--c-primary-light);
  color: var(--c-primary-dark);
  padding: 6px 10px;
  border-radius: 8px;
  font-family: "SF Mono", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  margin: 4px 0 6px;
  overflow-x: auto;
  white-space: nowrap;
}
.method-block p { margin: 0; font-size: 13px; line-height: 1.55; }
.method-block strong { color: var(--c-text); }
.method-footer { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--c-border); font-size: 12px; color: var(--c-text-mute, var(--c-text-muted, #8A8A8A)); }
.method-footer a { color: var(--c-primary-dark); font-weight: 600; }

/* ---------- Changelog im Trust-Strip ---------- */
.trust-item-changelog {
  background: transparent;
  border: none;
  cursor: pointer;
  font: inherit;
  color: var(--c-text-soft);
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s;
}
.trust-item-changelog:hover { background: var(--c-primary-light); color: var(--c-primary-dark); }
.trust-item-changelog svg:first-child { color: var(--c-primary); }
.trust-item-changelog strong { color: var(--c-text); font-weight: 700; }
.trust-chevron { transition: transform .2s ease; color: var(--c-text-mute, var(--c-text-muted, #8A8A8A)); }
.trust-item-changelog[aria-expanded="true"] .trust-chevron { transform: rotate(180deg); }
.changelog-panel {
  flex-basis: 100%;
  margin-top: 10px;
  padding: 14px 16px;
  background: var(--c-bg, #fff);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md, 10px);
  box-shadow: 0 1px 2px rgba(34, 34, 34, 0.05);
  text-align: left;
}
.changelog-panel[hidden] { display: none; }
.changelog-head { margin: 0 0 10px; font-size: 13px; font-weight: 800; color: var(--c-text); text-transform: uppercase; letter-spacing: 0.05em; }
.changelog-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.changelog-list li { display: grid; grid-template-columns: 82px 44px 1fr; gap: 6px 10px; font-size: 12px; line-height: 1.45; padding-bottom: 8px; border-bottom: 1px dashed var(--c-border); }
.changelog-list li:last-child { border-bottom: none; padding-bottom: 0; }
.changelog-date { font-weight: 700; color: var(--c-primary-dark); }
.changelog-version { font-size: 10px; font-weight: 800; background: var(--c-primary-light); color: var(--c-primary-dark); padding: 2px 6px; border-radius: 999px; text-align: center; align-self: start; margin-top: 1px; }
.changelog-text { color: var(--c-text-soft); }
.changelog-text strong { color: var(--c-text); }
.changelog-footer { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--c-border); font-size: 11px; color: var(--c-text-mute, var(--c-text-muted, #8A8A8A)); }
.changelog-footer a { color: var(--c-primary-dark); font-weight: 600; }
@media (max-width: 480px) {
  .changelog-list li { grid-template-columns: 1fr; gap: 2px; }
  .changelog-version { justify-self: start; margin-top: 0; }
}

/* Grün/Rot für Delta-Hinweise (z. B. Speicher-Switch) */
.toggle-hint .delta-positive { color: var(--c-success, #78B330); font-weight: 700; }
.toggle-hint .delta-negative { color: var(--c-danger, #C74333); font-weight: 700; }

/* ================================================================
   Tab-Buttons (Verbrauch/Nachtanteil etc.) — shared Blue-Button-Style
   ----------------------------------------------------------------
   Höhere Spezifität `.tabs .tab` gewinnt über rechner-lokale `.tab`.
   Aktiv = solides Primär-Blau mit weißer Schrift (button-like).
   ================================================================ */
.tabs {
  display: flex;
  gap: 8px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 4px;
}
.tabs .tab {
  flex: 1;
  background: #fff;
  border: 1.5px solid var(--c-border);
  padding: 11px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text-soft);
  border-radius: var(--r-md, 10px);
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: none;
}
.tabs .tab:hover {
  color: var(--c-primary-dark);
  border-color: var(--c-primary-mid);
}
.tabs .tab.active {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
  box-shadow: 0 3px 10px rgba(55, 140, 181, 0.28);
}
.tabs .tab.active:hover { color: #fff; border-color: var(--c-primary); }
