/* Wito ECO Designstandard 1.0. Generated from docs/ecosystem/design-system/design-tokens.json; Wito themes only. */
:root {
  color-scheme: light;
  --brand: #044654;
  --cyan: #5cc2ca;
  --canvas: #f3f7f8;
  --surface: #fff;
  --raised: #fff;
  --subtle: #eaf1f3;
  --soft: #f6f8fa;
  --ink: #182b34;
  --secondary: #536971;
  --muted: #5a6e78;
  --line: #dbe5e8;
  --line-strong: #bdcdd3;
  --action: #044654;
  --on-action: #fff;
  --glass: rgb(255 255 255 / 0.83);
  --glass-line: rgb(255 255 255 / 0.96);
  --shadow: 0 4px 18px rgb(4 42 53 / 0.035), 0 1px 2px rgb(4 42 53 / 0.04);
  --shadow-float: 0 24px 80px rgb(4 42 53 / 0.16), 0 2px 12px rgb(4 42 53 / 0.06);
  --focus: #087488;
  --accent-glow: rgb(92 194 202 / 0.19);
  --violet-bg: #f0eafb;
  --violet-ink: #683ab0;
  --blue-bg: #e7f2fc;
  --blue-ink: #08628f;
  --green-bg: #e4f5ee;
  --green-ink: #11744e;
  --amber-bg: #fff3d9;
  --amber-ink: #815400;
  --pink-bg: #fae9f7;
  --pink-ink: #9e248c;
  --red-bg: #ffebeb;
  --red-ink: #b13535;
  --teal-bg: #e1f0f1;
  --teal-ink: #044654;
  --radius: 20px;
  --sidebar: 232px;
  --font: Geist, system-ui, -apple-system, Arial, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #5cc2ca;
  --cyan: #5cc2ca;
  --canvas: #0b141a;
  --surface: #121f28;
  --raised: #192b35;
  --subtle: #203740;
  --soft: #162831;
  --ink: #edf5f7;
  --secondary: #afc2ca;
  --muted: #9bb1bb;
  --line: #2a414c;
  --line-strong: #3b5663;
  --action: #5cc2ca;
  --on-action: #10262b;
  --glass: rgb(18 31 40 / 0.85);
  --glass-line: rgb(132 188 207 / 0.13);
  --shadow: 0 4px 18px rgb(0 0 0 / 0.1), 0 1px 2px rgb(0 0 0 / 0.08);
  --shadow-float: 0 24px 80px rgb(0 0 0 / 0.4), 0 2px 12px rgb(0 0 0 / 0.15);
  --focus: #76d3db;
  --accent-glow: rgb(92 194 202 / 0.09);
  --violet-bg: #302543;
  --violet-ink: #d0b3fa;
  --blue-bg: #193346;
  --blue-ink: #9ad6f4;
  --green-bg: #16392f;
  --green-ink: #8ddaba;
  --amber-bg: #3c3019;
  --amber-ink: #f1ca82;
  --pink-bg: #3c2540;
  --pink-ink: #edb0e6;
  --red-bg: #42282e;
  --red-ink: #f6aaaa;
  --teal-bg: #1b3941;
  --teal-ink: #8bd3d9;
  --radius: 20px;
  --sidebar: 232px;
  --font: Geist, system-ui, -apple-system, Arial, sans-serif;
}

/* Wito ECO Designstandard 1.0. Host semantic tokens are inherited; one central runtime. */
.wito-assistant { color: var(--ink, inherit); font: 15px/1.6 var(--font, system-ui, sans-serif); display: flex; flex-direction: column; gap: 16px; min-inline-size: 0; inline-size: 100%; container: workspace / inline-size; }
.wito-assistant *, .wito-assistant *::before, .wito-assistant *::after { box-sizing: border-box; }
.wito-assistant :is(button, select, textarea, input), .wa-action a { font: inherit; color: inherit; min-inline-size: 0; max-inline-size: 100%; border: 1px solid var(--line-strong, GrayText); border-radius: 12px; background: var(--surface, Canvas); padding: 10px 14px; }
.wito-assistant :is(button, select), .wa-action a { min-block-size: 44px; overflow-wrap: anywhere; }
.wito-assistant button, .wa-action a { cursor: pointer; min-inline-size: 44px; }
.wito-assistant :is(button, select, textarea, input, summary, a):focus-visible { outline: 3px solid var(--focus, Highlight); outline-offset: 3px; }
.wito-assistant button:disabled { opacity: .6; cursor: not-allowed; }
.wito-assistant button:not(:disabled):hover, .wa-action a:hover { background: var(--subtle, ButtonFace); }
.wa-toolbar, .wa-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wa-toolbar select { flex: 1 1 180px; }
.wa-messages { max-block-size: 55vh; min-block-size: 12rem; overflow: auto; overscroll-behavior: contain; overflow-wrap: anywhere; scrollbar-width: thin; padding: 4px; }
.wa-message { white-space: pre-wrap; margin: 16px 0; padding: 16px 20px; border-radius: 18px; background: var(--soft, Canvas); }
.wa-user { background: var(--teal-bg, ButtonFace); margin-inline-start: 12%; }
.wa-assistant { margin-inline-end: 4%; }
.wa-composer { border: 1px solid var(--line-strong, GrayText); border-radius: 18px; padding: 16px; background: var(--surface, Canvas); }
.wa-composer:focus-within { border-color: var(--focus, Highlight); }
.wito-assistant textarea { display: block; resize: vertical; inline-size: 100%; max-block-size: 30dvh; min-block-size: 72px; border: 0; padding: 0; background: transparent; }
.wa-context { display: flex; align-items: center; gap: 8px; min-block-size: 44px; margin-block: 4px; font-size: 12px; color: var(--secondary, GrayText); }
.wa-context input { flex: none; inline-size: 18px; block-size: 18px; padding: 0; accent-color: var(--action, Highlight); }
.wa-buttons { justify-content: flex-end; }
.wito-assistant button.wa-send { background: var(--action, #044654); border-color: var(--action, #044654); color: var(--on-action, #fff); }
.wito-assistant button.wa-send:not(:disabled):hover { filter: brightness(.94); background: var(--action, #044654); }
.wa-composer p { font-size: 12px; line-height: 1.5; color: var(--secondary, GrayText); margin: 8px 0 0; overflow-wrap: anywhere; }
.wa-action { border: 1px solid var(--line-strong, GrayText); border-radius: 18px; padding: 16px; margin-block: 12px; }
.wa-action a { display: inline-flex; align-items: center; margin: 4px 8px 4px 0; text-decoration: none; }
.wito-assistant details { font-size: 12px; color: var(--secondary, GrayText); }
.wito-assistant summary { padding: 10px 4px; min-block-size: 44px; cursor: pointer; }
.wito-assistant [hidden] { display: none !important; }

/* Workspace reuses the same history, messages, voice and composer as the embedded panel. */
.wa-layout-workspace { display: grid; grid-template-columns: 256px minmax(0, 1fr); gap: 0; block-size: 100%; min-block-size: 30rem; background: var(--surface, Canvas); }
.wa-layout-workspace[data-navigation-collapsed="true"], .wa-layout-workspace[data-navigation="drawer"] { grid-template-columns: minmax(0, 1fr); }
.wa-history-nav { position: static; margin: 0; padding: 20px 16px; min-inline-size: 0; inline-size: 100%; max-inline-size: none; max-block-size: 100%; border: 0; border-inline-end: 1px solid var(--line, GrayText); color: inherit; background: var(--soft, Canvas); }
.wa-history-nav[open] { display: flex; flex-direction: column; gap: 16px; min-block-size: 0; }
.wa-history-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wa-history-heading h2 { margin: 0; font-size: 16px; font-weight: 600; }
.wa-history-heading button { max-inline-size: 110px; font-size: 12px; padding: 6px 10px; }
.wa-history-nav .wa-toolbar { flex: none; }
.wa-history-nav .wa-toolbar button { inline-size: 100%; text-align: start; font-weight: 550; }
.wito-assistant .wa-history-search { inline-size: 100%; min-block-size: 44px; font-size: 13px; }
.wa-history-list { flex: 1; display: flex; flex-direction: column; gap: 4px; min-block-size: 0; overflow-y: auto; scrollbar-width: thin; padding: 4px; margin: -4px; }
.wa-history-list button { text-align: start; flex: none; inline-size: 100%; background: transparent; border-color: transparent; font-size: 14px; }
.wa-history-list button[aria-current="page"] { background: var(--teal-bg, ButtonFace); border-color: var(--line-strong, GrayText); font-weight: 600; }
.wa-history-empty { font-size: 12px; color: var(--secondary, GrayText); margin: 0; }
.wa-conversation { min-inline-size: 0; min-block-size: 0; display: grid; grid-template-rows: auto minmax(6rem, 1fr) auto auto; padding: 0 clamp(12px, 3cqi, 32px) 16px; }
.wa-conversation-heading { min-inline-size: 0; display: flex; align-items: center; gap: 12px; padding-block: 16px; border-block-end: 1px solid var(--line, GrayText); }
.wa-conversation-heading > div { min-inline-size: 0; overflow-wrap: anywhere; }
.wa-conversation-heading strong { display: block; font-size: 16px; font-weight: 550; }
.wa-conversation-heading small { display: block; font-size: 12px; color: var(--secondary, GrayText); }
.wa-layout-workspace .wa-messages { max-block-size: none; min-block-size: 0; padding: 20px max(4px, calc((100% - 760px) / 2)); }
.wa-conversation > :is(.wa-composer, details) { inline-size: 100%; max-inline-size: 760px; justify-self: center; }
.wa-layout-workspace[data-navigation="drawer"] .wa-history-nav { position: fixed; inset: 12px auto 12px 12px; margin: 0; inline-size: min(320px, calc(100cqi - 24px)); max-inline-size: calc(100vw - 24px); max-block-size: calc(100dvh - 24px); border: 1px solid var(--line, GrayText); border-radius: 20px; box-shadow: var(--shadow-float, none); }
.wa-history-nav::backdrop { background: rgb(0 0 0 / .32); }
@container workspace (max-width: 500px) { .wa-toolbar { align-items: stretch; } .wa-message { margin-inline: 0; padding: 12px 14px; } .wa-composer { padding: 12px; } .wa-buttons button { flex: 1 1 100px; } .wa-conversation-heading { align-items: flex-start; } }
@media (prefers-reduced-motion: reduce) { .wito-assistant *, .wito-assistant *::before, .wito-assistant *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media (forced-colors: active) { .wa-history-list button[aria-current="page"] { border: 2px solid Highlight; } .wa-action { border: 1px solid CanvasText; } }

/* Native Chat shell; Wito ECO 1.0 tokens are prepended by the asset build. */
@font-face { font-family: Geist; src: url("./design/geist-latin.woff2") format("woff2"); font-style: normal; font-weight: 100 900; font-display: swap; }
* { box-sizing: border-box; }
:root { background: var(--canvas); color: var(--ink); font-family: var(--font); --chat-header: 76px; }
body { margin: 0; font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; container: eco / inline-size; }
button, select, input, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button, select { min-block-size: 44px; border: 1px solid var(--secondary); border-radius: 12px; background: var(--surface); padding: 10px 14px; }
button { cursor: pointer; min-inline-size: 44px; }
button:disabled { cursor: not-allowed; opacity: .6; }
button:not(:disabled):hover, .account-links a:hover { background: var(--subtle); }
a { color: var(--action); }
:is(a, button, select, textarea, input, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; inset: 8px auto auto 12px; z-index: 50; padding: 12px; background: var(--surface); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.chat-header { position: sticky; inset-block-start: 0; z-index: 20; display: flex; align-items: center; gap: 20px; min-block-size: calc(var(--chat-header) + env(safe-area-inset-top)); padding: calc(10px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left)); background: var(--glass); border-block-end: 1px solid var(--line); backdrop-filter: blur(16px); }
.chat-brand { display: inline-flex; flex: none; align-items: center; gap: 14px; min-block-size: 44px; color: var(--ink); text-decoration: none; }
.chat-brand img { inline-size: 96px; block-size: auto; object-fit: contain; }
.chat-brand strong { font-size: 14px; font-weight: 550; border-inline-start: 1px solid var(--line-strong); padding-inline-start: 14px; }
.chat-search { display: flex; align-items: center; gap: 10px; min-inline-size: 0; margin-inline-end: auto; color: var(--secondary); background: var(--soft); border-color: var(--line); font-size: 13px; }
.chat-search kbd { margin-inline-start: 20px; font: 11px var(--font); color: var(--secondary); white-space: nowrap; }
.chat-icon { display: inline-block; inline-size: 20px; block-size: 20px; flex: none; background: currentColor; mask-size: contain; mask-repeat: no-repeat; mask-position: center; }
.icon-search { mask-image: url("./design/search.svg"); }
.icon-account { mask-image: url("./design/ui-user.svg"); }
.icon-close { mask-image: url("./design/ui-close.svg"); }
#wallet { display: inline-flex; min-inline-size: 0; flex: none; margin-inline-start: auto; --wito-wallet-surface: var(--surface); --wito-wallet-field: var(--soft); --wito-wallet-border: var(--line-strong); --wito-wallet-text: var(--ink); --wito-wallet-muted: var(--secondary); }
.account-trigger { display: inline-flex; align-items: center; gap: 8px; text-align: start; background: transparent; border-color: transparent; max-inline-size: 220px; }
.account-trigger > span:last-child { min-inline-size: 0; }
.account-trigger strong, .account-trigger small { display: block; overflow-wrap: anywhere; }
.account-trigger strong { font-size: 13px; font-weight: 550; }
.account-trigger small { font-size: 11px; color: var(--secondary); }
.chat-workspace { min-inline-size: 0; min-block-size: calc(100dvh - var(--chat-header)); display: flex; flex-direction: column; container: workspace / inline-size; }
#companion { min-inline-size: 0; block-size: calc(100dvh - var(--chat-header) - env(safe-area-inset-top)); }
#companion:empty { display: none; }
#welcome { inline-size: min(100%, 720px); margin: auto; padding: 64px 24px; }
#welcome h1 { font-size: clamp(30px, 5cqi, 48px); line-height: 1.2; letter-spacing: -.035em; font-weight: 550; margin: 12px 0 20px; }
#welcome p { max-inline-size: 60ch; color: var(--secondary); }
#welcome .eyebrow { color: var(--action); font-size: 11px; font-weight: 600; letter-spacing: .12em; }
.welcome-login { display: inline-flex; align-items: center; min-block-size: 44px; padding: 12px 18px; border-radius: 12px; background: var(--action); color: var(--on-action); text-decoration: none; margin-block-start: 16px; }
body:has(#logout:not([hidden])) #welcome, body:has(#companion:not([hidden]) > *) #welcome { display: none; }
/* While the silent sign-in runs the button would only invite a needless click. */
:root[data-auth="checking"] .welcome-login { visibility: hidden; }
.chat-notice { color: var(--secondary); padding: 20px 24px; margin: 0; text-align: center; overflow-wrap: anywhere; }
.chat-notice:empty { display: none; }
.account-menu { position: fixed; inset: calc(var(--chat-header) + 8px + env(safe-area-inset-top)) 12px auto auto; margin: 0; padding: 24px; inline-size: min(380px, calc(100cqi - 24px)); max-inline-size: calc(100vw - 24px); max-block-size: calc(100dvh - var(--chat-header) - 32px - env(safe-area-inset-top)); overflow-y: auto; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-float); }
.account-menu::backdrop { background: rgb(0 0 0 / .18); }
.account-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.account-heading h2 { margin: 0; font-size: 20px; font-weight: 600; }
.account-heading button { display: grid; place-items: center; padding: 10px; }
.account-links { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 16px; }
.account-links a, .account-session a { display: inline-flex; align-items: center; min-block-size: 44px; padding: 10px 12px; border-radius: 12px; }
.account-section { display: block; border-block-start: 1px solid var(--line); padding-block: 16px; font-weight: 550; }
.account-section h3 { margin: 0 0 8px; font-size: 14px; font-weight: 550; }
.account-section p { font-weight: 400; font-size: 12px; color: var(--secondary); overflow-wrap: anywhere; }
.account-section select { display: block; inline-size: 100%; min-inline-size: 0; margin-block-start: 8px; }
/* Benachrichtigungen: Schalter mit Lage des Knopfs als Zeichen, nicht nur Farbe. */
.notify-row { display: flex; align-items: center; gap: 16px; min-block-size: 44px; font-weight: 450; font-size: 14px; cursor: pointer; }
.notify-row > span { flex: 1; min-inline-size: 0; }
.notify-switch { appearance: none; -webkit-appearance: none; position: relative; flex: none; inline-size: 44px; block-size: 26px; margin: 0; border: 2px solid var(--muted); border-radius: 999px; background: transparent; cursor: pointer; }
.notify-switch::after { content: ""; position: absolute; inset-block-start: 4px; inset-inline-start: 4px; inline-size: 14px; block-size: 14px; border-radius: 50%; background: var(--muted); transition: transform .15s ease; }
.notify-switch:checked { border-color: var(--action); background: var(--action); }
.notify-switch:checked::after { background: var(--on-action); transform: translateX(18px); }
.notify-switch:disabled { opacity: .55; cursor: not-allowed; }
.notify-switch:focus-visible, .notify-install:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[dir="rtl"] .notify-switch:checked::after { transform: translateX(-18px); }
.notify-install { margin-block-start: 8px; inline-size: 100%; min-block-size: 44px; white-space: normal; }
.notify-section p:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .notify-switch::after { transition: none; } }
@media (forced-colors: active) { .notify-switch { forced-color-adjust: none; border-color: CanvasText; } .notify-switch::after { background: CanvasText; } .notify-switch:checked { background: Highlight; border-color: Highlight; } .notify-switch:checked::after { background: HighlightText; } }
#account-organizations { display: flex; flex-direction: column; gap: 8px; margin-block-start: 12px; }
#account-organizations button { text-align: start; white-space: normal; overflow-wrap: anywhere; }
#account-organizations button[aria-pressed="true"] { background: var(--teal-bg); border-color: var(--action); }
#account-context-retry { margin-block-start: 8px; }
#organisation { font-size: 13px; margin-block-start: 12px; }
.account-session { border-block-start: 1px solid var(--line); padding-block-start: 16px; }
.account-session button { inline-size: 100%; white-space: normal; }
.feedback-slot { position: fixed; inset: auto auto max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); z-index: 25; }
@container eco (max-width: 900px) { .chat-search kbd { display: none; } .account-trigger small { display: none; } }
@container eco (max-width: 640px) { .chat-header { gap: 8px; padding-inline: 12px; } .chat-brand { gap: 8px; } .chat-brand strong { padding-inline-start: 8px; } .chat-search { padding: 10px; } .chat-search > span:not(.chat-icon) { position: absolute; inline-size: 1px; block-size: 1px; clip-path: inset(50%); overflow: hidden; } .account-trigger { padding: 10px; } .account-trigger > span:last-child { position: absolute; inline-size: 1px; block-size: 1px; clip-path: inset(50%); overflow: hidden; } }
@media (max-width: 500px) { .chat-header > span:not(#wallet) { display: none; } .chat-header { gap: 4px; padding-inline: 8px; } .chat-brand { gap: 6px; } .chat-brand strong { padding-inline-start: 6px; font-size: 12px; } .account-menu { padding: 16px; } }
@media (prefers-reduced-transparency: reduce) { .chat-header { background: var(--surface); backdrop-filter: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
@media (forced-colors: active) { .chat-icon { background: ButtonText; } .chat-header, .account-menu, .shell-notice { border: 1px solid CanvasText; } }
/* Embedded in the Wito shell: brand and account live in the host bar. */
:root[data-embed] { --chat-header: 56px; }
:root[data-embed] #wallet { display: none; }
:root[data-embed] .chat-brand, :root[data-embed] .account-trigger { display: none; }
:root[data-embed] .chat-header { min-block-size: var(--chat-header); padding-block: 8px; }

/* Field boundaries use existing readable secondary ink (AA non-text contrast). */
input, textarea { border-color: var(--secondary); }

/* Minimal composer: icon-only actions with instant tooltips, hints behind an info icon. */
.wito-assistant :is(.wa-voice, .wa-send, .wa-stop, .wa-info) { position: relative; flex: none; font-size: 0; padding: 0; inline-size: 44px; border-radius: 999px; display: inline-grid; place-items: center; }
.wito-assistant :is(.wa-voice, .wa-send, .wa-stop, .wa-info)::before { content: ""; inline-size: 22px; block-size: 22px; background: currentColor; mask: var(--wa-icon) center / contain no-repeat; }
.wito-assistant .wa-voice { --wa-icon: url("./design/mic.svg"); background: transparent; border-color: transparent; }
.wito-assistant .wa-send { --wa-icon: url("./design/send.svg"); }
.wito-assistant .wa-stop { --wa-icon: url("./design/stop.svg"); }
.wito-assistant .wa-info { --wa-icon: url("./design/info.svg"); background: transparent; border-color: transparent; color: var(--secondary); }
.wito-assistant .wa-buttons { flex-wrap: nowrap; }
.wito-assistant .wa-infowrap { position: relative; margin-inline-end: auto; display: inline-flex; }
/* Der Hinweistext bleibt für Lesegeräte im Dokument; sichtbar wird er über den gemeinsamen Tooltip (tooltips.ts). */
.wito-assistant .wa-infotip { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; padding: 0; border: 0; }
.wito-assistant .wa-composer p[role="status"]:empty { display: none; }
@media (forced-colors: active) { .wito-assistant :is(.wa-voice, .wa-send, .wa-stop, .wa-info)::before { background: ButtonText; } }

/* Gemeinsame Wito-Kopfleiste (shellbar.js) ersetzt die eigene Kopfzeile; Guthaben und Suche sind dorthin umgezogen. */
:root[data-shell] .chat-header { display: none; }
:root[data-shell] #wallet { margin-inline-start: 0; }
:root[data-shell] .wsh-app-row:empty { display: none; }
.shell-notice { position: fixed; inset-block-start: calc(var(--chat-header) + 12px); inset-inline: 12px; z-index: 45; margin-inline: auto; inline-size: fit-content; max-inline-size: min(560px, calc(100vw - 24px)); display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border: 1px solid var(--red-ink); border-radius: 12px; background: var(--red-bg); color: var(--red-ink); box-shadow: var(--shadow-float); font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.shell-notice-close { flex: none; display: grid; place-items: center; padding: 10px; background: transparent; border-color: transparent; color: currentColor; }
.shell-notice-close:not(:disabled):hover { background: transparent; opacity: .75; }
/* ===== Messenger (Chats) · Icons als Masken, Tags in den Token-Farben ===== */
.icon-chats { mask-image: url("./design/chats.svg"); }
.icon-group { mask-image: url("./design/group.svg"); }
.icon-org { mask-image: url("./design/org.svg"); }
.icon-agency { mask-image: url("./design/agency.svg"); }
.icon-customer { mask-image: url("./design/customer.svg"); }
.icon-meeting { mask-image: url("./design/meeting.svg"); }
.icon-plus { mask-image: url("./design/plus.svg"); }
.icon-back { mask-image: url("./design/back.svg"); }
.icon-assistant { mask-image: url("./design/assistant.svg"); }
.icon-agent-passive { mask-image: url("./design/agent-passive.svg"); }
.icon-agent-off { mask-image: url("./design/agent-off.svg"); }
.icon-agent-active { mask-image: url("./design/agent-active.svg"); }
.icon-settings { mask-image: url("./design/settings.svg"); }
.icon-filter { mask-image: url("./design/filter.svg"); }
.icon-unread { mask-image: url("./design/unread.svg"); }
.icon-send { mask-image: url("./design/send.svg"); }

/* Sofort sichtbarer Tooltip (Hover und Tastaturfokus): ein Element in der obersten Ebene, Platzierung in tooltips.ts (DS-37). */
.wito-tip { position: fixed; inset: auto; margin: 0; inline-size: max-content; max-inline-size: min(260px, calc(100vw - 16px)); padding: 6px 10px; border: 0; border-radius: 8px; background: var(--ink); color: var(--surface); font-size: 12px; font-weight: 400; line-height: 1.4; text-align: start; overflow-wrap: anywhere; pointer-events: none; box-shadow: var(--shadow-float); }

/* Symbol-Knöpfe: Symbol absolut zentriert (DS-36), nie im Fluss neben verstecktem Text. */
.icon-btn { position: relative; inline-size: 44px; block-size: 44px; padding: 0; border-radius: 999px; display: inline-block; flex: none; }
.icon-btn > .chat-icon { position: absolute; inset-block-start: 50%; inset-inline-start: 50%; translate: -50% -50%; }
.msg-send { background: var(--action); color: var(--on-action); border-color: var(--action); }
.msg-send:not(:disabled):hover { background: var(--action); filter: brightness(1.1); }

/* Reiter: aktiv = Symbol + Wort in kräftiger Farbe, sonst nur Symbol, Hover klappt das Wort auf. */
.chat-tabs { display: flex; gap: 6px; padding: 8px max(16px, env(safe-area-inset-left)); border-block-end: 1px solid var(--line); background: var(--surface); }
.chat-tab { display: inline-flex; align-items: center; gap: 0; border-radius: 999px; border-color: transparent; background: transparent; color: var(--secondary); padding: 8px 12px; min-block-size: 40px; overflow: hidden; }
.chat-tab .chat-tab-label { max-inline-size: 0; margin-inline-start: 0; opacity: 0; visibility: hidden; overflow: hidden; white-space: nowrap; transition: max-inline-size .2s, margin .2s, opacity .2s, visibility .2s; }
.chat-tab:is(:hover, :focus-visible) .chat-tab-label, .chat-tab[aria-selected="true"] .chat-tab-label { max-inline-size: 12ch; margin-inline-start: 8px; opacity: 1; visibility: visible; }
.chat-tab[aria-selected="true"] { color: var(--action); background: var(--teal-bg); border-color: var(--action); font-weight: 600; }
.chat-tab .msg-badge { margin-inline-start: 2px; }
.chat-workspace:has(.chat-tabs:not([hidden])) { --chat-tabs: 57px; }
#companion, #messenger { block-size: calc(100dvh - var(--chat-header) - env(safe-area-inset-top) - var(--chat-tabs, 0px)); }
.chat-workspace[data-tab="chats"] #companion, .chat-workspace[data-tab="assistant"] #messenger { display: none; }
#messenger { min-inline-size: 0; }

.msg-badge { display: inline-grid; place-items: center; min-inline-size: 20px; block-size: 20px; padding-inline: 6px; border-radius: 999px; background: var(--action); color: var(--on-action); font-size: 11px; font-weight: 700; line-height: 1; flex: none; }

/* Beziehungstags: Farbe + Symbol + Wort, jede Stufe mit eigenem Farbpaar (hell und dunkel aus den Token). */
.tag-member { --tag-bg: var(--teal-bg); --tag-ink: var(--teal-ink); }
.tag-group { --tag-bg: var(--green-bg); --tag-ink: var(--green-ink); }
.tag-org { --tag-bg: var(--blue-bg); --tag-ink: var(--blue-ink); }
.tag-customer { --tag-bg: var(--amber-bg); --tag-ink: var(--amber-ink); }
.tag-agency { --tag-bg: var(--violet-bg); --tag-ink: var(--violet-ink); }
.msg-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 6px; border-radius: 999px; background: var(--tag-bg); color: var(--tag-ink); font-size: 11px; font-weight: 600; line-height: 1.5; white-space: nowrap; flex: none; }
.msg-tag .chat-icon { inline-size: 14px; block-size: 14px; }

.msg { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); block-size: 100%; min-block-size: 0; position: relative; }
.msg-list { display: flex; flex-direction: column; min-block-size: 0; border-inline-end: 1px solid var(--line); background: var(--surface); }
.msg-list-head { display: flex; gap: 8px; align-items: center; padding: 12px; }
.msg-search { flex: 1; display: flex; align-items: center; gap: 8px; min-inline-size: 0; padding-inline: 12px; border: 1px solid var(--secondary); border-radius: 999px; background: var(--soft); color: var(--secondary); }
.msg-search input { flex: 1; min-inline-size: 0; border: 0; background: transparent; padding: 10px 0; min-block-size: 40px; color: var(--ink); }
.msg-search:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.msg-search input:focus-visible { outline: 0; }
.msg-filter-wrap { position: relative; flex: none; }
.msg-filter-btn[data-active="true"] { background: var(--tag-bg, var(--teal-bg)); color: var(--tag-ink, var(--action)); border-color: var(--tag-ink, var(--action)); }
.msg-filter-badge { position: absolute; inset-block-start: -2px; inset-inline-end: -2px; inline-size: 20px; block-size: 20px; border-radius: 50%; background: var(--tag-ink, var(--action)); color: var(--surface); border: 2px solid var(--surface); }
.msg-filter-badge > .chat-icon { position: absolute; inset-block-start: 50%; inset-inline-start: 50%; translate: -50% -50%; inline-size: 10px; block-size: 10px; }
.msg-filter-menu { position: fixed; inset: auto; margin: 0; z-index: 20; display: grid; color: var(--ink); gap: 2px; min-inline-size: 200px; padding: 6px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 12px 32px rgb(0 0 0 / 0.18); }
.msg-filter-menu[hidden] { display: none; }
.msg-filter { display: flex; align-items: center; gap: 10px; min-block-size: 44px; padding: 6px 12px; border-radius: 12px; border-color: transparent; background: transparent; font-size: 14px; color: var(--ink); text-align: start; }
.msg-filter .chat-icon { inline-size: 18px; block-size: 18px; flex: none; }
.msg-filter[class*="tag-"] .chat-icon { color: var(--tag-ink); }
.msg-filter:hover { background: var(--soft); }
.msg-filter[aria-pressed="true"] { background: var(--teal-bg); color: var(--action); font-weight: 600; }
.msg-filter[class*="tag-"][aria-pressed="true"] { background: var(--tag-bg); color: var(--tag-ink); }
.msg-filter[aria-pressed="true"]::after { content: ""; margin-inline-start: auto; inline-size: 8px; block-size: 8px; border-radius: 50%; background: currentColor; }
.msg-scroll { overflow-y: auto; min-block-size: 0; flex: 1; padding-block-end: 12px; }
.msg-items { list-style: none; margin: 0; padding: 0 8px; display: flex; flex-direction: column; gap: 2px; }
.msg-section { margin: 12px 20px 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--secondary); }
.msg-empty { padding: 24px 16px; color: var(--secondary); text-align: center; }
.msg-item { display: flex; gap: 12px; align-items: center; inline-size: 100%; text-align: start; border-color: transparent; background: transparent; border-radius: 16px; padding: 10px 12px; min-block-size: 64px; }
.msg-item[aria-current="true"], .msg-item[aria-pressed="true"] { background: var(--teal-bg); border-color: var(--action); }
.msg-avatar { position: relative; flex: none; inline-size: 44px; block-size: 44px; border-radius: 50%; background: var(--tag-bg); color: var(--tag-ink); }
.msg-avatar > .chat-icon { position: absolute; inset-block-start: 50%; inset-inline-start: 50%; translate: -50% -50%; inline-size: 22px; block-size: 22px; }
.msg-item-main { display: flex; flex-direction: column; gap: 2px; min-inline-size: 0; flex: 1; }
.msg-item-top, .msg-item-bottom { display: flex; align-items: center; gap: 8px; min-inline-size: 0; }
.msg-item-top strong { flex: 1; min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.msg-item-top time { color: var(--secondary); font-size: 11px; flex: none; }
.msg-preview { flex: 1; min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--secondary); font-size: 12px; }

.msg-thread { display: flex; flex-direction: column; min-inline-size: 0; min-block-size: 0; background: var(--canvas); }
.msg-placeholder { margin: auto; display: grid; justify-items: center; gap: 12px; color: var(--secondary); text-align: center; padding: 24px; }
.msg-placeholder .chat-icon { inline-size: 48px; block-size: 48px; color: var(--secondary); }
.msg-thread-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-block-end: 1px solid var(--line); background: var(--surface); }
.msg-back { display: none; }
.msg-thread-title { flex: 1; min-inline-size: 0; }
.msg-thread-title h2 { margin: 0; font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-thread-sub { display: flex; align-items: center; gap: 8px; color: var(--secondary); font-size: 12px; }
.msg-meet, .msg-summary { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; }
.msg-meet { background: var(--action); color: var(--on-action); border-color: var(--action); }
.msg-meet:not(:disabled):hover { background: var(--action); filter: brightness(1.1); }
.msg-agent-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; border-block-end: 1px solid var(--line); background: var(--soft); }
.msg-agent-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--secondary); }
.msg-agent { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); }
.msg-agent-step { display: inline-flex; align-items: center; gap: 6px; border-color: transparent; background: transparent; border-radius: 999px; min-block-size: 36px; padding: 4px 12px; font-size: 13px; color: var(--secondary); }
.msg-agent-step[aria-checked="true"] { background: var(--action); color: var(--on-action); font-weight: 600; }
.msg-moderate { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; min-block-size: 36px; }
.msg-moderate input { inline-size: 20px; block-size: 20px; }
.msg-paused { margin: 0; padding: 8px 14px; background: var(--amber-bg); color: var(--amber-ink); font-size: 12px; }
.msg-messages { flex: 1; min-block-size: 0; overflow-y: auto; list-style: none; margin: 0; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg-bubble { max-inline-size: min(78%, 620px); padding: 8px 14px 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); align-self: flex-start; }
.msg-bubble.mine { align-self: flex-end; background: var(--teal-bg); border-color: var(--line-strong); }
.msg-bubble.agent { background: var(--violet-bg); border-color: var(--violet-ink); }
.msg-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--secondary); }
.msg-meta strong { color: var(--ink); font-weight: 600; }
.msg-ai { display: inline-flex; align-items: center; gap: 4px; color: var(--violet-ink); font-weight: 600; }
.msg-ai .chat-icon { inline-size: 14px; block-size: 14px; }
.msg-text { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-ai-note { font-size: 11px; color: var(--secondary); }
.msg-system { align-self: center; color: var(--secondary); font-size: 12px; text-align: center; overflow-wrap: anywhere; }
.msg-composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-block-start: 1px solid var(--line); background: var(--surface); }
.msg-composer textarea { flex: 1; min-inline-size: 0; resize: none; border: 1px solid var(--secondary); border-radius: 22px; padding: 10px 16px; background: var(--soft); min-block-size: 44px; max-block-size: 160px; line-height: 1.4; }
.msg-status { position: absolute; inset-inline: 0; inset-block-end: 70px; margin: 0; text-align: center; pointer-events: none; font-size: 12px; color: var(--secondary); }
.msg-status:empty { display: none; }
.msg-dialog { inline-size: min(440px, calc(100vw - 24px)); max-block-size: calc(100dvh - 24px); overflow-y: auto; padding: 20px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-float); }
.msg-dialog::backdrop { background: rgb(0 0 0 / .25); }
.msg-dialog h2 { margin: 0 0 12px; font-size: 18px; }
.msg-dialog label { display: block; margin-block-end: 10px; font-weight: 550; font-size: 13px; }
.msg-dialog input, .msg-dialog select { display: block; inline-size: 100%; margin-block-start: 6px; }
.msg-dialog input[type="text"], .msg-dialog input[type="search"] { border: 1px solid var(--secondary); border-radius: 12px; padding: 10px 12px; min-block-size: 44px; background: var(--soft); }
.msg-dialog .msg-items { padding: 0; max-block-size: 220px; overflow-y: auto; }
.msg-chosen { margin: 8px 0; font-size: 12px; color: var(--secondary); }
.msg-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-block-start: 12px; }
.msg-primary { background: var(--action); color: var(--on-action); border-color: var(--action); }
.msg-hint { margin: 6px 0 0; font-size: 12px; font-weight: 400; color: var(--secondary); }
.msg-settings { inline-size: min(520px, calc(100vw - 24px)); }
.msg-set-section { display: grid; gap: 8px; padding-block: 12px; border-block-start: 1px solid var(--line); }
.msg-set-section:first-of-type { border-block-start: 0; }
.msg-set-section h3 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--secondary); }
.msg-set-section label { margin: 0; }
.msg-check { display: flex !important; align-items: center; gap: 10px; min-block-size: 44px; }
.msg-dialog .msg-check input { inline-size: 20px; block-size: 20px; margin: 0; flex: none; }
.msg-person { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 12px; }
.msg-person .msg-item-main { flex: 1; min-inline-size: 0; }
.msg-person > button { flex: none; min-block-size: 36px; font-size: 13px; }
.msg-owner { font-size: 11px; font-weight: 600; color: var(--secondary); }
.msg-danger { color: var(--red-ink); border-color: currentColor; }
.msg-picker { display: grid; gap: 8px; }
.msg-settings-btn { flex: none; }

/* Schmal: eine Spalte, Liste → Chat. */
@container workspace (max-width: 760px) {
  .msg { grid-template-columns: minmax(0, 1fr); }
  .msg[data-view="list"] .msg-thread, .msg[data-view="thread"] .msg-list { display: none; }
  .msg-back { display: inline-block; }
  .msg-meet > span:not(.chat-icon), .msg-summary > span:not(.chat-icon) { position: absolute; inline-size: 1px; block-size: 1px; clip-path: inset(50%); overflow: hidden; }
  .msg-meet, .msg-summary { inline-size: 44px; block-size: 44px; padding: 0; justify-content: center; }
  .msg-bubble { max-inline-size: 92%; }
}
@media (prefers-reduced-motion: reduce) { .chat-tab .chat-tab-label { transition: none; } }
@media (forced-colors: active) { .msg-tag, .msg-badge, .chat-tab[aria-selected="true"], .msg-agent-step[aria-checked="true"] { border: 1px solid CanvasText; forced-color-adjust: none; background: Canvas; color: CanvasText; } .msg-avatar { border: 1px solid CanvasText; } .wito-tip { border: 1px solid CanvasText; background: Canvas; color: CanvasText; } }

/* Polish (23.11.): ruhige Ränder, ein klarer Hauptknopf, Senden-Symbol mittig. Gilt nur im Chat-Arbeitsbereich. */
/* Flex statt Grid: ein leeres Textknoten-Gitter ließ die Zeile aufspalten und schob das Symbol nach oben. */
.wito-assistant :is(.wa-voice, .wa-send, .wa-stop, .wa-info) { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.wito-assistant .wa-send::before { transform: translateX(-1px); }
.wito-assistant textarea { resize: none; min-block-size: 56px; }
.wito-assistant .wa-composer { border-color: var(--line-strong); box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 8%, transparent), 0 6px 18px color-mix(in srgb, var(--ink) 6%, transparent); }
.wito-assistant .wa-composer:focus-within { border-color: var(--action); box-shadow: 0 0 0 3px color-mix(in srgb, var(--action) 18%, transparent); }
.wito-assistant .wa-history-nav { background: var(--soft); }
.wito-assistant .wa-history-nav .wa-toolbar button { background: var(--action); border-color: var(--action); color: var(--on-action); font-weight: 600; }
.wito-assistant .wa-history-nav .wa-toolbar button:not(:disabled):hover { background: var(--action); filter: brightness(.94); }
.wito-assistant :is(.wa-history-heading button, .wa-conversation-heading button) { background: transparent; border-color: transparent; color: var(--secondary); }
.wito-assistant :is(.wa-history-heading button, .wa-conversation-heading button):not(:disabled):hover { background: var(--subtle); color: var(--ink); }
.wito-assistant .wa-history-list button { border-radius: 10px; }
.wito-assistant .wa-history-list button[aria-current="page"] { border-color: transparent; background: var(--teal-bg); }
.wito-assistant .wa-conversation-heading { border-block-end-color: var(--line); }
.wito-assistant .wa-message { border-radius: 16px; }

/* Eingebettet: Reiter und Suche in EINER Leiste (Reiter wandern per client.ts in die Kopfleiste). */
:root[data-embed] .chat-header .chat-tabs { padding: 0; border: 0; background: transparent; margin-inline-end: auto; }
:root[data-embed] .chat-header .chat-search { margin-inline-start: auto; margin-inline-end: 0; }
:root[data-embed] .chat-header { gap: 8px; padding-inline: 12px; }
/* Übernimmt die Wito-Leiste die Auswahl in ihre Titelleiste (nav-host), entfällt die Zeile im Rahmen ganz. */
:root[data-nav-hosted] { --chat-header: 0px; }
:root[data-nav-hosted] .chat-header { display: none; }
