/* Chat and voice mode of hyperpowered.ai, with the helper classes and buttons they use. On the start page after
   styles.css; on the page "Leading Agents" without it (inhalte/bau.mjs takes the markup of the chat from
   index.html). The tokens come from tokens.css. */

/* ---------- What the chat takes from the base of styles.css on a page with a base of its own. :where() keeps the
   weight of those base rules, so on the start page nothing changes. ---------- */
:where(.chat, .ki-zeichen, .nachweis), :where(.chat, .ki-zeichen, .nachweis) *,
:where(.chat, .ki-zeichen, .nachweis) *::before, :where(.chat, .ki-zeichen, .nachweis) *::after { box-sizing: border-box; }
.chat { font-size: 17px; line-height: 1.5; overflow-wrap: break-word; }
:where(.chat) :where(h1, h2, h3, h4, p, ul, ol) { margin: 0; }
:where(.chat) :where(h1, h2, h3) { color: var(--c-text); }
:where(.chat) :where(button, input, textarea) { color: inherit; font: inherit; }
/* The sign stands outside the page's own boxes; it takes what body gives it on the start page. */
:where(.ki-zeichen) { color: var(--c-text-body); font: 16px/1.5 var(--font); overflow-wrap: break-word; }
:where(.chat) a { color: var(--c-accent); }
:where(.chat) :focus-visible, :where(.ki-zeichen):focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }
:where(.chat) [hidden] { display: none !important; }

/* ---------- Helpers ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.is-locked { overflow: hidden; }
.sprite { position: absolute; width: 0; height: 0; }
.icon { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Buttons ---------- */
.btn, .icon-btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); border: 2px solid transparent; border-radius: var(--radius-pill);
  font-weight: 600; line-height: 1.1; cursor: pointer; text-decoration: none;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn { gap: 8px; padding: 0 20px; font-size: 15px; }
.btn:active, .icon-btn:active { transform: scale(var(--press-scale)); }
.btn--compact { padding: 0 14px; }
.btn--primary { background: var(--c-signal); color: var(--c-on-signal); }
.btn--primary:hover { background: var(--c-signal-hover); }
.btn--outline { background: transparent; border-color: var(--c-line-strong); color: var(--c-text); }
.btn--outline:hover { border-color: var(--c-text); }
.btn--ghost { background: transparent; color: var(--c-text); }
.btn--ghost:hover { background: var(--c-accent-soft); }
.icon-btn { width: var(--tap); padding: 0; background: transparent; color: var(--c-text); }
.icon-btn:hover { background: var(--c-accent-soft); }
/* The direct entries of the empty chat: cards of the file, flush and equally wide. */
.chip {
  appearance: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 54px; padding: 10px 16px 10px 18px; border: 1px solid var(--haar); border-radius: 0;
  background: var(--papier); box-shadow: 0 2px 5px rgba(18, 18, 18, 0.07); color: var(--tinte);
  font: 500 clamp(14px, calc(2.2cqw + 1px), 16px) / 1.25 var(--marke); letter-spacing: -0.01em; text-align: left; cursor: pointer;
  transition: transform 180ms var(--ease);
}
.chip::after { content: "→"; font: 500 17px / 1 var(--mono); }
.chip:hover, .chip:focus-visible { transform: translateY(-3px); }

/* ---------- The sign that reopens the chat: stands free where the close button was. The star in ink
   breathes, a yellow star runs outward behind it, the small spark blinks against the beat. One and a half times
   the first size, so visitors notice it. The button keeps its size and 4 px to the edge,
   so the focus ring stays inside the window and the centre level with the switches; the star overflows it. ---------- */
.ki-zeichen {
  position: fixed; z-index: 30; top: 4px; right: 4px; display: none; place-items: center;
  width: 60px; height: 60px; padding: 0; appearance: none; border: 0; background: none; cursor: pointer;
}
.chat-closed .ki-zeichen { display: grid; }
.ki-zeichen svg { width: 70px; height: 70px; overflow: visible; }
.ki-zeichen path { transform-box: fill-box; transform-origin: center; }
.ki-zeichen__echo { fill: var(--gelb); animation: ki-echo 2.2s cubic-bezier(0.2, 0.6, 0.3, 1) infinite; }
.ki-zeichen__stern { fill: var(--tinte); animation: ki-atmen 2.2s ease-in-out infinite; }
.ki-zeichen__funke { fill: var(--tinte); animation: ki-funke 2.2s ease-in-out infinite; }
.ki-zeichen:hover .ki-zeichen__stern, .ki-zeichen:focus-visible .ki-zeichen__stern { animation-duration: 0.9s; }
@keyframes ki-atmen { 0%, 100% { transform: scale(0.86) rotate(0deg); } 45% { transform: scale(1.14) rotate(14deg); } }
@keyframes ki-echo { 0% { transform: scale(0.8); opacity: 1; } 75%, 100% { transform: scale(2.3); opacity: 0; } }
@keyframes ki-funke { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.25) rotate(45deg); opacity: 0.2; } }

/* ---------- Chat: the file. Docked with half the window from 1024 px, full screen below ---------- */
.chat {
  --chat-gutter: clamp(16px, 5cqw, 40px);
  position: fixed; inset: 0; top: var(--vvt, 0); width: 100%; max-width: none;
  height: var(--vvh, 100dvh); max-height: none; margin: 0; padding: 0; border: 0;
  flex-direction: column; overflow: hidden; container: chat / inline-size; isolation: isolate;
  background: var(--tisch); color: var(--tinte); font-family: var(--antiqua);
  transition: background var(--dur-slow) var(--ease);
}
.chat[open] { display: flex; }
.chat::backdrop { background: rgba(18, 18, 18, 0.55); }
/* On a phone with the keyboard open the chat ends at the edge of the visible area (js/chat.js, fitViewport); below it
   lie keyboard and bars of Safari, which one sees through. There Safari paints nothing of the dialog, neither its
   backdrop nor an outline, only the page. So while the chat fills the screen the page is hidden and its ground takes the
   colour of the chat, so the page does not shine through at the bottom. */
.is-locked body > :not(.chat) { visibility: hidden; }
.is-locked body { background: var(--tisch); }
.is-locked:has(.chat.is-empty:not([data-voice-view]), .chat[data-voice-view="stage"]) body { background: var(--stage); }
@media (min-width: 1024px) {
  .chat { left: auto; width: 50%; z-index: 20; border-left: 1px solid var(--c-line-strong); }
  /* The panel slides out of and into the window in the time and curve in which .site changes its margin, so
     chat and page move as one edge. js/chat.js sets .chat-bewegt after the first paint: the chat that is
     open on load stands there without moving. */
  .chat-bewegt .chat {
    translate: 100% 0;
    transition: translate var(--dur-slow) var(--ease), display var(--dur-slow) allow-discrete, background var(--dur-slow) var(--ease);
  }
  .chat-bewegt .chat[open] { translate: 0 0; }
  @starting-style { .chat-bewegt .chat[open] { translate: 100% 0; } }
}

/* "Neuer Chat" starts at the left edge of the column of sheets, which stands in the middle of the panel. */
.chat__head { flex: none; display: flex; align-items: center; height: 52px; padding: 0 8px 0 max(var(--chat-gutter), calc((100cqw - 600px) / 2)); }
.chat__new {
  appearance: none; padding: 8px 0; border: 0; background: none; color: var(--c-text); cursor: pointer;
  font: 500 12px / 1 var(--mono); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px;
}
#chat-close { margin-left: auto; }
.chat__scroll {
  position: relative; flex: 1 1 0; min-height: 0; padding: 4px var(--chat-gutter) 40px;
  overflow-y: auto; overscroll-behavior: contain; container-type: size;
  scrollbar-width: thin; scrollbar-color: var(--c-line-strong) transparent;
}
.chat__scroll:focus-visible { outline-offset: -2px; }
/* Focus set by opening the chat, without a ring until a key is pressed (focusQuietly in js/dom.js). */
[data-quiet]:focus-visible { outline: none; }
.chat__suggestions { display: grid; gap: 9px; max-width: 600px; margin-inline: auto; }

/* The empty chat is the voice stage: the wave field fills the panel, the direct entries and the input lie on it.
   A typed question brings the light file, "Voice starten" the voice stage. */
/* Behind everything in the panel, in front of its ground. */
.chat__field { position: absolute; z-index: -1; inset: 0; display: none; width: 100%; height: 100%; pointer-events: none; }
.chat.is-empty:not([data-voice-view]) { --c-text: var(--fest-grund); --c-accent-soft: rgba(243, 242, 238, 0.12); --c-focus: var(--fest-grund); background: var(--stage); }
.chat.is-empty:not([data-voice-view]) .chat__field { display: block; }
/* The field shows sound; while the person types it leaves (chat.js, syncField). */
.chat.is-empty.is-typing:not([data-voice-view]) .chat__field { display: none; }
.chat.is-empty:not([data-voice-view]) .chat__hint { color: rgba(243, 242, 238, 0.72); }
/* The veil keeps the hint readable over the moving field. */
.chat.is-empty:not([data-voice-view]) .chat__foot { background: linear-gradient(180deg, rgba(18, 18, 18, 0), rgba(18, 18, 18, 0.9) 78%); }

/* ---------- Conversation: every question and its answer form one sheet. The question is the headline, set
   in the type of the stage; each sheet lies on the one before, the edges a little offset. ---------- */
.chat__log { max-width: 600px; margin-inline: auto; }
.turn + .turn { margin-top: -16px; }
.turn:nth-child(3n + 1) { margin-right: 22px; }
.turn:nth-child(3n + 2) { margin-left: 16px; margin-right: 2px; }
.turn:nth-child(3n) { margin-left: 6px; margin-right: 12px; }
/* The last question can stand at the top, so the answer runs in visibly below it. */
.turn:last-child { min-height: calc(100cqh - 32px); }
.msg--user {
  padding: 21px 24px 18px; border: 1px solid var(--haar); border-bottom: 1.5px solid var(--tinte);
  background: var(--papier); box-shadow: 0 -2px 6px rgba(18, 18, 18, 0.08); color: var(--tinte);
  font: 600 clamp(18px, calc(3.1cqw + 1px), 22px) / 1.22 var(--marke); letter-spacing: -0.025em; text-wrap: balance; overflow-wrap: anywhere;
}
.msg--bot { padding: 20px 24px 48px; border: 1px solid var(--haar); border-top: 0; background: var(--papier); box-shadow: 0 2px 6px rgba(18, 18, 18, 0.08); }
.msg__note { margin-top: 12px; color: var(--c-text-muted); font: 400 12px / 1.4 var(--mono); }
.msg__error { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 8px; padding: 12px 14px; background: var(--c-danger-soft); color: var(--c-danger); font-size: 16px; }
.msg__error .icon { align-self: flex-start; margin-top: 1px; }
.msg__error p { flex: 1 1 200px; }
.msg__error .btn { border-color: currentColor; color: var(--c-danger); font-family: var(--font); }
/* Below a written answer: copy, thumbs up, thumbs down (js/feedback.js). A pressed thumb carries the yellow of the
   page; its Tally form sits on paper in both themes, because the form itself is light. */
.feedback-row { margin-top: 14px; }
.feedback__bar { display: flex; gap: 2px; margin-left: -9px; }
.feedback__btn {
  appearance: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: transparent; color: var(--c-text-muted); cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.feedback__btn .icon { width: 17px; height: 17px; }
.feedback__btn:hover, .feedback__btn[data-state="copied"] { background: var(--c-accent-soft); color: var(--c-text); }
.feedback__btn[aria-pressed="true"] { background: var(--gelb); color: #121212; }
.feedback__btn:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }
/* The form stands on the sheet itself: its background is transparent and its colours are those of the theme, a hairline
   above it separates it from the answer. Fixed height, the form scrolls inside (js/feedback.js says why). */
.feedback { margin-top: 12px; padding-top: 4px; border-top: 1px solid var(--c-line); }
.nachricht { margin-top: 14px; }
/* At most as high as the visible chat (100cqh of .chat__scroll), so the whole frame with its send button fits. */
.feedback__frame { display: block; width: calc(100% + 16px); height: min(640px, 70vh, 100cqh); margin-left: -8px; border: 0; color-scheme: normal; }
/* After sending: the thanks of the page in place of the frame, with the check in yellow. */
.feedback__danke { display: flex; align-items: center; gap: 10px; padding: 14px 0 2px; color: var(--c-text); font: 400 17px / 1.45 var(--antiqua); }
.feedback__danke .icon { flex: none; width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: var(--gelb); color: #121212; stroke-width: 2.5; }
/* Before the visitor agreed: who gets data when the form loads, and the button that agrees and loads it. */
.einwilligung { padding: 12px 0 2px; }
.einwilligung p { margin: 0 0 12px; color: var(--c-text-muted); font-size: 15px; line-height: 1.5; }
.einwilligung a { color: var(--c-text); text-decoration: underline; text-underline-offset: 2px; }
.typing { display: inline-flex; align-items: center; gap: 5px; padding: 8px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--c-text-muted); animation: typing 1.2s infinite var(--ease); }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 60%, 100% { opacity: 0.3; } 30% { opacity: 1; } }

/* ---------- Answer text: set like a page of a magazine ---------- */
/* Same size as the running text of the page (leistungen.css .tafel__zitat). */
.answer { color: var(--tinte); font: 400 clamp(18px, calc(1.42vw + 1px), 21.5px) / 1.56 var(--antiqua); text-wrap: pretty; overflow-wrap: anywhere; }
.answer > * + * { margin-top: 0.85em; }
.answer h3 { margin-top: 1.7em; font: 600 0.92em / 1.3 var(--marke); letter-spacing: -0.015em; }
.answer h4 { margin-top: 1.7em; font: 600 0.8em / 1.3 var(--marke); letter-spacing: -0.01em; }
.answer h3:first-child, .answer h4:first-child { margin-top: 0; }
.answer h3 + *, .answer h4 + * { margin-top: 0.7em; }
.answer ul, .answer ol { padding: 0; border-bottom: 1px solid var(--haar); list-style: none; counter-reset: punkt; }
.answer li { position: relative; padding: 0.5em 0 0.55em 2em; border-top: 1px solid var(--haar); counter-increment: punkt; }
.answer ol > li::before { content: counter(punkt); position: absolute; left: 0; font: 600 0.62em / 2.55 var(--marke); }
.answer ul > li::before { content: ""; position: absolute; left: 0.2em; top: 1.15em; width: 6px; height: 6px; background: var(--tinte); }
/* Bold carries the yellow stroke, like the marked passage of a quote on the page. */
.answer strong { margin: 0 -0.12em; padding: 0 0.12em; background: linear-gradient(var(--marker), var(--marker)) no-repeat 0 62% / 100% 74%; font-weight: 600; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.answer a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
/* Soft fade-in of new text while an answer runs (fadeIn in js/html.js): six steps from pale to full ink. */
::highlight(einblenden-0) { color: color-mix(in srgb, var(--tinte) 8%, transparent); }
::highlight(einblenden-1) { color: color-mix(in srgb, var(--tinte) 25%, transparent); }
::highlight(einblenden-2) { color: color-mix(in srgb, var(--tinte) 42%, transparent); }
::highlight(einblenden-3) { color: color-mix(in srgb, var(--tinte) 58%, transparent); }
::highlight(einblenden-4) { color: color-mix(in srgb, var(--tinte) 75%, transparent); }
::highlight(einblenden-5) { color: color-mix(in srgb, var(--tinte) 92%, transparent); }
/* The yellow brush stroke of the stage (same shape, same filter) behind the first headline of an answer. */
.answer .strich { position: relative; z-index: 0; display: inline-block; white-space: nowrap; }
.answer .strich svg { position: absolute; z-index: -1; left: -0.2em; top: 50%; width: calc(100% + 0.4em); height: 2.3em; margin-top: -1.31em; overflow: visible; transform: rotate(-1.6deg); pointer-events: none; }
.answer .strich path { fill: none; stroke: var(--marker); stroke-width: 25; }

/* ---------- Input: the next sheet of the file, built like the sheets of the answers. The question is written
   on top in the type of the questions with the send button in its corner, below it lies the same ink line, below
   that, centred, the start of the voice chat. ---------- */
/* No position here: the voice stage inside the foot spreads over the whole panel. */
.chat__foot { flex: none; padding: 10px var(--chat-gutter) 14px; }
.composer, .chat__hint, .chat__foot .voice { max-width: 600px; margin-inline: auto; }
.composer {
  border: 1px solid var(--haar); background: var(--papier); cursor: text;
  box-shadow: 0 1px 1px rgba(18, 18, 18, 0.05), 0 8px 22px rgba(18, 18, 18, 0.1);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.composer:focus-within { border-color: var(--tinte); box-shadow: 0 1px 1px rgba(18, 18, 18, 0.06), 0 10px 26px rgba(18, 18, 18, 0.16); }
/* The server ended the chat for this browser (js/chat.js, endChat): input, send, voice and suggestions are off. */
.chat.is-ended :is(.composer, .chat__suggestions) { opacity: 0.45; }
.chat.is-ended :is(.composer, .chat__suggestions) :disabled { cursor: not-allowed; }
/* The send button belongs to the question: it sits at the right edge of the field on the height of its first line;
   the text ends before it. 11px: the middle of the first line minus half the button. */
.composer__feld { position: relative; }
.composer__input {
  display: block; width: 100%; min-height: calc(2lh + 36px); max-height: calc(6lh + 36px); padding: 20px 68px 16px 24px;
  border: 0; outline: 0; resize: none; background: none; color: var(--tinte); caret-color: var(--tinte);
  font: 500 clamp(18px, calc(2.9cqw + 1px), 20px) / 1.4 var(--marke); letter-spacing: -0.02em;
}
.composer__input::placeholder { color: color-mix(in srgb, var(--tinte) 36%, transparent); opacity: 1; }
.composer__row { display: flex; align-items: center; justify-content: center; min-height: 60px; padding: 0 24px; border-top: 1.5px solid var(--tinte); }
/* While a voice chat runs, voice.js hides the start; then the line below the question goes with it. */
.composer__row:has(> .composer__voice[hidden]) { display: none; }
.composer__voice {
  appearance: none; display: inline-flex; align-items: center; gap: 11px; height: 44px; padding: 0; border: 0;
  background: none; color: var(--tinte); cursor: pointer; font: 500 12.5px / 1 var(--marke); letter-spacing: -0.01em;
}
.composer__voice span { padding: 0.2em 0.25em; background: linear-gradient(var(--marker), var(--marker)) no-repeat 0 80% / 0% 50%; transition: background-size var(--dur-normal) var(--ease); }
.composer__voice:hover span, .composer__voice:focus-visible span { background-size: 100% 50%; }
/* The sign for speech: four upright strokes, without a ground. */
.sprechwelle { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.composer__send {
  appearance: none; position: absolute; right: 10px; top: 11px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: var(--tinte); color: var(--grund); cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.composer__send:hover, .composer__send:focus-visible { background: var(--gelb); color: var(--fest-tinte); }
.composer__send .icon { width: 18px; height: 18px; stroke-width: 1.8; }
.chat__hint { margin-block: 10px 0; color: var(--c-text-muted); font: 400 11.5px / 1.45 var(--mono); }

/* ---------- Voice mode ----------
   One component (#voice) in three forms. data-voice-view on the dialog names the form, data-voice the state.
   stage: dark stage with the wave field over conversation and input, dark in both themes.
   bar: folded into a bar above the input field, the conversation goes on.
   note: hint after the end, or an error message above the input field.
   The voice mode keeps its own type; the file look of the chat stops here. */
.voice { font-family: var(--font); }
/* color on the canvas is the colour of the small wave row in bar and note. */
.voice__canvas { display: block; flex: none; color: var(--c-accent); }
.chat[data-voice="speaking"] .voice__canvas { color: var(--c-wave-speaking); }
.chat[data-voice="error"] .voice__canvas { color: var(--c-text-muted); }
.voice__text { flex: 1; min-width: 0; }
.voice__state { display: flex; align-items: center; gap: 8px; color: var(--c-text); font-weight: 600; }
.voice__state strong { font-weight: inherit; }
.voice__alert { display: none; color: var(--c-danger); }
.chat[data-voice="error"] .voice__alert { display: block; }
/* The caption shows two lines in the bar and five on the stage, anchored at the lower edge: what was
   said last stays visible, the cut is at the top. */
.voice__caption { line-height: 1.35; }
.voice__caption span { display: flex; flex-direction: column-reverse; max-height: 2.7em; overflow: hidden; }
.voice__actions { flex: none; display: flex; align-items: center; gap: 4px; }
.voice__retry, .voice__short { display: none; }
.chat[data-voice="error"] .voice__caption, .chat[data-voice="error"] .voice__end { display: none; }
#voice-audio { display: none; }

/* Bar */
.chat[data-voice-view="bar"] .voice { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 6px 8px 6px 12px; border: 1px solid var(--haar); background: var(--papier); color: var(--c-text); }
.chat[data-voice-view="bar"] .voice__canvas { width: 48px; height: 40px; }
.chat[data-voice-view="bar"] .voice__text { font-size: 15px; line-height: 1.35; }
.chat[data-voice-view="bar"] .voice__caption { color: var(--c-text-body); }
.chat[data-voice-view="bar"] .voice__open .icon { transform: rotate(180deg); }
.chat[data-voice-view="bar"] .voice__end { padding: 0 14px; }
.chat[data-voice-view="bar"] .voice__short { display: inline; }
.chat[data-voice-view="bar"] .voice__long, .chat[data-voice-view="bar"] .voice__back { display: none; }

/* Note */
.chat[data-voice-view="note"] .voice { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 10px 14px; border: 1px solid var(--haar); background: var(--papier); color: var(--c-text-body); font-size: 15px; }
.chat[data-voice="error"][data-voice-view="note"] .voice { background: var(--c-danger-soft); color: var(--c-danger); }
.chat[data-voice-view="note"] .voice__canvas { width: 44px; height: 32px; }
.chat[data-voice="error"][data-voice-view="note"] .voice__canvas,
.chat[data-voice-view="note"] .voice__state, .chat[data-voice-view="note"] .voice__caption,
.chat[data-voice-view="note"] .voice__actions { display: none; }

/* Stage. Conversation and input stay in the layout, so the conversation keeps its place; they cannot be reached. */
.chat[data-voice-view="stage"] .chat__scroll, .chat[data-voice-view="stage"] .composer,
.chat[data-voice-view="stage"] .chat__hint { visibility: hidden; }
.chat[data-voice-view="stage"] .chat__head {
  --c-text: var(--fest-grund); --c-accent-soft: rgba(243, 242, 238, 0.12); --c-focus: var(--fest-grund);
  border-color: var(--stage-line); background: var(--stage);
}
/* voice.js sets --voice-top to the height of the chat head. */
.chat[data-voice-view="stage"] .voice {
  --c-text: var(--fest-grund); --c-line-strong: rgba(243, 242, 238, 0.4); --c-accent-soft: rgba(243, 242, 238, 0.12);
  --c-danger: #ffb3c0; --c-focus: var(--fest-grund);
  /* On the dark stage the ink-coloured button would vanish; here it takes the yellow of the page. */
  --c-signal: var(--gelb); --c-signal-hover: #ffe470; --c-on-signal: var(--fest-tinte);
  position: absolute; z-index: 2; inset: var(--voice-top, 61px) 0 0; display: flex; flex-direction: column;
  max-width: none; margin: 0; padding: 26px 24px 14px; overflow: hidden;
  background: var(--stage); color: var(--stage-text);
  animation: voice-rise var(--dur-normal) var(--ease) both;
}
@keyframes voice-rise { from { opacity: 0; transform: translateY(12px); } }
/* The veil keeps the buttons readable over the moving field. */
.chat[data-voice-view="stage"] .voice::after {
  content: ""; position: absolute; inset: auto 0 0; height: 200px; pointer-events: none;
  background: linear-gradient(180deg, rgba(18, 18, 18, 0), rgba(18, 18, 18, 0.86) 58%);
}
.chat[data-voice-view="stage"] .voice__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.chat[data-voice-view="stage"] .voice__text { position: relative; z-index: 1; flex: none; max-width: 34em; }
.chat[data-voice-view="stage"] .voice__state { font-size: 28px; font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }
.chat[data-voice-view="stage"] .voice__alert { width: 26px; height: 26px; }
.chat[data-voice-view="stage"] .voice__caption { height: 7em; margin-top: 10px; font-size: 18px; line-height: 1.4; }
.chat[data-voice-view="stage"] .voice__caption span { max-height: 7em; }
.chat[data-voice-view="stage"] .voice-message { margin-top: 10px; font-size: 18px; line-height: 1.4; }
.chat[data-voice-view="stage"] .voice__actions { position: relative; z-index: 1; flex-direction: column; margin-top: auto; }
.chat[data-voice-view="stage"] .voice__end, .chat[data-voice-view="stage"] .voice__retry { width: 100%; max-width: 330px; min-height: 56px; font-size: 17px; }
.chat[data-voice="error"][data-voice-view="stage"] .voice__retry { display: inline-flex; }
.chat[data-voice-view="stage"] .voice__open { display: none; }

/* ---------- Reduced motion: no slide, no rise, steady dots. The wave field shows a still frame (voice-stage.js). ---------- */
@media (prefers-reduced-motion: reduce) {
  .site, .chat, .chat-bewegt .chat, .btn, .icon-btn, .chip, .composer, .composer__voice span, .composer__send { transition: none; }
  .ki-zeichen path { animation: none; }
  .ki-zeichen__echo { transform: scale(1.5); opacity: 0.9; }
  .chat[data-voice-view="stage"] .voice { animation: none; }
  .typing i { animation: none; opacity: 0.6; }
}

/* The box of Cloudflare's check "I am not a robot" (js/nachweis.js): under the waiting answer, on the voice stage or,
   for the sheets, above the input sheet, each as wide as its place; without height unless Cloudflare wants a click.
   In front of the voice stage (z-index 2). Without an open chat (newsletter form of the page) at the bottom of the window. */
.nachweis { position: relative; z-index: 3; }
.turn > .nachweis, .voice__text > .nachweis { margin-top: 12px; }
.chat > .nachweis { flex: none; width: min(600px, 100cqw - 2 * var(--chat-gutter)); margin: 0 auto 10px; }
body > .nachweis { position: fixed; inset: auto 0 16px; z-index: 50; display: flex; justify-content: center; pointer-events: none; }
body > .nachweis > * { pointer-events: auto; }
