/* heizung.css – Version 19 (28.11.2026), Heizungs-Seite (p4d) im Apple-Stil. Version 15: Symbole in getönten Quadraten wie bei Energie. Version 19: Gradzeichen als eingebettete Ring-Schrift (Strich wie beim kleinen C, Höhe wie bisher). Version 18: Gradzeichen dünn. Version 17: Werte dünn und größer, kleines C bei °C, Linien-Symbole getönt (Puffer orange, Status rot, Außentemperatur blau). Version 16: Statussymbol im Streifen gleich groß, Außentemperatur links unten und größer.
   Aufbau: 1 Grundlagen · 2 Kacheln · 3 Statussymbol · 4 Farbbalken · 5 Streifen im Spiegel · 6 Handy · 7 Symbole · 8 Handy hell */

/* ===== 1. Grundlagen ===== */
:root {
  --kachel: #1c1c1e;
  --text: #f5f5f7;
  --text2: #a1a1a6;
  --radius: 24px;
  --gap: 16px;
  --abstand: 20px;                       /* Abstand zwischen den Kacheln */
}
body, .content {
  background: #000 !important;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
               Inter, "Helvetica Neue", Arial, sans-serif;
}
.widgetContainer {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--abstand) !important;
  padding: 0 !important;
}
@media (min-width: 1600px) { .widgetContainer { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 600px)  { .widgetContainer { grid-template-columns: 1fr 1fr; } }

/* ===== 2. Kacheln (feste Pixelmaße aus dem JavaScript überschreiben; Fläche und Kante wie im MagicMirror) ===== */
.widgetContainer > div {
  width: auto !important;
  height: auto !important;
  min-height: 190px;
  margin: 0 !important;
  float: none !important;
  position: relative !important;
  box-sizing: border-box;
  padding: 24px 26px;
  display: flex !important;
  flex-direction: column;
  justify-content: space-between;
  border-radius: var(--radius) !important;
  transition: transform .15s ease;
}
.widgetContainer > div:active { transform: scale(.98); }
#widgetContainer > div {
  margin: 0 !important;
  background: #1c1c1e !important;
  border: 1px solid rgba(255, 255, 255, .05) !important;
  box-shadow: none !important;
}
@media (max-width: 600px) { .widgetContainer > div { min-height: 150px; padding: 16px 18px; } }

.widget-title {
  position: static !important;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--text2) !important;
  text-align: left !important;
}
.widget-title { display: flex !important; align-items: center; gap: 10px; flex: none; min-height: 36px; }   /* Symbol-Kachel links, Titel rechts; bleibt auch in niedrigen Kacheln 36 px hoch */
#widgetContainer .widget-title::before {   /* Symbol in getöntem Quadrat, Linien-Symbole wie bei Energie (Tönung 18 %) */
  content: ""; display: block; flex: none;
  width: 36px; height: 36px; border-radius: 11px; margin: 0;
  background-repeat: no-repeat; background-position: center; background-size: 21px 21px;
}
#widgetContainer .widgetValue .widget-title::before { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff9f0a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0z'/%3E%3C/svg%3E") center / 21px 21px no-repeat, color-mix(in srgb, #ff9f0a 18%, transparent); }   /* Puffer: Thermometer orange */
#widgetContainer #div_VA\:0x04 .widget-title::before { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a84ff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0z'/%3E%3C/svg%3E") center / 21px 21px no-repeat, color-mix(in srgb, #0a84ff 18%, transparent); }   /* Außentemperatur: Thermometer blau */
#widgetContainer .widget > .widget-title::before { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff453a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z'/%3E%3C/svg%3E") center / 21px 21px no-repeat, color-mix(in srgb, #ff453a 18%, transparent); }   /* Heizungsstatus: Flamme rot */
/* Einheit "°C": nur das C wird kleiner (Textteil lässt sich per CSS sonst nicht einzeln ansprechen); lokale Schrift, Wert bleibt unverändert */
@font-face { font-family: "hz-unit"; font-weight: 100 500; src: local("Arial"), local("ArialMT"), local("Helvetica"), local("Liberation Sans"); unicode-range: U+0043; size-adjust: 52%; }
@font-face { font-family: "deg-ring"; src: url(data:font/ttf;base64,AAEAAAAKAIAAAwAgT1MvMkWRQ/oAAAEoAAAAYGNtYXAADAEDAAABkAAAADRnbHlmH8Ru+QAAAcwAAABkaGVhZC8k794AAACsAAAANmhoZWEE0AEVAAAA5AAAACRobXR4AdsAAAAAAYgAAAAGbG9jYQAyAAAAAAHEAAAABm1heHAABQAiAAABCAAAACBuYW1lTIHf3wAAAjAAAABjcG9zdACHAAAAAAKUAAAAJgABAAAAAQAA1LWSJF8PPPUAAwPoAAAAAOcwVVkAAAAA5zBVWQAtAXwBgQLQAAAAAwACAAAAAAAAAAEAAAMg/zgAAAGuAC0ALQGBAAEAAAAAAAAAAAAAAAAAAAABAAEAAAACACAAAgAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAwGuAZAABQAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAPz8/PwAAALAAsAMg/zgAAAMgAMgAAAAAAAAAAAAAAAAAAAAgAAABrgAAAC0AAAAAAAIAAAADAAAAFAADAAEAAAAUAAQAIAAAAAQABAABAAAAsP//AAAAsP///1EAAQAAAAAAAAAAADIAAAACAC0BfAGBAtAADwAfAAATMhYWFRQGBiMiJiY1NDY2FyIGBhUUFhYzMjY2NTQmJtcvTS4uTS8vTS4uTS8iOSEhOSIiOSEhOQLQLk0vL00uLk0vL00uLiE5IiI5ISE5IiI5IQAAAAAEADYAAQAAAAAAAQAIAAAAAQAAAAAAAgAHAAgAAwABBAkAAQAQAA8AAwABBAkAAgAOAB9kZWctcmluZ1JlZ3VsYXIAZABlAGcALQByAGkAbgBnAFIAZQBnAHUAbABhAHIAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAIMAAA==) format("truetype"); unicode-range: U+00B0; }   /* eigenes Gradzeichen: dünner Ring (Strich wie beim kleinen C), eingebettet, unabhängig von Geräteschriften */
.widget-value {                          /* Wert unten links, Titel oben */
  position: static !important;
  width: auto !important;
  margin: 0 !important;
  margin-top: auto !important;
  text-align: left !important;
  line-height: 1;
  font-weight: 300;                        /* dünn wie die Uhr */
  letter-spacing: -0.02em;
  word-spacing: -0.2em;                    /* Leerraum vor "°C" enger */
}
#widgetContainer .widget-value { font-size: clamp(56px, 5.3vw, 104px) !important; font-family: "deg-ring", "hz-unit", -apple-system, BlinkMacSystemFont, "SF Pro Display", Inter, "Helvetica Neue", Arial, sans-serif !important; }
.chart-peak:empty { display: none; }
.chart-peak { margin-top: 6px; font-size: 13px; color: var(--text2); }

/* ===== 3. Statussymbol: groß und mittig in der Kachel ===== */
.widget-main {
  position: static !important;
  align-self: flex-start;
  background: transparent !important;
}
.widgetContainer .widget > .widget-main {
  display: flex !important;
  align-items: center;
  justify-content: center;
  margin: auto !important;
  aspect-ratio: 1;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
}
#widgetContainer .widget > .widget-main { width: 136px !important; height: 136px !important; }
.widgetContainer .widget > .widget-main img { width: 100% !important; height: 100% !important; object-fit: contain; }
#widgetContainer .widget > .widget-main img { transform: scale(1.3); }   /* Symbol selbst größer (hat innen Rand) */
#widgetContainer .widget-main:focus-visible { outline: 2px solid #0a84ff; outline-offset: 4px; border-radius: 50%; }

/* ===== 4. Farbbalken ===== */
.p4-bar { margin-top: 14px; overflow: hidden; }
#widgetContainer .p4-bar { height: 8px; border-radius: 4px; background: #2c2c2e; }
.p4-fill {
  width: 0;
  height: 100%;
  transition: width .6s ease;
  background: linear-gradient(90deg, #64d2ff, #0a84ff 35%, #ff9f0a 70%, #ff453a);
}
#widgetContainer .p4-fill { border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { #widgetContainer .p4-fill { transition: none !important; } }

/* ===== 5. Streifen im Spiegel (iframe 210 px hoch): gleiche Abstände wie im Spiegel, kein Rand ===== */
@media (max-height: 260px) {

  /* Seitenrand der Seite entfernen */
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }
  html body #container,
  html body .container,
  html body .content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: 100vh !important;
  }

  /* fünf Kacheln, 16 px Abstand wie bei Uhr und Wetter */
  html body #widgetContainer {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100vh !important;
  }

  /* Außentemperatur: Wert links unten und größer (ohne leeren Balken); nowrap, damit auch -12.5 °C in eine Zeile passt */
  #widgetContainer #div_VA\:0x04 .p4-bar { display: none !important; }
  #widgetContainer #div_VA\:0x04 .widget-value {
    font-size: clamp(64px, 5.9vw, 116px) !important;
    margin: 0 !important;
    white-space: nowrap;
  }

  /* Kacheln füllen die ganze iframe-Höhe: kein Rand unten */
  html body #widgetContainer > * {
    margin: 0 !important;
    width: auto !important;
    height: 100vh !important;
    min-height: 0 !important;
    float: none !important;
    box-sizing: border-box !important;
  }
}

/* ===== 6. Handy: Symbolgrößen, dann gemeinsamer Kartenhintergrund ===== */
@media (max-width: 1100px) and (min-height: 261px) {
  #widgetContainer .widget > .widget-main { width: 120px !important; height: 120px !important; }
}
@media (max-width: 600px) {
  #widgetContainer .widget-value { font-size: clamp(40px, 11vw, 56px) !important; }
  #widgetContainer .widget > .widget-main { width: 96px !important; height: 96px !important; }
}
/* Die fünf Kacheln bekommen einen gemeinsamen Hintergrund (wie Energie, Wetter, Kalender).
   Gilt im Spiegel auf dem Handy (Seite ca. 930 px breit, höher als 260 px).
   Die Farben folgen der Systemeinstellung des Handys (hell/dunkel). */
@media (max-width: 1100px) and (min-height: 261px) {
  :root {
    --seite: #000000;
    --karte: #1c1c1e;
    --unterkachel: #2c2c2e;
    --text: #f5f5f7;
    --text2: #a1a1a6;
    --spur: rgba(255, 255, 255, .12);
  }
  html, body, .content {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: var(--seite) !important;
  }
  html body #container,
  html body .container { margin: 0 !important; padding: 0 !important; background: none !important; }

  /* der gemeinsame Hintergrund: füllt den iframe, die Reihen teilen sich die Höhe */
  html body #widgetContainer {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-auto-rows: 1fr !important;
    gap: 2vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 3vw !important;
    box-sizing: border-box !important;
    background: var(--karte) !important;
    border-radius: 4vw !important;
  }

  /* die einzelnen Kacheln: heller als der Hintergrund, wie die Tage im Kalender */
  html body #widgetContainer > * {
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    float: none !important;
    box-sizing: border-box !important;
    background: var(--unterkachel) !important;
    border: 0 !important;
    border-radius: 3vw !important;
    box-shadow: none !important;
  }
  html body #widgetContainer .p4-bar { background: var(--spur) !important; }
}

/* Handy im hellen Modus (Systemeinstellung des Handys) */
@media (max-width: 1100px) and (min-height: 261px) and (prefers-color-scheme: light) {
  :root {
    --seite: #f2f2f7;
    --karte: #ffffff;
    --unterkachel: #f2f2f7;
    --text: #1c1c1e;
    --text2: #6c6c70;
    --spur: rgba(0, 0, 0, .1);
  }
  /* weißes Statussymbol wird dunkel, Farben bleiben ungefähr erhalten */
  html body #widgetContainer .widget > .widget-main img { filter: invert(1) hue-rotate(180deg); }
}

/* ===== 7. Statussymbole im Apple-Stil (SF-Symbols-Look, ersetzen die GIFs per CSS; Bilddateien bleiben) ===== */
#widgetContainer .widget > .widget-main img[src*="/state-"] { transform: none; padding: 4%; box-sizing: border-box; }
#widgetContainer .widget-main img[src*="state-fireoff.gif"] { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cstyle%3E*{transform-box:fill-box;transform-origin:50% 90%}@media (prefers-reduced-motion:reduce){*{animation:none!important}}%3C/style%3E%3Cg stroke='%238e8e93' stroke-width='1.4'%3E%3Cpath d='M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z'/%3E%3Cpath d='M3.5 3.5l17 17' stroke='%23aeaeb2' stroke-width='1.6'/%3E%3C/g%3E%3C/svg%3E"); }
#widgetContainer .widget-main img[src*="state-fire.gif"] { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cstyle%3E*{transform-box:fill-box;transform-origin:50% 90%}@media (prefers-reduced-motion:reduce){*{animation:none!important}}.f{animation:p 2.2s ease-in-out infinite}@keyframes p{0%,100%{transform:scale(1)}50%{transform:scale(1.045,.97)}}%3C/style%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='1' x2='0' y2='0'%3E%3Cstop offset='0' stop-color='%23ff453a'/%3E%3Cstop offset='1' stop-color='%23ffb340'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z' fill='url(%23g)' stroke='%23ff9f0a' stroke-width='1' class='f'/%3E%3C/svg%3E"); }
#widgetContainer .widget-main img[src*="state-heatup.gif"] { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cstyle%3E*{transform-box:fill-box;transform-origin:50% 90%}@media (prefers-reduced-motion:reduce){*{animation:none!important}}.f{animation:b 1.8s ease-in-out infinite}@keyframes b{0%,100%{opacity:.45}50%{opacity:1}}%3C/style%3E%3Cpath d='M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z' stroke='%23ff9f0a' stroke-width='1.5' class='f'/%3E%3C/svg%3E"); }
#widgetContainer .widget-main img[src*="state-wait.gif"] { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cstyle%3E*{transform-box:fill-box;transform-origin:50% 90%}@media (prefers-reduced-motion:reduce){*{animation:none!important}}%3C/style%3E%3Cg stroke='%2364d2ff' stroke-width='1.5'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 6.5V12l3.5 2'/%3E%3C/g%3E%3C/svg%3E"); }
#widgetContainer .widget-main img[src*="state-clean.gif"] { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cstyle%3E*{transform-box:fill-box;transform-origin:50% 90%}@media (prefers-reduced-motion:reduce){*{animation:none!important}}%3C/style%3E%3Cg stroke='%2340c8e0' stroke-width='1.4'%3E%3Cpath d='M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z'/%3E%3Cpath d='M20 3v4M22 5h-4M4 17v2M5 18H3'/%3E%3C/g%3E%3C/svg%3E"); }
#widgetContainer .widget-main img[src*="state-error.gif"] { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cstyle%3E*{transform-box:fill-box;transform-origin:50% 90%}@media (prefers-reduced-motion:reduce){*{animation:none!important}}%3C/style%3E%3Cg stroke='%23ff453a' stroke-width='1.5'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/g%3E%3C/svg%3E"); }


/* ===== 8. Heller Modus automatisch nach Browser (nur Handy/Tablet bis 1100 px, große Bildschirme bleiben dunkel), Temperaturen gut lesbar ===== */
@media (max-width: 1100px) and (prefers-color-scheme: light) {
  :root { --text: #1c1c1e; --text2: #6c6c70; }
  body, .content { background: #f2f2f7 !important; }
  #widgetContainer > div { background: #ffffff !important; border: 1px solid rgba(0, 0, 0, .06) !important; }
  #widgetContainer .widget-value,
  #widgetContainer .widget-value * { color: var(--text) !important; }
  #widgetContainer .p4-bar { background: rgba(0, 0, 0, .1); }
}
