/* appsolvia Live Agent – Layout und Komponenten (Rezepte aus dem appsolvia Design System) */

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font: 400 16px/1.5 var(--font-body);
  color: var(--text-body);
  background: var(--gradient-app-bg);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 400; letter-spacing: -.015em; color: var(--text-heading); margin: 0; }
code { font-family: var(--font-mono); font-size: .9em; }
a { color: var(--link-color); text-decoration: underline; font-weight: 700; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }
/* FocusOnNavigate setzt den Fokus programmatisch auf die Überschrift – dort keinen Ring zeigen. */
[tabindex="-1"]:focus { outline: none; box-shadow: none; }

.icon { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Rahmen ─────────────────────────────────────────── */

.shell { max-width: 1320px; margin: 0 auto; padding: 24px 40px 24px; }

.topbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 16px 24px; border-radius: var(--radius-8);
  background: var(--surface-card); box-shadow: inset 0 0 0 1px var(--border-default);
}
.brand-logo img { display: block; height: 52px; width: auto; }
.brand-divider { width: 1px; height: 36px; background: var(--border-strong); }
.brand-product h1 { font-size: 24px; line-height: 1.2; }
.brand-sub { display: block; font-size: 14px; color: var(--text-muted); }
.topbar-meta { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--radius-32);
  box-shadow: inset 0 0 0 1px var(--border-strong); font: 700 13px/1.4 var(--font-body); color: var(--text-label);
}

.tag {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 27px;
  font: 700 14px/1 var(--font-body); color: var(--text-label); box-shadow: inset 0 0 0 1.2px currentColor;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tag.status-connecting { color: var(--info-500); background: var(--info-100); box-shadow: none; }
.tag.status-live { color: var(--success-500); background: var(--success-100); box-shadow: none; }
.tag.status-live .status-dot { animation: pulse 1.6s ease-in-out infinite; }
.tag.status-closing { color: var(--warning-500); background: var(--warning-100); box-shadow: none; }
.tag.status-ended { color: var(--text-muted); }
.tag.status-error { color: var(--error-500); background: var(--error-100); box-shadow: none; }

.banner {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 16px; padding: 12px 16px; border-radius: var(--radius-8);
  font-size: 15px;
}
.banner > span { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.banner.compact { margin-top: 0; }
.banner-warning { background: var(--warning-100); color: var(--warning-500); }
.banner-error { background: var(--error-100); color: var(--error-500); }
.banner code { background: rgba(0,0,0,.06); padding: 1px 6px; border-radius: var(--radius-4); }

.layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: 24px; margin-top: 24px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

.card { background: var(--surface-card); border-radius: var(--radius-8); padding: 24px; box-shadow: inset 0 0 0 1px var(--border-default); min-width: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-hint { font-size: 13px; color: var(--text-muted); }
.section-label { font: 400 16px/24px var(--font-heading); text-transform: uppercase; letter-spacing: .04em; color: var(--text-label); }
.session-id { font: 12px/1.4 var(--font-mono); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50%; }
.empty { margin: 0; color: var(--text-muted); font-size: 15px; }
.fineprint { margin: 12px 0 0; font-size: 13px; color: var(--text-muted); }

.footer { margin: 32px 0 8px; text-align: center; font: 400 14px/1.4 var(--font-heading); color: var(--text-muted); }

/* ── Gespräch ───────────────────────────────────────── */

.stage { display: flex; flex-direction: column; gap: 16px; }
.stage .card-head { margin-bottom: 0; }

.orb-area { display: grid; justify-items: center; gap: 4px; }
.orb { width: min(280px, 64vw); aspect-ratio: 1; display: block; }
.orb-caption { margin: 0; color: var(--text-muted); font-size: 16px; text-align: center; min-height: 24px; }

.controls { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

/* Gesprächsoptionen: Stimme und Websuche */
.session-options { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 28px; margin-top: -4px; }
.voice-picker { display: flex; align-items: center; justify-content: center; gap: 12px; }

.option-toggle { display: flex; align-items: center; gap: 10px; }
.toggle {
  position: relative; width: 44px; height: 24px; flex-shrink: 0; border: 0; border-radius: 24px; padding: 0;
  background: var(--surface-card); box-shadow: inset 0 0 0 1px var(--neutral-400); cursor: pointer; transition: background-color .25s ease;
}
.toggle::after {
  content: ""; position: absolute; top: 4px; left: 4px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--neutral-400); transition: transform .25s ease, background-color .25s ease;
}
.toggle[aria-checked="true"] { background: var(--primary-500); box-shadow: none; }
.toggle[aria-checked="true"]::after { transform: translateX(20px); background: #FCFEFD; }
.toggle:disabled { opacity: .5; cursor: not-allowed; }
.toggle-label { display: inline-flex; align-items: center; gap: 6px; font: 700 14px/1.3 var(--font-body); color: var(--text-label); cursor: pointer; }
.toggle-label .icon { color: var(--primary-500); }
.toggle-hint { font-size: 13px; color: var(--text-muted); }

.card-head-actions { display: flex; align-items: center; gap: 8px; min-width: 0; margin: -10px -10px -10px 0; }
.card-head-actions .session-id { max-width: 220px; }
.chip.is-off { opacity: .55; text-decoration: line-through; }
.voice-label { display: inline-flex; align-items: center; gap: 6px; font: 700 14px/1.3 var(--font-body); color: var(--text-label); }
.voice-label .icon { color: var(--primary-500); }
.select-wrap { position: relative; width: min(320px, 100%); }
.select {
  appearance: none; width: 100%; height: 40px; padding: 8px 36px 8px 12px; border: 0; border-radius: var(--radius-8);
  background: var(--surface-card); box-shadow: inset 0 0 0 1px var(--neutral-200); color: var(--text-body);
  font: 400 15px var(--font-body); cursor: pointer; transition: box-shadow .2s ease; text-overflow: ellipsis;
}
.select:hover { box-shadow: inset 0 0 0 1px var(--neutral-400); }
.select:focus { outline: none; box-shadow: inset 0 0 0 1px var(--primary-500), var(--focus-ring); }
.select:disabled { cursor: not-allowed; color: var(--text-muted); background: var(--surface-tint); box-shadow: inset 0 0 0 1px var(--border-default); }
.select option, .select optgroup { color: var(--text-body); background: var(--surface-card); }
.select-chevron { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }

.chat-panel {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--surface-tint); padding: 20px; border-radius: var(--radius-8);
  min-height: 220px; max-height: 44vh; overflow-y: auto; overscroll-behavior: contain;
}
.msg { font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.msg-user {
  align-self: flex-end; max-width: 82%; display: flex; gap: 8px; align-items: flex-start;
  background: var(--surface-card); border-radius: var(--radius-bubble-user); padding: 10px 14px;
  box-shadow: inset 0 0 0 .5px var(--border-strong);
}
.msg-badge { color: var(--text-muted); margin-top: 3px; }
.msg-bot { display: flex; gap: 12px; align-items: flex-start; max-width: 92%; }
.msg-text { padding-top: 4px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: #C7E4DD; color: #0A3933; font: 700 14px/32px var(--font-body); text-align: center;
}

.composer { display: flex; gap: 8px; align-items: center; }

/* ── Controller (DS-Rezepte) ────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--radius-4); padding: 12px 32px; min-height: 44px;
  font: 700 14px/1 var(--font-body); background: var(--btn-primary); color: var(--text-on-primary);
  cursor: pointer; transition: background-color .25s ease, color .25s ease, box-shadow .25s ease;
}
.btn:hover { background: var(--btn-primary-hover); }
.btn:active { background: var(--btn-primary-active); }
.btn:disabled { background: var(--btn-disabled-bg); color: var(--btn-disabled-fg); cursor: not-allowed; }
.btn-large { padding: 16px 40px; font-size: 16px; min-height: 52px; }

.btn-secondary { background: transparent; color: var(--btn-secondary-fg); box-shadow: inset 0 0 0 1.2px var(--btn-secondary-fg); }
.btn-secondary:hover { background: var(--hover-tint); }
.btn-secondary:active { background: var(--active-tint); }
.btn-secondary:disabled { background: transparent; color: var(--neutral-300); box-shadow: inset 0 0 0 1.2px var(--neutral-300); }
.btn-secondary[aria-pressed="true"] { color: var(--accent-orange-500); box-shadow: inset 0 0 0 1.2px var(--accent-orange-500); }

.btn-tertiary {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 8px;
  border-radius: var(--radius-4); font: 700 14px/1 var(--font-body); color: inherit; cursor: pointer; white-space: nowrap;
}
.btn-tertiary:hover { text-decoration: underline; }

.icon-btn {
  width: 44px; height: 44px; border: 0; border-radius: var(--radius-32); background: transparent;
  color: var(--text-label); display: grid; place-items: center; cursor: pointer; transition: var(--transition-fast); flex-shrink: 0;
}
.icon-btn:hover { background: var(--hover-tint); color: var(--btn-secondary-fg); }
.icon-btn:active { background: var(--active-tint); }
.icon-btn:disabled { color: var(--neutral-300); background: transparent; cursor: not-allowed; }

.input {
  height: 44px; width: 100%; padding: 8px 8px 8px 12px; border: 0; border-radius: var(--radius-8);
  background: var(--surface-card); box-shadow: inset 0 0 0 1px var(--neutral-200);
  font: 400 16px var(--font-body); color: var(--text-body); transition: box-shadow .2s ease;
}
.input::placeholder { color: var(--text-muted); }
.input:hover { box-shadow: inset 0 0 0 1px var(--neutral-400); }
.input:focus { outline: none; box-shadow: inset 0 0 0 1px var(--primary-500), var(--focus-ring); }
.input:disabled { background: var(--surface-tint); box-shadow: inset 0 0 0 1px var(--border-default); cursor: not-allowed; }

/* ── Agent-Aktivität ────────────────────────────────── */

.timeline {
  list-style: none; margin: 0; padding: 0 4px 0 0; display: flex; flex-direction: column; gap: 8px;
  max-height: 52vh; overflow-y: auto; overscroll-behavior: contain;
}
.activity { font-size: 14px; }
.activity-delegation {
  padding: 12px 16px; border-radius: var(--radius-8); background: var(--surface-card);
  box-shadow: inset 3px 0 0 var(--primary-300), inset 0 0 0 1px var(--border-default);
}
.activity-delegation.is-done { box-shadow: inset 3px 0 0 var(--primary-500), inset 0 0 0 1px var(--border-default); }
.activity-delegation.is-failed { box-shadow: inset 3px 0 0 var(--error-500), inset 0 0 0 1px var(--border-default); }
.activity-head { display: flex; align-items: center; gap: 8px; color: var(--text-label); }
.activity-title { font-weight: 700; color: var(--text-body); }
.activity-meta { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.activity-step { margin-top: 8px; display: flex; align-items: center; gap: 8px; }
.activity-step em { font-style: normal; color: var(--text-label); }
details.activity-step { display: block; }
details.activity-step summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; border-radius: var(--radius-4); }
details.activity-step summary::-webkit-details-marker { display: none; }
details.activity-step summary code { background: var(--surface-tint); padding: 2px 8px; border-radius: var(--radius-4); color: var(--text-label); }
details.activity-step.is-failed summary code { color: var(--error-500); }
.tool-io { margin: 8px 0 0 24px; }
.tool-io-label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.tool-io pre {
  margin: 4px 0 8px; padding: 8px 10px; border-radius: var(--radius-4); background: var(--surface-tint);
  font: 12px/1.45 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 180px; overflow-y: auto;
}
.activity-text {
  margin: 10px 0 0; padding: 8px 12px; border-radius: var(--radius-bubble-bot); background: var(--surface-tint);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.activity-error { margin: 8px 0 0; color: var(--error-500); }
.activity-usage { margin-top: 6px; font-size: 12px; color: var(--text-muted); }

.activity-note { display: flex; align-items: center; gap: 8px; padding: 2px 4px; font-size: 13px; color: var(--text-muted); }
.activity-note > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.activity-note.level-success { color: var(--success-500); }
.activity-note.level-warning { color: var(--warning-500); }
.activity-note.level-error { color: var(--error-500); }
.activity-note time { font-variant-numeric: tabular-nums; }

.dot-running { width: 8px; height: 8px; border-radius: 50%; background: var(--primary-500); animation: pulse 1.2s ease-in-out infinite; }

/* ── Performance ────────────────────────────────────── */

.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.metric { padding: 12px 16px; border-radius: var(--radius-8); background: var(--surface-tint); min-width: 0; }
.metric dt { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.metric dd { margin: 2px 0 0; font: 400 26px/1.2 var(--font-heading); color: var(--text-heading); font-variant-numeric: tabular-nums; }
.metric-sub { display: block; margin-top: 2px; font-size: 12px; color: var(--text-muted); }

.breakdown { margin-top: 16px; font-size: 13px; }
.breakdown-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--border-default); font-variant-numeric: tabular-nums; }
.breakdown-row:last-child { border-bottom: 0; }
.breakdown-row.sub { padding-left: 16px; color: var(--text-muted); }

.tool-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ── Kosten ─────────────────────────────────────────── */

.cost-total { display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--radius-8); background: var(--surface-tint); }
.cost-amount { font: 400 30px/1.2 var(--font-heading); color: var(--text-heading); font-variant-numeric: tabular-nums; }
.cost-caption { font-size: 13px; color: var(--text-muted); }
.cost-rows { margin: 12px 0 0; }
.cost-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0;
  border-bottom: 1px dashed var(--border-default); font-size: 14px;
}
.cost-row:last-child { border-bottom: 0; }
.cost-row dt { min-width: 0; font-weight: 700; color: var(--text-body); }
.cost-row dt small, .cost-row dd small { display: block; font-weight: 400; font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }
.cost-row dd { margin: 0; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cost-row dd small { display: inline; white-space: normal; }
.cost-source { margin-top: 8px; }
.usage-cost { font-size: 13px; color: var(--text-muted); }
.usage-cost span { opacity: .85; }

/* ── Kopfzeile: Wissensbasis und Key ────────────────── */

.topbar-actions { display: flex; align-items: center; gap: 4px; padding-left: 12px; border-left: 1px solid var(--border-default); }

.knowledge-btn { position: relative; }
.btn-badge {
  position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--primary-500); color: var(--text-on-primary); font: 700 11px/18px var(--font-body); text-align: center;
  box-shadow: 0 0 0 2px var(--surface-card); pointer-events: none;
}
.btn-badge.is-warning { background: var(--accent-orange-500); }
.progress-ring { position: absolute; inset: 0; width: 44px; height: 44px; transform: rotate(-90deg); pointer-events: none; }
.progress-ring circle { fill: none; stroke-width: 2.5; }
.progress-ring-track { stroke: var(--border-default); }
.progress-ring-value { stroke: var(--primary-500); stroke-linecap: round; transition: stroke-dasharray .3s ease; }
.progress-ring.is-indeterminate { animation: ring-spin 1s linear infinite; }

/* ── Laden, Einrichtung ─────────────────────────────── */

.spinner {
  display: inline-block; width: 16px; height: 16px; flex-shrink: 0; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite;
}
.loading { margin-top: 24px; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 64px 24px; color: var(--text-muted); }

.setup-wrap { display: grid; justify-items: center; margin-top: 40px; }
.setup { width: min(560px, 100%); padding: 40px; box-shadow: var(--shadow-5), inset 0 0 0 1px var(--border-default); }
.setup-badge {
  width: 56px; height: 56px; margin-bottom: 20px; border-radius: var(--radius-16);
  display: grid; place-items: center; background: var(--gradient-02); color: #FCFEFD;
}
.setup .section-label { margin: 0 0 4px; font-size: 14px; }
.setup-title { font-size: 30px; line-height: 1.25; }
.setup-intro { margin: 10px 0 0; }
.setup-current { margin: 16px 0 0; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); }
.setup-current code { color: var(--text-label); background: var(--surface-tint); padding: 2px 8px; border-radius: var(--radius-4); }
.setup-form { margin-top: 24px; }
.setup-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.setup-remove { margin-top: 16px; }

.field-label { display: block; margin-bottom: 6px; font: 700 14px/1.3 var(--font-body); color: var(--text-body); }
.field-help { margin: 8px 0 0; font-size: 14px; color: var(--text-muted); }
.field-error { margin: 8px 0 0; display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--error-500); }
.input-group { position: relative; }
.input-group .input { padding-right: 52px; font-family: var(--font-mono); font-size: 15px; }
.input-group .input[type="password"]:not(:placeholder-shown) { letter-spacing: .1em; }
.input-group.is-invalid .input { box-shadow: inset 0 0 0 1px var(--error-500); }
.input-addon { position: absolute; top: 0; right: 0; }

.facts { list-style: none; margin: 24px 0 0; padding: 16px 0 0; border-top: 1px solid var(--border-default); display: grid; gap: 10px; font-size: 14px; color: var(--text-muted); }
.facts li { display: flex; gap: 10px; align-items: flex-start; }
.facts .icon { color: var(--primary-500); margin-top: 1px; }

.btn-danger { color: var(--error-500); }
.btn-small { min-height: 32px; padding: 6px 14px; font-size: 13px; }
.btn-destructive { background: var(--error-500); color: var(--surface-card); }
.btn-destructive:hover { background: var(--error-500); filter: brightness(.88); }
label.btn { user-select: none; }

/* ── Dialoge ────────────────────────────────────────── */

body:has(.modal-layer) { overflow: hidden; }
.modal-layer { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 16px; }
.backdrop { position: absolute; inset: 0; background: rgba(5, 14, 24, .45); animation: fade-in .2s ease; }
.modal {
  position: relative; width: min(440px, 100%); max-height: min(760px, calc(100vh - 32px));
  display: flex; flex-direction: column; border-radius: var(--radius-8); background: var(--surface-card);
  box-shadow: var(--shadow-10), inset 0 0 0 .5px var(--neutral-200); animation: rise-in .2s ease;
}
.modal:focus-visible { box-shadow: var(--shadow-10), inset 0 0 0 .5px var(--neutral-200); }
.modal-lg { width: min(600px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 24px 0; }
.modal-heading .section-label { margin: 0 0 2px; font-size: 13px; }
.modal-head h2 { font: 400 26px/1.3 var(--font-heading); }
.modal-head .icon-btn { margin: -8px -12px 0 0; }
.modal-body { padding: 16px 24px 20px; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { padding: 16px 24px 24px; border-top: 1px solid var(--border-default); display: flex; flex-direction: column; gap: 14px; }
.modal .facts { margin: 0; padding: 0; border: 0; }
.modal .banner { margin-top: 0; }

.dialog-intro { margin: 0; }
.dialog-note { margin: 0; display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text-muted); }
.dialog-note .icon { color: var(--primary-500); margin-top: 1px; }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.dialog-hint { margin-right: auto; font-size: 13px; color: var(--text-muted); }

/* ── Wissensbasis ───────────────────────────────────── */

.usage { display: grid; gap: 8px; padding: 12px 16px; border-radius: var(--radius-8); background: var(--surface-tint); }
.usage-text { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--text-muted); }
.usage-text strong { color: var(--text-heading); }

.meter { height: 6px; border-radius: 3px; background: var(--border-default); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--gradient-02); transition: width .3s ease; }
.meter.is-indeterminate > span { width: 30% !important; animation: slide 1.2s ease-in-out infinite; }

.import { display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--radius-8); box-shadow: inset 0 0 0 1px var(--primary-300); }
.import-head { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--primary-500); }
.import-name { font-weight: 700; color: var(--text-heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-step, .import-queue { font-size: 14px; color: var(--text-muted); }
.import-queue { font-size: 13px; }

.doc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.doc {
  display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 12px; border-radius: var(--radius-8);
  box-shadow: inset 0 0 0 1px var(--border-default); transition: box-shadow .2s ease, background-color .2s ease;
}
.doc:hover { box-shadow: inset 0 0 0 1px var(--border-strong); }
.doc.is-confirming { background: var(--error-100); box-shadow: none; }
.doc-icon { width: 40px; height: 40px; flex-shrink: 0; border-radius: var(--radius-8); display: grid; place-items: center; background: var(--surface-tint); color: var(--primary-500); }
.doc-main { flex: 1; min-width: 0; display: grid; }
.doc-title { font-weight: 700; color: var(--text-heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { font-size: 13px; color: var(--text-muted); }
.doc-remove:hover { color: var(--error-500); background: var(--error-100); }
.doc-confirm { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; font-size: 14px; font-weight: 700; color: var(--error-500); }
.doc-confirm .btn-secondary { color: var(--text-body); box-shadow: inset 0 0 0 1.2px var(--border-strong); background: var(--surface-card); }
.doc.is-confirming .doc-meta { display: none; }
.doc-empty { padding: 20px 16px 8px; text-align: center; color: var(--text-muted); }
.doc-empty p { margin: 4px 0 0; }
.doc-empty .fineprint { margin-top: 4px; }
.doc-empty-icon { width: 64px; height: 64px; margin-bottom: 8px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface-tint); color: var(--primary-500); }

/* ── Info ───────────────────────────────────────────── */

.about-head { display: flex; align-items: center; gap: 16px; }
.about-name { margin: 0; font: 400 20px/1.3 var(--font-heading); color: var(--text-heading); }
.about-version { margin: 2px 0 0; font: 13px/1.4 var(--font-mono); color: var(--text-muted); }
.about-list { margin: 0; }
.about-list > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-default); font-size: 14px; }
.about-list dt { font-weight: 700; color: var(--text-muted); }
.about-list dd { margin: 0; overflow-wrap: anywhere; }
.about-sub { margin: 4px 0 -6px; font-size: 13px; }

/* ── Audioausgabe ───────────────────────────────────── */

.output-menu { position: relative; }
.output-label { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-scrim { position: fixed; inset: 0; z-index: 40; }
.menu {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 41;
  width: max-content; min-width: 260px; max-width: min(380px, calc(100vw - 32px)); list-style: none; margin: 0; padding: 6px;
  border-radius: var(--radius-8); background: var(--surface-card); box-shadow: var(--shadow-10), inset 0 0 0 .5px var(--neutral-200);
  animation: rise-in .15s ease;
}
.menu-item {
  width: 100%; display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border: 0; border-radius: var(--radius-4);
  background: none; color: var(--text-body); font: 400 14px/1.4 var(--font-body); text-align: left; cursor: pointer;
}
.menu-item:hover { background: var(--surface-tint); }
.menu-item[aria-checked="true"] { font-weight: 700; color: var(--text-label); }
.menu-check { width: 16px; flex-shrink: 0; padding-top: 1px; color: var(--primary-500); }
.menu-text small { display: block; font-size: 12px; font-weight: 400; color: var(--text-muted); }

/* ── Fußzeile ───────────────────────────────────────── */

.footer { display: flex; align-items: center; justify-content: center; gap: 6px; }
.info-btn {
  width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted);
  display: grid; place-items: center; cursor: pointer; transition: var(--transition-fast);
}
.info-btn:hover { color: var(--primary-600); background: var(--surface-tint); }

/* ── Blazor-Fehlerleiste ────────────────────────────── */

#blazor-error-ui {
  display: none; position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 1000;
  align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius-8);
  background: var(--error-100); color: var(--error-500); box-shadow: var(--shadow-10);
}
#blazor-error-ui .dismiss { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; display: grid; place-items: center; }

/* ── Animation, Bewegung ────────────────────────────── */

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ring-spin { from { transform: rotate(-90deg); } to { transform: rotate(270deg); } }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  .tag.status-live .status-dot, .dot-running, .spinner, .progress-ring.is-indeterminate,
  .meter.is-indeterminate > span, .backdrop, .modal, .menu { animation: none; }
}

/* ── Responsiv ──────────────────────────────────────── */

@media (max-width: 1024px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .timeline { max-height: none; }
}

@media (max-width: 640px) {
  .shell { padding: 16px; }
  .topbar { padding: 12px 16px; gap: 12px; }
  .brand-logo img { height: 40px; }
  .brand-divider, .brand-sub { display: none; }
  .brand-product h1 { font-size: 20px; }
  .topbar-meta { margin-left: 0; width: 100%; justify-content: flex-start; order: 3; }
  .topbar-actions { margin-left: auto; padding-left: 0; border-left: 0; }
  .setup-wrap { margin-top: 16px; }
  .setup { padding: 24px; }
  .setup-title { font-size: 26px; }
  .setup-actions .btn { flex: 1; }
  .modal-head, .modal-body, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .about-list > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .session-options { flex-direction: column; align-items: stretch; gap: 14px; }
  .voice-picker { flex-direction: column; align-items: stretch; gap: 6px; }
  .option-toggle { flex-wrap: wrap; }
  .select-wrap { width: 100%; }
  .controls .output-menu { order: 3; flex: 1 1 100%; }
  .controls .output-toggle { width: 100%; }
  .menu { left: 0; transform: none; width: 100%; min-width: 0; }
  .card { padding: 16px; }
  .layout, .side { gap: 16px; }
  .layout { margin-top: 16px; }
  .chat-panel { padding: 12px; max-height: 50vh; }
  .msg-user { max-width: 92%; }
  .btn-large { width: 100%; }
  .controls .btn { flex: 1; padding-inline: 16px; }
  .metric dd { font-size: 22px; }
  .session-id { display: none; }
}
