/* ==========================================================================
   vivekaweb.net — Briefing-Chat im Premium-Look (15.10.2026)
   Ersetzt das CSS, das chatbot.js selbst einsetzt: Die Seite lädt diese Datei mit id="vwc-styles", injectStyles() in
   chatbot.js findet die ID und lässt sein eigenes CSS weg. Logik und Texte bleiben in chatbot.js (Live-Datei, unverändert);
   chatbot-premium.js setzt Kopfzeile, Barrierefreiheit und blendet Emoji aus. Tokens aus basis.css.
   Bild: ein weisses Blatt auf abgedunkeltem Navy, wie Statustafel und Kaufbeleg. Lime nur für Weiter, Absenden und den
   Messpunkt der Fortschrittslinie. Design-Plan: 02_Design/design-plan-premium.md, Abschnitt 11.
   ========================================================================== */

/* Überlagerung: Navy abgedunkelt, ohne Weichzeichner */
.vwc { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s var(--ease); font-family: var(--font-text); }
.vwc--open { opacity: 1; }
.vwc__bd { position: absolute; inset: 0; background: rgba(6, 20, 42, 0.78); }

/* Das Blatt */
.vwc__win {
    position: relative; z-index: 1; display: flex; flex-direction: column;
    width: min(560px, calc(100vw - 32px)); height: min(760px, calc(100dvh - 32px));
    background: #fff; color: var(--text); border-radius: 12px; overflow: hidden;
    box-shadow: 0 60px 100px -50px rgba(0, 0, 0, 0.75), 0 20px 40px -24px rgba(0, 0, 0, 0.5);
    transform: translateY(14px); transition: transform 0.45s var(--ease);
}
.vwc--open .vwc__win { transform: none; }
.vwc__win:focus { outline: none; }

/* Kopf: Zeichen, «Dein Briefing», Zeile mit dem Zusammenhang (Texte aus chatbot-premium.js) */
.vwc__hd { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1rem 1rem 1.4rem; border-bottom: 1px solid var(--linie); }
.vwc__brand { display: flex; align-items: center; gap: 0.8rem; min-width: 0; }
.vwc__av {
    flex: none; width: 36px; height: 36px; font-size: 0; color: transparent;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 52'%3E%3Crect width='52' height='52' rx='10' fill='%23C4F052'/%3E%3Cpath d='M23.77 42 15.94 21.26H20.35L24.45 33.05Q25.14 34.99 25.62 36.95Q26.11 38.9 26.63 40.82H25.42Q25.94 38.9 26.42 36.95Q26.91 34.99 27.57 33.05L31.67 21.26H36.05L28.22 42Z' fill='%230A1F3D'/%3E%3Ccircle cx='40' cy='8' r='4' fill='%230A1F3D'/%3E%3C/svg%3E") center / contain no-repeat;
}
.vwc__nm { font-family: var(--font-display); font-weight: 400; font-size: 1.45rem; line-height: 1.1; letter-spacing: -0.01em; color: var(--navy); }
.vwc__st { margin-top: 0.15rem; font-size: 0.8125rem; line-height: 1.35; color: var(--neben); }
.vwc__dot { display: none; }   /* «Online» mit grünem Punkt: ein Assistent ist nicht online, chatbot-premium.js ersetzt die Zeile */
.vwc__cls { position: relative; flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--radius); color: var(--neben); transition: background-color 0.2s, color 0.2s; }
.vwc__cls:hover { background: var(--papier); color: var(--navy); }
.vwc__cls::before { content: ''; position: absolute; inset: -2px; }   /* Trefferfläche 44 px */

/* Fortschritt als Messlinie: Navy auf der Haarlinie, vorne der Lime-Messpunkt */
.vwc__prog { position: relative; flex: none; height: 2px; background: var(--linie); opacity: 0; transition: opacity 0.3s; }
.vwc__prog--on { opacity: 1; }
.vwc__prog-fill { position: relative; height: 100%; width: 0; background: var(--navy); transition: width 0.5s var(--ease); }
.vwc__prog-fill::after { content: ''; position: absolute; right: -4px; top: 50%; box-sizing: border-box; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--lime); border: 1px solid rgba(10, 31, 61, 0.35); }

/* Nachrichten: Fragen auf Papier, Antworten in Navy */
.vwc__msgs { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 0.6rem; padding: 1.4rem 1.4rem 1.2rem; scroll-behavior: smooth; }
.vwc__msgs::-webkit-scrollbar { width: 6px; }
.vwc__msgs::-webkit-scrollbar-track { background: transparent; }
.vwc__msgs::-webkit-scrollbar-thumb { background: var(--linie-stark); border-radius: 6px; }
.vwc__msg { display: flex; max-width: 86%; animation: vwcAuf 0.3s var(--ease); }
.vwc__msg--bot { align-self: flex-start; }
.vwc__msg--user { align-self: flex-end; }
.vwc__bbl { padding: 0.7rem 0.95rem; border-radius: 12px; font-size: 0.9375rem; line-height: 1.55; overflow-wrap: anywhere; }
.vwc__msg--bot .vwc__bbl { background: var(--papier); color: var(--text); border-bottom-left-radius: 4px; }
.vwc__msg--bot .vwc__bbl strong { font-weight: 600; color: var(--navy); }
.vwc__msg--user .vwc__bbl { background: var(--navy); color: #fff; font-weight: 500; border-bottom-right-radius: 4px; }
.vwc__msg--typing .vwc__bbl { display: flex; align-items: center; gap: 4px; padding: 0.85rem 0.95rem; }
.vwc__msg--typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--leise); animation: vwcPunkt 1.2s infinite ease-in-out; }
.vwc__msg--typing span:nth-child(2) { animation-delay: 0.2s; }
.vwc__msg--typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes vwcPunkt { 0%, 60%, 100% { opacity: 0.35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes vwcAuf { from { opacity: 0; transform: translateY(6px); } }

/* Eingabe */
.vwc__inp { flex: none; padding: 1rem 1.4rem 1.2rem; border-top: 1px solid var(--linie); background: #fff; }
.vwc__err { margin-bottom: 0.45rem; font-size: 0.8125rem; line-height: 1.45; color: #B42318; }
.vwc__err:empty { margin: 0; }
.vwc__err--soft { color: #7A5300; }   /* freundlicher Hinweis, kein Fehler: dunkles Ocker, 7 : 1 auf Weiss */
.vwc__nav { margin-bottom: 0.55rem; }
.vwc__back { padding: 0.15rem 0; font: inherit; font-size: 0.8125rem; color: var(--neben); background: none; border: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--linie-stark); text-underline-offset: 0.3em; transition: color 0.2s; }
.vwc__back:hover { color: var(--navy); text-decoration-color: currentColor; }
.vwc__txt-wrap { display: flex; align-items: flex-end; gap: 0.5rem; }
.vwc__txt {
    flex: 1; min-width: 0; min-height: 48px; padding: 0.7rem 0.9rem;
    font: inherit; font-size: 1rem; line-height: 1.45; color: var(--text);   /* 16 px: iOS zoomt sonst beim Antippen */
    background: #fff; border: 1px solid var(--feldrand); border-radius: var(--radius); resize: none; transition: border-color 0.2s;
}
.vwc__txt::placeholder { color: #7A8494; }
.vwc__txt:hover { border-color: #5B6677; }
.vwc__txt:focus, .vwc__txt:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; box-shadow: none; border-color: var(--navy); border-radius: var(--radius); }
.vwc__send { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: var(--radius); background: var(--lime); color: var(--navy); box-shadow: inset 0 -1px 0 rgba(10, 31, 61, 0.14); transition: background-color 0.2s; }
.vwc__send:hover { background: var(--lime-hell); }
.vwc__send svg { transition: transform 0.35s var(--ease); }
.vwc__send:hover svg { transform: translateX(2px); }

/* Antworten zum Antippen: umrandet, gewählt in Navy; bei Mehrfachwahl mit Kästchen */
.vwc__opts { display: flex; flex-wrap: wrap; gap: 0.5rem; max-height: 340px; overflow-y: auto; padding: 3px; margin: -3px; }
.vwc__opts::-webkit-scrollbar { width: 4px; }
.vwc__opts::-webkit-scrollbar-thumb { background: var(--linie-stark); border-radius: 4px; }
.vwc__opt {
    position: relative; min-height: 44px; padding: 0.55rem 0.95rem;
    font: inherit; font-size: 0.9375rem; line-height: 1.35; text-align: left; color: var(--navy);
    background: #fff; border: 1px solid var(--linie-stark); border-radius: var(--radius); cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.vwc__opt:hover { border-color: var(--navy); background: var(--papier); }
.vwc__opt--sel, .vwc__opt--sel:hover { border-color: var(--navy); background: var(--navy); color: #fff; font-weight: 500; }
.vwc__opts--multi .vwc__opt { padding-left: 2.4rem; }
.vwc__opts--multi .vwc__opt::before { content: ''; position: absolute; left: 0.85rem; top: 50%; box-sizing: border-box; width: 16px; height: 16px; margin-top: -8px; border: 1.5px solid #8A95A5; border-radius: 3px; background: #fff; }
.vwc__opts--multi .vwc__opt--sel::before { border-color: var(--lime); background: var(--lime); }
.vwc__opts--multi .vwc__opt--sel::after { content: ''; position: absolute; left: calc(0.85rem + 5.5px); top: 50%; width: 4px; height: 8px; margin-top: -6px; border: solid var(--navy); border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); }
.vwc__multi-counter { width: 100%; margin: 0.3rem 0 0.1rem; font-size: 0.8125rem; color: var(--neben); }
.vwc__confirm { width: 100%; min-height: 48px; margin-top: 0.35rem; padding: 0 1rem; font: inherit; font-size: 0.9375rem; font-weight: 600; color: var(--navy); background: var(--lime); border-radius: var(--radius); box-shadow: inset 0 -1px 0 rgba(10, 31, 61, 0.14); cursor: pointer; transition: background-color 0.2s; }
.vwc__confirm:hover { background: var(--lime-hell); }
/* Fussblock der Mehrfachwahl: Zähler, Satz und Weiter kleben unten im Kasten, die Antworten laufen darunter durch.
   Am Handy lag Weiter sonst unsichtbar im inneren Scrollbereich (Handy-Analyse 20.10.2026) */
.vwc__opts-fuss { position: sticky; bottom: -3px; z-index: 1; flex: 0 0 100%; display: flow-root; margin-bottom: -3px; padding-bottom: 3px; background: #fff; }   /* -3px: deckt das Polster des Kastens */
.vwc__opts--mehr .vwc__opts-fuss { box-shadow: 0 -1px 0 var(--linie); }

/* Absenden und Termin */
.vwc__sub-wrap { display: flex; flex-direction: column; gap: 0.55rem; }
.vwc__sub-btn { width: 100%; min-height: 54px; padding: 0 1rem; font: inherit; font-size: 1rem; font-weight: 600; color: var(--navy); background: var(--lime); border-radius: var(--radius); box-shadow: inset 0 -1px 0 rgba(10, 31, 61, 0.14); cursor: pointer; transition: background-color 0.2s, opacity 0.2s; }
.vwc__sub-btn:hover:not(:disabled) { background: var(--lime-hell); }
.vwc__sub-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.vwc__sub-btn--link { display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }
.vwc__sub-status { min-height: 1em; font-size: 0.875rem; line-height: 1.5; text-align: center; color: #B42318; }
.vwc__sub-status--info { color: var(--text); }
.vwc__sub-status a { color: inherit; text-decoration: underline; text-underline-offset: 0.2em; }

/* Emoji aus den Texten von chatbot.js (chatbot-premium.js verpackt sie, der Text bleibt für Vergleiche im Skript gleich) */
.vwc-emoji { display: none; }

/* Handy: von unten als Blatt */
@media (max-width: 480px) {
    .vwc__win { align-self: flex-end; width: 100%; height: min(760px, 94dvh); border-radius: 12px 12px 0 0; }
    .vwc__hd { padding: 0.85rem 0.8rem 0.85rem 1.1rem; }
    .vwc__st-zusatz { display: none; }   /* am Handy nur der Zusammenhang; das Speichern sagt die erste Nachricht */
    .vwc__msgs { padding: 1.1rem 1rem 1rem; }
    .vwc__inp { padding: 0.9rem 1rem max(1rem, env(safe-area-inset-bottom)); }
    .vwc__msg { max-width: 92%; }
    .vwc__opts { max-height: 280px; }
}
/* Kurze Fenster (iPhone SE, quer): Antwortkasten höchstens 40 % hoch, der Verlauf behält Platz für die Frage (Handy-Analyse 20.10.2026) */
@media (max-height: 600px) {
    .vwc__opts { max-height: 40dvh; }
}
@media (prefers-reduced-motion: reduce) {
    .vwc, .vwc__win, .vwc__msg { transition: none; animation: none; }
    .vwc__msg--typing span { animation: none; }
    .vwc__prog, .vwc__prog-fill, .vwc__send svg { transition: none; }
    .vwc__msgs { scroll-behavior: auto; }
}
