/* ============================================================
   GRÄF — Tools & KI Styles
   ============================================================ */

/* ============================================================
   NOTFALL-ASSISTENT
   ============================================================ */
.nf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .nf-grid { grid-template-columns: 1fr; } }
.nf-case { display: flex; gap: 14px; align-items: center; text-align: left; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease); }
.nf-case:hover { border-color: var(--blue-300); transform: translateY(-2px); box-shadow: var(--sh-sm); }
.nf-case-ico { width: 48px; height: 48px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--blue-50); color: var(--blue-700); border: 1px solid var(--blue-100); flex: none; }
.nf-case.nf-danger .nf-case-ico { background: var(--red-100); color: var(--red-600); border-color: #f3b6ae; }
.nf-case.nf-danger:hover { border-color: var(--red-500); }
.nf-case-l { display: block; font-weight: 700; }
.nf-case-h { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; }
.nf-back { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--blue-700); font-weight: 600; cursor: pointer; padding: 0; margin-bottom: 14px; font-size: .92rem; }
.nf-back:hover { text-decoration: underline; }
.nf-warn { display: flex; gap: 12px; align-items: center; background: var(--red-100); border: 1px solid #f3b6ae; color: var(--red-700); padding: 14px 16px; border-radius: var(--r-md); font-weight: 600; margin-bottom: 6px; }
.nf-warn svg { flex: none; }
.nf-steps { display: grid; gap: 10px; margin-top: 16px; }
.nf-step { display: flex; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; cursor: pointer; text-align: left; align-items: flex-start; transition: background .2s var(--ease), border-color .2s var(--ease); }
.nf-step:hover { border-color: var(--blue-300); }
.nf-step-n { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--blue-50); color: var(--blue-700); font-weight: 700; border: 1px solid var(--blue-100); font-size: .9rem; }
.nf-step.done { background: #f2f9f4; border-color: #bfe3cc; }
.nf-step.done .nf-step-n { background: #1f8a5b; color: #fff; border-color: #1f8a5b; }
.nf-step.done .nf-step-t { text-decoration: line-through; color: var(--muted); }
.nf-step-t { display: block; font-weight: 700; }
.nf-step-x { display: block; color: var(--ink-soft); font-size: .93rem; margin-top: 2px; }

/* ---------- Tool-Karte / Container ---------- */
.tool-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-md); overflow: hidden; }
.tool-card-head { padding: 26px 30px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 16px; background: var(--surface-2); }
.tool-card-ico { width: 52px; height: 52px; border-radius: var(--r-md); display: grid; place-items: center; color: #fff; flex: none; }
.tool-body { padding: 30px; display: grid; gap: 24px; }
.tool-result { padding: 30px; display: grid; gap: 22px; }
.tool-progress { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.tool-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue-600), var(--blue-700)); border-radius: 99px; transition: width .4s var(--ease); }
.tool-disclaimer { font-size: .8rem; color: var(--muted); line-height: 1.5; margin: 4px 0 0; }

.q-block { display: grid; gap: 12px; }
.q-title { font-weight: 700; font-size: 1.08rem; font-family: var(--font-display); letter-spacing: -.01em; }

/* ---------- Choice buttons ---------- */
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice-grid.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .choice-grid, .choice-grid.two { grid-template-columns: 1fr; } }
.choice { display: flex; align-items: flex-start; gap: 12px; text-align: left; padding: 15px 16px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: #fff; cursor: pointer; transition: border-color .15s, background .15s, transform .08s; }
.choice:hover { border-color: var(--blue-300); background: var(--blue-50); }
.choice:active { transform: scale(.99); }
.choice.active { border-color: var(--blue-600); background: var(--blue-50); box-shadow: inset 0 0 0 1px var(--blue-600); }
.choice-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex: none; margin-top: 2px; transition: all .15s; position: relative; }
.choice.active .choice-dot { border-color: var(--blue-600); background: var(--blue-600); }
.choice.active .choice-dot::after { content: ""; position: absolute; inset: 4px; background: #fff; border-radius: 50%; }
.choice-lbl { font-weight: 600; display: block; line-height: 1.3; }
.choice-hint { display: block; font-size: .82rem; color: var(--muted); margin-top: 3px; }

/* ---------- Fields / Range ---------- */
.field { display: grid; gap: 10px; }
.field-lbl { font-weight: 700; font-size: 1rem; }
.range-row { display: flex; align-items: center; gap: 18px; }
.range-row output { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--blue-700); min-width: 120px; text-align: right; }
input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; height: 8px; border-radius: 99px; background: var(--surface-3); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--blue-700); border: 4px solid #fff; box-shadow: var(--sh-sm); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--blue-700); border: 4px solid #fff; cursor: pointer; }

/* ---------- Result stats ---------- */
.res-stats { display: grid; gap: 16px; padding: 24px; background: var(--surface-2); border-radius: var(--r-lg); border: 1px solid var(--line); }
.res-stats.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 620px) { .res-stats.three { grid-template-columns: 1fr; gap: 18px; text-align: center; } }
.res-stat { display: grid; gap: 4px; }
.res-val { font-family: var(--font-display); font-weight: 900; letter-spacing: -.03em; line-height: 1; }
.res-lbl { color: var(--ink-soft); font-weight: 600; font-size: .92rem; }
.result-cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Verdict (Wärmepumpe) ---------- */
.verdict { display: flex; gap: 24px; align-items: center; padding: 26px; border-radius: var(--r-lg); border: 1px solid var(--line); }
.v-green { background: linear-gradient(135deg, #e7f6ee, var(--surface-2)); }
.v-blue { background: linear-gradient(135deg, var(--blue-50), var(--surface-2)); }
.v-gold { background: linear-gradient(135deg, var(--gold-100), var(--surface-2)); }
.v-red { background: linear-gradient(135deg, var(--red-100), var(--surface-2)); }
.verdict-score { font-family: var(--font-display); font-weight: 900; font-size: clamp(2.6rem,2rem+2vw,4rem); line-height: .9; color: var(--blue-800); flex: none; display: flex; flex-direction: column; align-items: center; }
.verdict-score small { font-size: .9rem; font-weight: 700; color: var(--muted); }
.verdict-eyebrow { font-size: .76rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--blue-600); margin-bottom: 4px; }
@media (max-width: 520px) { .verdict { flex-direction: column; text-align: center; gap: 14px; } }

/* ---------- Förder-Bar ---------- */
.foerder-result { display: grid; gap: 18px; padding: 24px; background: var(--surface-2); border-radius: var(--r-lg); border: 1px solid var(--line); }
.foerder-bar { display: flex; height: 46px; border-radius: var(--r-sm); overflow: hidden; gap: 2px; }
.fb-seg { display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .95rem; min-width: 38px; transition: flex .3s var(--ease); }
.fb-blue { background: var(--blue-700); } .fb-red { background: var(--red-600); } .fb-gold { background: var(--gold-500); color: var(--ink); } .fb-green { background: #1f8a5b; }
.foerder-bar-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: .85rem; color: var(--ink-soft); }
.foerder-bar-legend span { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.dot-blue { background: var(--blue-700); } .dot-red { background: var(--red-600); } .dot-gold { background: var(--gold-500); } .dot-green { background: #1f8a5b; }
.foerder-note { display: inline-flex; align-items: center; gap: 8px; color: #1f8a5b; font-weight: 700; font-size: .92rem; }

/* ---------- Compare (Heizkosten) ---------- */
.compare { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 24px; background: var(--surface-2); border-radius: var(--r-lg); border: 1px solid var(--line); }
.compare-col { display: grid; gap: 10px; }
.compare-tag { font-size: .82rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.compare-col.new .compare-tag { color: #1f8a5b; }
.compare-val { font-family: var(--font-display); font-weight: 900; font-size: clamp(1.5rem,1.1rem+1.4vw,2.2rem); letter-spacing: -.02em; }
.compare-val small { font-size: .82rem; font-weight: 600; color: var(--muted); margin-left: 6px; font-family: var(--font-body); }
.compare-bar { height: 10px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.compare-bar span { display: block; height: 100%; border-radius: 99px; transition: width .4s var(--ease); }
.compare-arrow { color: var(--blue-600); }
@media (max-width: 560px) { .compare { grid-template-columns: 1fr; } .compare-arrow { transform: rotate(90deg); justify-self: center; } }

/* ============================================================
   CHAT-ASSISTENT
   ============================================================ */
.chat-fab { position: fixed; right: 22px; bottom: 22px; z-index: 80; display: inline-flex; align-items: center; gap: 10px; padding: 14px 20px 14px 16px; border: 0; border-radius: 999px; background: var(--blue-700); color: #fff; font-family: var(--font-body); font-weight: 700; font-size: 1rem; cursor: pointer; box-shadow: var(--sh-blue); transition: transform .15s var(--ease), opacity .2s; }
.chat-fab:hover { transform: translateY(-3px); background: var(--blue-800); }
.chat-fab.hidden { opacity: 0; pointer-events: none; transform: scale(.8); }
.chat-fab-ping { position: absolute; top: -3px; right: -3px; width: 14px; height: 14px; border-radius: 50%; background: var(--red-500); border: 2px solid #fff; }
@media (max-width: 560px) { .chat-fab-txt { display: none; } .chat-fab { padding: 16px; } }

.chat-panel { position: fixed; right: 22px; bottom: 22px; z-index: 81; width: min(400px, calc(100vw - 32px)); height: min(620px, calc(100vh - 44px)); background: #fff; border-radius: var(--r-xl); box-shadow: var(--sh-lg); display: flex; flex-direction: column; overflow: hidden; transform: translateY(24px) scale(.96); opacity: 0; pointer-events: none; transition: transform .28s var(--ease), opacity .28s var(--ease); border: 1px solid var(--line); }
.chat-panel.open { transform: none; opacity: 1; pointer-events: auto; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; background: var(--blue-900); color: #fff; }
.chat-head-id { display: flex; align-items: center; gap: 12px; }
.chat-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--blue-700); display: grid; place-items: center; color: #fff; overflow: hidden; }
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-name { font-weight: 700; font-size: .98rem; }
.chat-status { font-size: .78rem; color: rgba(255,255,255,.65); display: flex; align-items: center; gap: 6px; }
.chat-online { width: 8px; height: 8px; border-radius: 50%; background: #34d27b; }
.chat-close { background: rgba(255,255,255,.1); border: 0; color: #fff; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.chat-close:hover { background: rgba(255,255,255,.2); }
.chat-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); }
.bubble-row { display: flex; gap: 8px; align-items: flex-end; }
.bubble-row.user { justify-content: flex-end; }
.bubble-ava { width: 26px; height: 26px; border-radius: 50%; background: var(--blue-700); color: #fff; display: grid; place-items: center; flex: none; overflow: hidden; }
.bubble-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bubble-img { width: 130px; height: auto; display: block; margin-bottom: 8px; border-radius: var(--r-sm); }
.bubble { max-width: 78%; padding: 11px 15px; border-radius: 16px; font-size: .95rem; line-height: 1.5; }
.bubble.assistant { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.bubble.user { background: var(--blue-700); color: #fff; border-bottom-right-radius: 5px; }
.bubble.typing { display: flex; gap: 4px; }
.bubble.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--blue-300); animation: blink 1.2s infinite; }
.bubble.typing span:nth-child(2) { animation-delay: .2s; } .bubble.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,60%,100%{opacity:.3} 30%{opacity:1} }
.chat-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chat-suggest button { background: #fff; border: 1px solid var(--blue-300); color: var(--blue-700); border-radius: 999px; padding: 8px 14px; font-size: .85rem; font-weight: 600; cursor: pointer; transition: background .15s; }
.chat-suggest button:hover { background: var(--blue-50); }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: #fff; }
.chat-input input { flex: 1; border: 1.5px solid var(--line); border-radius: 999px; padding: 12px 16px; font-family: inherit; font-size: .95rem; outline: none; }
.chat-input input:focus { border-color: var(--blue-600); }
.chat-input button { width: 44px; height: 44px; border-radius: 50%; background: var(--blue-700); color: #fff; border: 0; display: grid; place-items: center; cursor: pointer; flex: none; transition: background .15s; }
.chat-input button:disabled { background: var(--line); color: var(--muted); cursor: default; }
.chat-foot { text-align: center; font-size: .72rem; color: var(--muted); padding: 8px; background: #fff; border-top: 1px solid var(--line-soft); }

/* ============================================================
   BAD-VISUALIZER
   ============================================================ */
.bad-viz { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--sh-md); }
@media (max-width: 880px) { .bad-viz { grid-template-columns: 1fr; } }
.bad-stage { background: var(--surface-3); min-height: 380px; display: grid; padding: 22px; position: relative; }
.bad-drop { border: 2.5px dashed var(--blue-300); border-radius: var(--r-lg); background: var(--blue-50); display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; padding: 30px; cursor: pointer; transition: border-color .15s, background .15s; }
.bad-drop:hover, .bad-drop.over { border-color: var(--blue-600); background: #fff; }
.bad-drop-ico { width: 64px; height: 64px; border-radius: 50%; background: #fff; color: var(--blue-700); display: grid; place-items: center; box-shadow: var(--sh-sm); }
.bad-drop-t { font-weight: 700; font-size: 1.08rem; }
.bad-drop-s { color: var(--muted); font-size: .9rem; }
.bad-preview { position: relative; border-radius: var(--r-lg); overflow: hidden; }
.bad-preview img { width: 100%; height: 100%; object-fit: cover; min-height: 336px; }
.bad-change { position: absolute; top: 12px; right: 12px; background: rgba(22,24,43,.7); color: #fff; border: 0; border-radius: 999px; padding: 8px 13px; font-size: .82rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; backdrop-filter: blur(4px); }
.bad-scan { position: absolute; inset: 0; background: rgba(28,33,80,.45); backdrop-filter: blur(1px); display: grid; place-content: center; justify-items: center; gap: 14px; color: #fff; font-weight: 700; overflow: hidden; }
.bad-scan span { background: rgba(0,0,0,.4); padding: 8px 16px; border-radius: 999px; font-size: .9rem; }
.bad-scan-line { position: absolute; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--gold-500), transparent); box-shadow: 0 0 18px 4px var(--gold-500); animation: scan 1.6s var(--ease) infinite; }
@keyframes scan { 0%{top:8%} 50%{top:88%} 100%{top:8%} }

/* Before/After slider */
.ba-compare { position: relative; border-radius: var(--r-lg); overflow: hidden; cursor: ew-resize; user-select: none; aspect-ratio: 1 / 1; }
.ba-compare img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ba-after { display: block; }
.ba-before-clip { position: absolute; inset: 0; overflow: hidden; border-right: 3px solid #fff; }
.ba-before-clip img { position: absolute; inset: 0; width: 100%; }
.ba-before-clip .ba-before { filter: grayscale(.15) brightness(.94); }
.ba-tag { position: absolute; top: 12px; font-size: .76rem; font-weight: 700; padding: 5px 11px; border-radius: 999px; letter-spacing: .03em; text-transform: uppercase; }
.ba-tag-before { left: 12px; background: rgba(22,24,43,.72); color: #fff; }
.ba-tag-after { right: 12px; background: var(--gold-500); color: var(--ink); }
.ba-handle { position: absolute; top: 50%; width: 40px; height: 40px; border-radius: 50%; background: #fff; transform: translate(-50%,-50%); display: grid; grid-auto-flow: column; place-items: center; box-shadow: var(--sh-md); color: var(--blue-700); pointer-events: none; }

.bad-controls { padding: 28px; display: grid; align-content: start; gap: 4px; }
.bad-styles { display: grid; gap: 10px; }
.bad-style { text-align: left; padding: 14px 16px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.bad-style:hover { border-color: var(--blue-300); background: var(--blue-50); }
.bad-style.active { border-color: var(--blue-600); background: var(--blue-50); box-shadow: inset 0 0 0 1px var(--blue-600); }
.bad-style-l { font-weight: 700; display: block; }
.bad-style-d { font-size: .85rem; color: var(--muted); display: block; margin-top: 2px; }
.bad-concept { display: grid; gap: 18px; }
.bad-concept-text { display: grid; gap: 10px; }
.concept-row { display: grid; grid-template-columns: 130px 1fr; gap: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.concept-k { font-weight: 700; color: var(--blue-700); font-size: .9rem; }
.concept-v { color: var(--ink-soft); font-size: .95rem; }
@media (max-width: 480px) { .concept-row { grid-template-columns: 1fr; gap: 2px; } }

/* Telefon-Popup (Vor-Ort-Beratung, Desktop) */
.phone-modal { text-align: center; }
.phone-modal-ico { display: inline-grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; background: var(--blue-50); color: var(--blue-700); }
.phone-modal-num { display: inline-block; margin: 18px 0 8px; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.8rem, 1.2rem + 2vw, 2.6rem); color: var(--blue-800); letter-spacing: -.02em; }
.phone-modal-num:hover { color: var(--blue-600); }
