/* © 2026 Mike Pollow, Digitalroots. Alle Rechte vorbehalten. */
.roboter { position: absolute; inset: 0; container-type: size; --zoom: 1.6; --mx: .498; --my: .552; --mass: 100cqw; }
.roboter-lage { position: absolute; left: calc(50cqw - var(--mx) * var(--zoom) * var(--mass)); top: calc(50cqh - var(--my) * var(--zoom) * var(--mass)); width: calc(var(--zoom) * var(--mass)); aspect-ratio: 1 / 1; }
.roboter-koerper { position: absolute; inset: 0; transform-origin: 50% 82%; }
.roboter-koerper img, .roboter-koerper svg, .roboter-wetter { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.roboter-wetter { overflow: visible; pointer-events: none; }
.roboter svg text { font-family: 'Schibsted Grotesk', 'Segoe UI', Arial, sans-serif; font-weight: 800; }

.chat { --chat-unten: 0px; --chat-breit: 56px; --chat-hoch: 83px; --chat-hut: 0px; position: fixed; z-index: 40; right: 36px; bottom: calc(var(--chat-unten) + 2px); width: var(--chat-breit); height: var(--chat-hoch); pointer-events: none; transition: bottom 280ms var(--kurve); }
body:has(.dock) .chat { --chat-unten: var(--dock-hoch, 132px); }
body:has(.leiste.unten) .chat { --chat-unten: 58px; }
body:has(.dock.weg) .chat, body:has(.leiste.unten.weg) .chat { --chat-unten: 0px; }
.chat .unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.chat-knopf { position: absolute; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; -webkit-tap-highlight-color: transparent; transform-origin: 50% 100%; transition: transform 200ms var(--kurve); }
.chat-knopf:active { transform: scale(.95); }
.chat-knopf:focus-visible { outline: 2px solid var(--gruenspan-hell); outline-offset: 2px; }
.chat-knopf .roboter { --mass: 100cqh; --zoom: 1.663; --mx: .498; --my: .524; pointer-events: none; filter: drop-shadow(0 6px 9px rgba(0, 0, 0, .5)); }
.chat-hinweis { --stufe: 6px; position: absolute; right: calc(var(--chat-breit) / 2 - var(--stufe) / 2); bottom: calc(100% + var(--chat-hut) + 8px); width: max-content; max-width: 276px; filter: drop-shadow(0 12px 20px rgba(0, 0, 0, .5)); pointer-events: auto; opacity: 0; visibility: hidden; transform: translateY(6px) scale(.92); transform-origin: calc(100% - var(--stufe) / 2) 100%; transition: opacity 160ms ease-out, transform 180ms var(--kurve), visibility 0s 180ms; }
.chat-hinweis.da { opacity: 1; visibility: visible; transform: none; transition: opacity 180ms ease-out, transform 320ms cubic-bezier(.34, 1.4, .64, 1), visibility 0s; }
.chat-hinweis-blase { position: relative; padding: 14px 44px calc(15px + var(--stufe) * 3) 16px; font-family: var(--sans); font-size: 16px; font-weight: 500; line-height: 1.4; letter-spacing: -.008em; color: #070D0E; background: #F3F7F6; clip-path: polygon(calc(var(--stufe) * 2) 0, 100% 0, 100% 100%, calc(100% - var(--stufe)) 100%, calc(100% - var(--stufe)) calc(100% - var(--stufe)), calc(100% - var(--stufe) * 2) calc(100% - var(--stufe)), calc(100% - var(--stufe) * 2) calc(100% - var(--stufe) * 2), calc(100% - var(--stufe) * 3) calc(100% - var(--stufe) * 2), calc(100% - var(--stufe) * 3) calc(100% - var(--stufe) * 3), 0 calc(100% - var(--stufe) * 3), 0 calc(var(--stufe) * 2), var(--stufe) calc(var(--stufe) * 2), var(--stufe) var(--stufe), calc(var(--stufe) * 2) var(--stufe)); transform-origin: calc(100% - var(--stufe) / 2) 100%; transition: transform 140ms var(--kurve); }
.chat-hinweis-blase:active { transform: scale(.98); }
.chat-hinweis-text { display: block; padding: 0; font: inherit; letter-spacing: inherit; color: inherit; text-align: left; text-wrap: pretty; background: none; border: 0; cursor: pointer; }
.chat-hinweis-text:focus-visible, .chat-hinweis-zu:focus-visible { outline: 2px solid #1B5A63; outline-offset: 2px; }
.chat-hinweis-zu { position: absolute; top: 0; right: 0; width: 44px; height: 44px; padding: 0; color: #070D0E; background: none; border: 0; opacity: .55; cursor: pointer; transition: opacity 140ms ease; }
.chat-hinweis-zu:focus-visible { outline-offset: -8px; }
.chat-hinweis-zu::before, .chat-hinweis-zu::after, .chat-schliessen::before, .chat-schliessen::after { content: ''; position: absolute; left: 50%; top: 50%; width: 14px; height: 1.5px; margin: -.75px 0 0 -7px; background: currentColor; transform: rotate(45deg); }
.chat-hinweis-zu::after, .chat-schliessen::after { transform: rotate(-45deg); }
.chat-rest { visibility: hidden; }
.tippt .chat-da { margin-right: -.5em; border-right: .5em solid currentColor; animation: chat-marke 850ms steps(1, end) infinite; }
.chat-hinweis.tippt .chat-da { border-right-color: #1B5A63; }
@keyframes chat-marke { 50% { border-right-color: transparent; } }

.chat-fenster { position: absolute; right: calc(100% + 12px); bottom: 0; display: flex; flex-direction: column; width: min(384px, calc(100vw - var(--chat-breit) - 72px)); height: min(580px, calc(100vh - var(--kopf-hoehe) - var(--chat-unten) - 40px)); height: min(580px, calc(100dvh - var(--kopf-hoehe) - var(--chat-unten) - 40px)); background: #050B0C; border: 1px solid var(--linie-stark); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); pointer-events: auto; opacity: 0; transform: translateX(22px); clip-path: inset(0 0 0 100%); transition: opacity 160ms ease, transform 200ms var(--kurve), clip-path 200ms var(--kurve); }
.chat-fenster[hidden] { display: none; }
.chat.offen .chat-fenster { opacity: 1; transform: none; clip-path: inset(-70px); transition: opacity 220ms ease, transform 360ms cubic-bezier(.32, .72, 0, 1), clip-path 360ms cubic-bezier(.32, .72, 0, 1); }
.chat-kopf { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 4px 8px 14px; border-bottom: 1px solid var(--linie); }
.chat-bild { position: relative; flex: 0 0 auto; width: 40px; height: 40px; overflow: hidden; background: rgba(108, 195, 204, .1); box-shadow: inset 0 0 0 1px var(--linie-stark); }
.chat-bild .roboter { --zoom: 2.3; --mx: .497; --my: .44; }
.chat-kopftext { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.chat-titel { font-size: 16px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; color: var(--tinte); }
.chat-status { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 13px; letter-spacing: .02em; color: var(--text); white-space: nowrap; }
.chat-status::before { content: ''; flex: 0 0 auto; width: 9px; height: 9px; background: #3DDC84; box-shadow: 0 0 9px rgba(61, 220, 132, .7); }
.chat-status[data-lage='arbeitet']::before { background: #F0B429; box-shadow: 0 0 9px rgba(240, 180, 41, .7); animation: chat-lampe 900ms ease-in-out infinite; }
.chat-schliessen { position: relative; flex: 0 0 auto; width: 44px; height: 44px; padding: 0; color: var(--text); background: none; border: 0; cursor: pointer; transition: color 140ms ease; }
.chat-schliessen:focus-visible { outline: 2px solid var(--gruenspan-hell); outline-offset: -4px; }
.chat-verlauf { flex: 1 1 0; display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 16px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--linie-stark) transparent; }
.chat-nachricht { flex: 0 0 auto; max-width: 88%; margin: 0; padding: 10px 14px 7px; font-size: 16px; line-height: 1.45; letter-spacing: -.006em; overflow-wrap: anywhere; }
.chat-nachricht.bot { align-self: flex-start; color: var(--tinte); background: rgba(108, 195, 204, .09); border: 1px solid var(--linie); }
.chat-nachricht.gast { align-self: flex-end; color: var(--auf-gruenspan); background: var(--gruenspan); font-weight: 600; }
.chat-satz { display: block; white-space: pre-line; }
.chat-nachricht.tippt { overflow: hidden; }
.chat-nachricht.tippt .chat-verweis, .chat-nachricht.tippt .chat-zeit { visibility: hidden; }
.chat-verweis { display: block; width: fit-content; margin-top: 8px; font-weight: 700; color: var(--gruenspan-hell); text-decoration: underline; text-decoration-color: var(--linie-stark); text-underline-offset: 4px; }
.chat-verweis:focus-visible { outline: 2px solid var(--gruenspan-hell); outline-offset: 3px; }
.chat-zeit { display: block; margin-top: 4px; font-family: var(--mono); font-size: 13px; line-height: 1.3; text-align: right; color: var(--meta); }
.chat-nachricht.gast .chat-zeit { color: rgba(4, 25, 28, .72); }
.chat-nachfrage { padding-bottom: 10px; color: var(--text); border-style: dashed; }
.chat-wartet { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; color: var(--text); }
.chat-punkte { display: inline-flex; gap: 4px; }
.chat-punkte i { width: 6px; height: 6px; background: var(--gruenspan); animation: chat-huepft 1100ms ease-in-out infinite; }
.chat-punkte i:nth-child(2) { animation-delay: 160ms; }
.chat-punkte i:nth-child(3) { animation-delay: 320ms; }
.chat-kacheln { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px; }
.chat-kacheln:not(:empty) { padding-bottom: 12px; }
.chat-kachel { min-height: 40px; max-width: 100%; padding: 6px 12px; font-family: var(--sans); font-size: 14.5px; font-weight: 600; line-height: 1.25; text-align: left; color: var(--gruenspan-hell); background: rgba(6, 13, 14, .35); border: 1px solid var(--linie-stark); cursor: pointer; transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 140ms var(--kurve); }
.chat-kachel:active { transform: scale(.97); }
.chat-kachel:focus-visible { outline: 2px solid var(--gruenspan-hell); outline-offset: 3px; }
.chat-eingabe { flex: 0 0 auto; display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--linie); }
.chat-frage { flex: 1 1 auto; min-width: 0; height: 48px; padding: 0 14px; font-family: var(--sans); font-size: 16px; color: var(--tinte); caret-color: var(--gruenspan); background: rgba(2, 6, 7, .7); border: 1px solid rgba(108, 195, 204, .6); border-radius: 0; transition: border-color 160ms ease, background-color 160ms ease; }
.chat-frage::placeholder { color: var(--meta); opacity: 1; }
.chat-frage:focus { outline: none; border-color: var(--gruenspan-hell); background: rgba(2, 6, 7, .92); box-shadow: 0 0 0 1px var(--gruenspan-hell); }
.chat-eingabe .knopf { min-height: 48px; }
.chat-eingabe .knopf:disabled { opacity: .5; cursor: not-allowed; }
.chat-fuss { flex: 0 0 auto; padding: 0 16px 11px; font-size: 12px; line-height: 1.4; letter-spacing: .01em; color: #6F8786; }
.chat-punkt { position: absolute; top: -2px; right: -4px; display: grid; place-items: center; width: 18px; height: 18px; font-family: var(--mono); font-size: 12px; font-weight: 600; line-height: 1; color: #04191C; background: var(--gruenspan-hell); opacity: 0; transform: scale(0); transition: opacity 300ms ease, transform 300ms cubic-bezier(.34, 1.56, .64, 1); }
.chat.ungelesen .chat-punkt { opacity: 1; transform: scale(1); }
.chat-knopf.leuchtet .roboter { animation: chat-leuchtet 1500ms ease-out; }
@keyframes chat-lampe { 50% { opacity: .35; } }
@keyframes chat-huepft { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes chat-leuchtet { 35% { filter: drop-shadow(0 6px 9px rgba(0, 0, 0, .5)) drop-shadow(0 0 14px rgba(169, 221, 226, .85)); } }

@media (hover: hover) and (pointer: fine) {
  .chat-knopf:hover { transform: scale(1.08); }
  .chat-hinweis-zu:hover { opacity: 1; }
  .chat-schliessen:hover { color: var(--tinte); }
  .chat-kachel:hover { border-color: var(--gruenspan); color: var(--tinte); background: rgba(108, 195, 204, .1); }
  .chat-verweis:hover { color: var(--tinte); text-decoration-color: var(--gruenspan); }
}
@media (min-width: 981px) {
  body:has(.dock.klein) .chat { --chat-unten: var(--dock-klein, 56px); }
  body:has(.dock.weg) .chat { --chat-unten: 0px; }
}
@media (max-width: 980px) {
  body:has(.leiste.unten) .chat { --chat-unten: 52px; }
  body:has(.leiste.unten.weg) .chat { --chat-unten: 0px; }
}
@media (max-width: 640px) {
  .chat { --chat-breit: 44px; --chat-hoch: 64px; right: 24px; }
  .chat-hinweis { display: none; }
  .chat-fenster { right: -12px; bottom: calc(100% + 10px); width: calc(100vw - 24px); height: min(520px, calc(100vh - var(--kopf-hoehe) - var(--chat-unten) - var(--chat-hoch) - 34px)); height: min(520px, calc(100dvh - var(--kopf-hoehe) - var(--chat-unten) - var(--chat-hoch) - 34px)); min-height: 250px; transform: translateY(22px); clip-path: inset(100% 0 0 0); }
}
@media (prefers-reduced-motion: reduce) {
  .chat, .chat-knopf, .chat-fenster, .chat.offen .chat-fenster, .chat-kachel, .chat-punkt, .chat-hinweis-blase { transition: none; }
  .chat-hinweis { transition: opacity 160ms ease-out, visibility 0s 160ms; }
  .chat-hinweis.da { transition: opacity 180ms ease-out, visibility 0s; }
  .chat-fenster, .chat-knopf:hover, .chat-hinweis, .chat-hinweis-blase:active { transform: none; }
  .tippt .chat-da, .chat-status[data-lage='arbeitet']::before, .chat-punkte i, .chat-knopf.leuchtet .roboter { animation: none; }
}
html[data-bewegung='aus'] .chat, html[data-bewegung='aus'] .chat-knopf, html[data-bewegung='aus'] .chat-fenster, html[data-bewegung='aus'] .chat.offen .chat-fenster { transition: none; transform: none; }
@media (pointer: coarse) { .chat-kachel { min-height: 44px; } }
@media print { .chat { display: none; } }
