/* Interaktive Elemente: Wohlfühl-Check, Rechner, Erklär-Schaubild, Wissen-Hub */

/* --- Wohlfühl-Check (Hero) --- */
.comfort { padding: 22px; }
.comfort .room { width: 100%; height: auto; border-radius: 14px; display: block; margin-top: 12px; }
.comfort .temp-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 14px; }
.comfort .temp { font-size: 3.4rem; }
.mood { font-weight: 700; padding: 4px 14px; border-radius: 999px; background: rgba(255,255,255,.08); font-size: .95rem; transition: background .3s, color .3s; white-space: nowrap; }
.mood.hot { background: rgba(229,83,61,.22); color: #ffb4a2; }
.mood.ok { background: rgba(127,209,165,.22); color: #7fd1a5; }
.mood.cold { background: rgba(76,143,214,.25); color: #a9cdf2; }
#tRange { -webkit-appearance: none; appearance: none; width: 100%; height: 12px; border-radius: 99px; margin: 14px 0 6px; outline: none; cursor: pointer;
  background: linear-gradient(90deg, #4c8fd6, #6aa6e8, #7fd1a5, #f0a35e, #e5533d); }
#tRange::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 4px solid var(--enzian); box-shadow: 0 2px 12px rgba(0,0,0,.5); }
#tRange::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 4px solid var(--enzian); }
#tRange:focus-visible { outline: 2px solid var(--enzian-hell); outline-offset: 6px; }
.comfort .hint { min-height: 3.2em; margin-top: 10px; color: var(--text-dim); font-size: .95rem; }
.meter { margin-top: 12px; font-size: .8rem; color: var(--text-dim); }
.meter-bar { height: 8px; border-radius: 8px; background: var(--line); overflow: hidden; margin-top: 6px; }
.meter-bar i { display: block; height: 100%; width: 30%; background: linear-gradient(90deg, #7fd1a5, #f0a35e, #e5533d); transition: width .4s; }
.flow path { stroke-dasharray: 6 10; animation: dashmove 1.2s linear infinite; }
@keyframes dashmove { to { stroke-dashoffset: -32; } }
.shiver { animation: shiver .18s linear infinite; }
@keyframes shiver { 0% { transform: translateX(-1px); } 50% { transform: translateX(1px); } 100% { transform: translateX(-1px); } }
@media (prefers-reduced-motion: reduce) { .flow path, .shiver { animation: none; } }

/* --- Rechner --- */
.calc { display: grid; grid-template-columns: 1fr 1.1fr; gap: 20px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: clamp(20px, 3vw, 32px); }
.panel h2 { font-size: 1.4rem; margin-bottom: 18px; }
.field { display: grid; gap: 8px; margin-bottom: 20px; }
.field > span, .field label { color: var(--text-dim); font-size: .9rem; }
.field .row { display: flex; justify-content: space-between; align-items: baseline; }
.field output { color: var(--text); font-weight: 700; }
.field select, .field input[type=number] { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font: inherit; }
.field input[type=range] { width: 100%; accent-color: var(--enzian-hell); height: 28px; }
.field small { color: var(--text-dim); font-size: .8rem; }
.result-big { font-size: clamp(2.6rem, 7vw, 4rem); font-weight: 800; color: var(--enzian-hell); line-height: 1; letter-spacing: -.03em; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0; }
.result-grid div { background: var(--bg-2); border-radius: 14px; padding: 14px; }
.result-grid b { display: block; font-size: 1.25rem; }
.result-grid span { font-size: .8rem; color: var(--text-dim); }
.cmp { display: grid; gap: 12px; margin-top: 8px; }
.cmp-row { display: grid; grid-template-columns: 150px 1fr 90px; gap: 12px; align-items: center; font-size: .9rem; }
.cmp-bar { height: 20px; border-radius: 10px; background: var(--line); overflow: hidden; }
.cmp-bar i { display: block; height: 100%; width: 0; border-radius: 10px; background: var(--enzian-glow); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.cmp-row.sel .cmp-bar i { background: linear-gradient(90deg, var(--enzian-glow), var(--enzian-hell)); }
.cmp-row.sel { color: var(--text); font-weight: 600; }
.cmp-row:not(.sel) { color: var(--text-dim); }
.note { font-size: .82rem; color: var(--text-dim); margin-top: 16px; }
details.assump { margin-top: 18px; color: var(--text-dim); font-size: .9rem; }
details.assump summary { cursor: pointer; color: var(--text); font-weight: 600; }
details.assump ul { margin: 10px 0 0 1.1em; display: grid; gap: 6px; }

/* --- Erklär-Schaubild --- */
.diagram { position: relative; max-width: 1040px; margin: 0 auto; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; background: #1b1f23; }
.diagram svg { display: block; width: 100%; height: auto; }
.hs { position: absolute; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; background: var(--enzian); color: #fff; font-weight: 700; font-size: .85rem; cursor: pointer; display: grid; place-items: center; box-shadow: 0 0 0 0 rgba(106,166,232,.7); animation: ping 2.2s infinite; padding: 0; }
.hs:hover, .hs[aria-pressed="true"] { background: #fff; color: var(--enzian); animation: none; box-shadow: 0 0 0 6px rgba(106,166,232,.35); }
@keyframes ping { 70% { box-shadow: 0 0 0 12px rgba(106,166,232,0); } 100% { box-shadow: 0 0 0 0 rgba(106,166,232,0); } }
.hl { filter: drop-shadow(0 0 12px #6aa6e8); }
.zone-label { font-family: system-ui, sans-serif; font-size: 22px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.pt { font-family: system-ui, sans-serif; font-size: 18px; font-weight: 600; fill: #e9eef3; }
.info { max-width: 1040px; margin: 20px auto 0; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; }
.info-box { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px 26px; min-height: 140px; }
.info-box h3 { color: var(--enzian-hell); margin-bottom: 8px; }
.info-box p { color: var(--text-dim); }
.info-actions { display: grid; gap: 10px; }
.diagram .spin-slow { transform-box: fill-box; transform-origin: center; animation: spin 6s linear infinite; }
.diagram .spin-fast { transform-box: fill-box; transform-origin: center; animation: spin 1.4s linear infinite; }
.diagram .drop { animation: drip 2s ease-in infinite; }
@keyframes drip { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(26px); opacity: 0; } }
.paused-anim * { animation-play-state: paused !important; }

/* --- Wissen-Hub --- */
.hub { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.hub a.tile { display: block; min-height: 200px; }
.hub a.tile h3 { font-size: 1.5rem; margin-top: 4px; }
.hub .arrow { position: absolute; right: 24px; bottom: 20px; color: var(--enzian-hell); font-size: 1.4rem; transition: transform .2s; }
.hub a.tile:hover .arrow { transform: translateX(6px); }
.mini-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.mini-links a.tile { padding: 22px; }
.mini-links a.tile h3 { font-size: 1.1rem; }

/* --- Kleinigkeiten --- */

@media (max-width: 900px) {
  .calc, .info, .hub { grid-template-columns: 1fr; }
  .mini-links { grid-template-columns: 1fr; }
  .info-actions { grid-template-columns: 1fr 1fr; }
  .cmp-row { grid-template-columns: 1fr 80px; }
  .cmp-row .cmp-bar { grid-column: 1 / -1; order: 3; }
  .hs { width: 30px; height: 30px; font-size: .75rem; }
}

/* Bauteil-Liste */
.chips { max-width: 1040px; margin: 16px auto 0; display: none; flex-wrap: wrap; gap: 8px; }
.chip-btn { background: var(--surface); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: .85rem; cursor: pointer; }
.chip-btn.on { background: var(--enzian); border-color: var(--enzian-hell); }
@media (max-width: 700px) {
  .chips { display: flex; }
  .hs { width: 22px; height: 22px; font-size: .62rem; border-width: 1.5px; }
}

/* Wissen: ungerade Kachel über die volle Breite, Mini-Links passen sich an */
.hub a.tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
.mini-links { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* Schaubild v2: Innen- und Außengerät, Heizbetrieb */
.zone-sub { font-family: system-ui, sans-serif; font-size: 13px; }
.mode-text text { font-family: system-ui, sans-serif; font-size: 20px; font-weight: 700; }
.mode-text .zone-sub { font-size: 13px; font-weight: 400; }
.tiny { font-family: system-ui, sans-serif; font-size: 13px; font-weight: 600; fill: #cfe0f3; }
.pt.dark { fill: #2b3137; font-size: 15px; }
#g-vierwege .pt { font-size: 14px; }
#diagramSvg .air-in { stroke: #f0a35e; } #diagramSvg .air-out { stroke: #8fc0f0; }
#diagramSvg.heat .air-in { stroke: #8fc0f0; } #diagramSvg.heat .air-out { stroke: #f0a35e; }
#diagramSvg .mode-heat, #diagramSvg .set-heat { display: none; }
#diagramSvg.heat .mode-heat { display: inline; } #diagramSvg.heat .set-heat { display: inline; }
#diagramSvg.heat .mode-cool, #diagramSvg.heat .set-cool { display: none; }
.info-actions { grid-template-columns: 1fr; }
@media (max-width: 900px) { .info-actions { grid-template-columns: 1fr; } }

/* Außenluft-Pfeile: im Kühlbetrieb warm (Wärme wird abgegeben), im Heizbetrieb kalt (Wärme wird entzogen) */
#diagramSvg .air-ex { stroke: #f0a35e; }
#diagramSvg.heat .air-ex { stroke: #8fc0f0; }
