/* §COMPOSER-PILL-2026-11-02 (Owner-Spec + D5) — Chat-Eingabeleiste als Glas-Pille, Handy + Desktop (+ Capacitor-WebView).
   Pille: rgba(22,16,33,.72) + blur(20px), runder „+“ links, Feld Mitte, Mikrofon ⇄ Senden rechts (Umschalten wie bisher
   ueber .ec-has-text). Desktop: 💣 als kleiner Schalter in der Pille vor dem Mikrofon, kein AES-GCM-Etikett mehr.
   Laedt als LETZTES Stylesheet. Spezifitaet: Handy 6 Shell-IDs + footer (schlaegt die 6-ID-Regeln aus ec-ux-chat.css /
   mobile-overrides.css), Desktop 4 Shell-IDs (schlaegt Studio 3 IDs + desktop-overrides). Farbthemen/Design-Studio
   behalten ihre Flaechenfarbe ueber --ec-pill-bg / --ec-pill-line (unten). */

:root {
  --ec-pill-bg: rgba(22, 16, 33, 0.72);
  --ec-pill-line: rgba(147, 51, 234, 0.26);
  --ec-pill-glow: 0 10px 34px -18px rgba(0, 0, 0, 0.9), 0 0 26px -12px rgba(147, 51, 234, 0.55);
  --ec-pill-accent-a: #9333ea;
  --ec-pill-accent-b: #7c3aed;
}
html[data-theme]:not([data-theme="oled-midnight"]) {
  --ec-pill-bg: color-mix(in srgb, var(--bg-panel, #161021) 72%, transparent);
  --ec-pill-line: color-mix(in srgb, var(--accent-color, #9333ea) 26%, transparent);
}
html[data-ec-studio] {
  --ec-pill-bg: color-mix(in srgb, var(--ec-surface, #161021) var(--ec-glass-pct, 72%), transparent);
  --ec-pill-line: color-mix(in srgb, var(--ec-primary, #9333ea) 26%, transparent);
}

/* ── Handy (Mobile-Shell, auch Capacitor) ───────────────────────────────────── */
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell footer.ec-mobile-composer {
  display: flex !important; align-items: flex-end !important; gap: 6px !important;
  box-sizing: border-box !important; width: auto !important; min-width: 0 !important; min-height: 56px !important;
  margin: 6px 10px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
  padding: 6px !important;
  border-radius: 28px !important; border: 1px solid var(--ec-pill-line) !important;
  background: var(--ec-pill-bg) !important;
  -webkit-backdrop-filter: blur(20px) saturate(140%) !important; backdrop-filter: blur(20px) saturate(140%) !important;
  box-shadow: var(--ec-pill-glow) !important;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell footer.ec-mobile-composer textarea#ec-mobile-msg-input {
  flex: 1 1 0% !important; width: 0 !important; min-width: 0 !important; height: 44px; min-height: 44px !important; max-height: 140px !important;
  padding: 12px 6px !important; margin: 0 !important; line-height: 20px !important; font-size: 16px !important;
  background: transparent !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; outline: none !important;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell footer.ec-mobile-composer textarea#ec-mobile-msg-input:focus { border: 0 !important; }
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell footer.ec-mobile-composer .ec-mobile-composer-attach,
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell footer.ec-mobile-composer .ec-mobile-composer-voice,
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell footer.ec-mobile-composer .ec-mobile-composer-send {
  flex: 0 0 44px !important; width: 44px !important; height: 44px !important; min-width: 44px !important; min-height: 44px !important;
  padding: 0 !important; margin: 0 !important; border-radius: 50% !important;
  display: grid !important; place-items: center !important; align-self: flex-end !important;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell footer.ec-mobile-composer .ec-mobile-composer-attach {
  background: rgba(255, 255, 255, 0.07) !important; border: 1px solid rgba(255, 255, 255, 0.10) !important; color: #ededed !important;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell footer.ec-mobile-composer .ec-mobile-composer-voice {
  background: transparent !important; border: 0 !important; color: #d5d5d5 !important;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell footer.ec-mobile-composer .ec-mobile-composer-send {
  border: 0 !important; color: #fff !important;
  background: linear-gradient(135deg, var(--ec-pill-accent-a), var(--ec-pill-accent-b)) !important;
  box-shadow: 0 6px 18px -8px rgba(85, 85, 85, 0.9) !important;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell footer.ec-mobile-composer :is(.ec-mobile-composer-attach, .ec-mobile-composer-voice, .ec-mobile-composer-send) svg {
  width: 22px !important; height: 22px !important;
}

/* ── Desktop (#ec-claude-shell-final) ────────────────────────────────────────── */
html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final footer.ecf-composer {
  display: flex !important; align-items: flex-end !important; gap: 6px !important;
  box-sizing: border-box !important; min-width: 0 !important; max-width: none !important; min-height: 56px !important;
  margin: 8px 18px calc(14px + env(safe-area-inset-bottom, 0px)) !important;
  padding: 6px !important;
  border-radius: 28px !important; border: 1px solid var(--ec-pill-line) !important; border-top: 1px solid var(--ec-pill-line) !important;
  background: var(--ec-pill-bg) !important;
  -webkit-backdrop-filter: blur(20px) saturate(140%) !important; backdrop-filter: blur(20px) saturate(140%) !important;
  box-shadow: var(--ec-pill-glow) !important;
}
html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final footer.ecf-composer .ecf-tools {
  display: inline-flex !important; align-self: flex-end !important; padding: 0 !important; margin: 0 !important; gap: 0 !important;
  background: transparent !important; border: 0 !important; border-radius: 0 !important;
}
html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final footer.ecf-composer textarea#ec-final-msg-input {
  /* Basis 0 statt auto: sonst setzt die Eigenbreite des Felds (~200 px) die Mindestbreite der Pille, und sie ragt
     bei 1280/1440 unter die Chat-Tools-Spalte (Senden-Knopf verdeckt). Das alte Grid hatte dafuer minmax(0,1fr). */
  flex: 1 1 0% !important; width: 0 !important; min-width: 0 !important; height: 44px; min-height: 44px !important; max-height: 160px !important;
  padding: 11px 6px !important; margin: 0 !important; background: transparent !important; border: 0 !important; box-shadow: none !important;
}
html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final footer.ecf-composer :is(.ecf-attach-btn, .ecf-send-btn) {
  flex: 0 0 44px !important; width: 44px !important; height: 44px !important; min-width: 44px !important; padding: 0 !important; margin: 0 !important;
  border-radius: 50% !important; display: grid !important; place-items: center !important; align-self: flex-end !important; transform: none !important;
}
html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final footer.ecf-composer .ecf-tools .ecf-attach-btn {
  font-size: 22px !important; line-height: 1 !important; color: #ededed !important;
  background: rgba(255, 255, 255, 0.07) !important; border: 1px solid rgba(255, 255, 255, 0.10) !important;
}
html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final footer.ecf-composer .ecf-tools .ecf-attach-btn:hover { background: rgba(85, 85, 85, 0.22) !important; }
html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final footer.ecf-composer .ecf-burn-btn {
  flex-basis: 36px !important; width: 36px !important; min-width: 36px !important; height: 36px !important; margin-bottom: 4px !important;
  font-size: 15px !important; background: transparent !important; border: 1px solid transparent !important; opacity: .8;
}
html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final footer.ecf-composer .ecf-burn-btn:hover { opacity: 1; background: rgba(255, 255, 255, 0.07) !important; }
html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final footer.ecf-composer .ecf-burn-btn.on {
  opacity: 1; background: rgba(255, 92, 92, 0.18) !important; border-color: rgba(255, 92, 92, 0.45) !important;
  box-shadow: 0 0 0 1px rgba(255, 92, 92, 0.35), 0 0 18px rgba(255, 92, 92, 0.22) !important;
}
html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final footer.ecf-composer .ecf-voice-btn {
  background: transparent !important; border: 0 !important; color: #d5d5d5 !important;
}
html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final footer.ecf-composer .ecf-send-btn {
  border: 0 !important; color: #fff !important;
  background: linear-gradient(135deg, var(--ec-pill-accent-a), var(--ec-pill-accent-b)) !important;
  box-shadow: 0 6px 18px -8px rgba(85, 85, 85, 0.9) !important;
}
html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final footer.ecf-composer .ecf-composer-badge { display: none !important; }

/* Mikrofon ⇄ Senden: dieselbe Umschaltung wie ec-ux-chat.css, aber in DIESER Spezifitaet — sonst schluege das
   display:grid oben die Ausblend-Regel (5 IDs) und beide Knoepfe waeren sichtbar. */
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell footer.ec-mobile-composer:not(.ec-has-text) .ec-mobile-composer-send,
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell footer.ec-mobile-composer.ec-has-text .ec-mobile-composer-voice,
html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final footer.ecf-composer:not(.ec-has-text) .ecf-send-btn,
html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final footer.ecf-composer.ec-has-text .ecf-voice-btn { display: none !important; }
/* Sprachaufnahme-Leiste (voice-recorder.js) liegt in der Pille → gleiche Rundung. */
footer.ec-mobile-composer.ec-voice-recording .ec-voice-dock, footer.ecf-composer.ec-voice-recording .ec-voice-dock { border-radius: 28px !important; }

@media (prefers-reduced-transparency: reduce) {
  html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell footer.ec-mobile-composer,
  html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final footer.ecf-composer {
    background: rgb(19, 19, 19) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  }
}

/* §COMPOSER-PILL-2026-11-02 (Befund, schon live vor dieser Aenderung): .ecf-chat-panel ist ein einspaltiges Grid;
   seine 1fr-Spur = minmax(auto, 1fr) wuchs auf die Mindestbreite des Chat-Kopfs (528 px bei 1280/1440 mit offenen
   Chat-Tools, Spalte nur 343/480 px). Kopf, Verlauf und Eingabe ragten unter die Chat-Tools — der Senden-Knopf lag
   verdeckt. Spur auf minmax(0, 1fr); nur Verlauf + Eingabe duerfen schrumpfen. Der Kopf behaelt seine Mindestbreite
   (zusammengedrueckt ueberlappten Titel/Knoepfe) — sein Platzproblem bei offenen Chat-Tools ist ein eigener Punkt. */
html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final .ecf-chat-panel { grid-template-columns: minmax(0, 1fr) !important; }
html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final .ecf-chat-panel > :is(#ec-final-chat-stream, .ecf-chat-stream, footer.ecf-composer) { min-width: 0 !important; }
html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final .ecf-chat-panel > .ecf-chat-head { min-width: min-content !important; }

/* §D30-2026-11-02 (OFFEN D30): with Chat-Tools open the chat column is only 343 px (1280) / 480 px (1440), but the
   header kept its 528 px min-content — chip, call buttons and even the ⋮ toggle lay under the Chat-Tools column.
   Fix: the header is clamped to its column (min-width 0, inline-size container) and degrades by priority:
   title/subtitle ellipsis first; < 520 px the security chip hides (same state is in the subtitle + Chat-Tools
   „Sicherheit“); < 420 px „Verwalten“ collapses to a 34 px icon button (text stays as accessible name).
   Call buttons and ⋮ never shrink. Guard: tests/test-chat-layout-e2e.js checkHead (1920/1440/1280/1180). */
@media (min-width: 900px) {
  html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final .ecf-chat-panel > .ecf-chat-head {
    min-width: 0 !important; max-width: 100% !important; box-sizing: border-box !important;
    container: ecf-head / inline-size; display: flex !important; flex-wrap: nowrap !important; align-items: center !important;
  }
  html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final .ecf-chat-head > .ecf-chat-person {
    flex: 1 1 auto !important; min-width: 0 !important; overflow: hidden !important;
  }
  html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final .ecf-chat-head > .ecf-chat-person > div { min-width: 0 !important; overflow: hidden !important; }
  html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final .ecf-chat-head > .ecf-chat-person :is(strong, small) {
    display: block !important; max-width: 100% !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important;
  }
  html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final .ecf-chat-head > .ecf-chat-actions {
    flex: 0 0 auto !important; flex-wrap: nowrap !important; min-width: 0 !important;
  }
  html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final .ecf-chat-actions > :is(button, .ecf-chip) { flex-shrink: 0 !important; }
  @container ecf-head (max-width: 520px) {
    html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final .ecf-chat-actions > .ecf-chip { display: none !important; }
  }
  @container ecf-head (max-width: 420px) {
    html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final .ecf-chat-actions > button[data-ec-final-room-action="manage"] {
      width: 34px !important; min-width: 34px !important; padding: 0 !important; font-size: 0 !important; letter-spacing: 0 !important;
    }
    html body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final .ecf-chat-actions > button[data-ec-final-room-action="manage"]::before {
      content: "⚙"; font-size: 16px; line-height: 1;
    }
  }
}
