/* ==========================================================================
   Koda Core – Ultra-Cleaner Vollbild-Chat im ChatGPT-Aufbau
   Compile Academy Design-System:
   Soft-Obsidian (#0F1214 / #151A1E / #1C2228 / #283138)
   Compile-Academy-RGB: Smaragd #26D07C · Warm-Gold #F5B82E · Sunset-Amber #FF8A3D · Coral #FF5722
   ========================================================================== */

:root {
  --bg: #0c0d0e;
  --surface: #151618;
  --surface-2: #1b1c1f;
  --surface-3: #242628;
  --border: #303236;
  --border-soft: rgba(255, 255, 255, 0.06);
  --text: #eef3f5;
  --muted: #8f9da8;
  --emerald: #26d07c;
  --emerald-lip: #159a57;
  --emerald-ink: #062415;
  --gold: #f5b82e;
  --amber: #ff8a3d;
  --coral: #ff5722;
  --sb-width: 260px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.kca-app {
  display: flex;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  background: var(--bg);
}

/* ---------- Sidebar (Cleaner ChatGPT-Stil) ---------- */
.kca-sidebar {
  width: var(--sb-width);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 10px 10px 12px;
  gap: 8px;
  transition: margin-left 0.2s cubic-bezier(0.22, 1, 0.36, 1), transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 30;
}

.kca-app[data-sidebar='closed'] .kca-sidebar {
  margin-left: calc(var(--sb-width) * -1);
}

.kca-sb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px;
}

.kca-new-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.14s ease;
}

.kca-new-row:hover {
  background: var(--surface-2);
}

.kca-new-dot {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(38, 208, 124, 0.14);
  color: var(--emerald);
  display: grid;
  place-items: center;
}

.kca-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 10px;
  color: var(--muted);
}

.kca-search-wrap:focus-within {
  border-color: var(--emerald);
}

.kca-search-wrap input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  padding: 7px 0;
}

.kca-search-wrap input::placeholder {
  color: #6d7c87;
}

.kca-chat-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.kca-group-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #6c7b86;
  padding: 12px 10px 4px;
}

.kca-chat-item {
  display: flex;
  align-items: center;
  border-radius: 10px;
  padding-right: 4px;
  transition: background 0.12s ease;
}

.kca-chat-item:hover {
  background: var(--surface-2);
}

.kca-chat-item.is-active {
  background: var(--surface-3);
}

.kca-chat-open {
  flex: 1;
  min-width: 0;
  appearance: none;
  background: transparent;
  border: 0;
  color: #d7e1e7;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  text-align: left;
  padding: 8px 6px 8px 10px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kca-chat-item.is-active .kca-chat-open {
  color: var(--text);
  font-weight: 600;
}

.kca-chat-acts {
  display: flex;
  align-items: center;
  gap: 1px;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.kca-chat-item:hover .kca-chat-acts,
.kca-chat-item.is-active .kca-chat-acts {
  opacity: 1;
}

.kca-mini-act {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 0.75rem;
}

.kca-mini-act:hover {
  background: var(--surface);
  color: var(--text);
}

.kca-mini-act.is-pinned {
  color: var(--gold);
}

.kca-mini-act.is-del:hover {
  color: var(--coral);
}

.kca-empty-list {
  font-size: 0.8rem;
  color: #6b7a85;
  padding: 18px 10px;
  text-align: center;
}

.kca-sb-foot {
  border-top: 1px solid var(--border-soft);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kca-brand-card {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 8px 9px;
  border-radius: 10px;
  transition: background 0.14s ease;
}

.kca-brand-card:hover {
  background: var(--surface-2);
}

.kca-brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
}

.kca-brand-meta strong {
  display: block;
  font-size: 0.84rem;
  color: var(--text);
}

.kca-brand-meta small {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
}

.kca-sb-links {
  display: flex;
  justify-content: space-between;
  padding: 0 4px;
}

.kca-sb-links a {
  font-size: 0.74rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

.kca-sb-links a:hover {
  color: var(--emerald);
}

/* ---------- Main Area ---------- */
.kca-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: var(--bg);
}

/* Minimal Topbar (wie ChatGPT: ohne harte Rahmenlinie) */
.kca-topbar {
  height: 54px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: var(--bg);
}

.kca-top-left,
.kca-top-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kca-icon-btn {
  appearance: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.kca-icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.kca-app[data-sidebar='open'] #kca-open-sb {
  display: none;
}

.kca-top-brand {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text);
  padding: 0 6px;
  letter-spacing: -0.015em;
}

/* Modell-Dropdown im Composer (ultra-clean wie Bild 2: +  Koda Core Mittel ⌄) */
.kca-model-menu {
  position: relative;
}

.kca-plus-btn {
  appearance: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #9ba8b4;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.11s ease, color 0.11s ease, border-color 0.11s ease, transform 0.1s ease;
}

.kca-plus-btn:hover {
  background: var(--surface);
  border-color: var(--border);
  color: var(--emerald);
}

.kca-plus-btn:active {
  transform: scale(0.93);
}

.kca-inline-model {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  font: inherit;
  font-size: 0.86rem;
  line-height: 1.25;
  padding: 6px 10px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #a4b2bc;
  min-height: 32px;
  transition: background 0.11s ease, border-color 0.11s ease, color 0.11s ease;
}

.kca-inline-model:hover,
.kca-inline-model[aria-expanded='true'] {
  background: #232a31;
  border-color: var(--border);
  color: var(--text);
}

.kca-inline-model:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 2px;
}

.kca-inline-chevron {
  flex-shrink: 0;
  transition: transform 0.12s ease;
}

.kca-inline-model[aria-expanded='true'] .kca-inline-chevron {
  transform: rotate(180deg);
}

.kca-inline-name {
  color: #f0f5f7;
  font-weight: 600;
  white-space: nowrap;
}

.kca-inline-level {
  color: #b4c2cc;
  font-weight: 500;
  white-space: nowrap;
  display: inline-block;
  min-width: 3.7rem;
  text-align: left;
}

/* Kompaktes 4-Stufen-Menü direkt über der Eingabeleiste (ohne Sprung, im Koda-Grau/Grün) */
.kca-model-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  top: auto;
  width: 172px;
  max-width: calc(100vw - 28px);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.36);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transform-origin: bottom left;
  animation: kca-pop-in 120ms cubic-bezier(0.2, 0.9, 0.3, 1);
}

.kca-model-popover[hidden] {
  display: none;
}

.kca-intel-opt {
  appearance: none;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  color: #ced9e0;
  min-height: 36px;
  transition: background 0.1s ease, color 0.1s ease;
}

.kca-intel-opt:hover {
  background: #242c33;
  color: #f2f6f8;
}

.kca-intel-opt:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: -2px;
  background: #242c33;
  color: #f2f6f8;
}

.kca-intel-opt.is-selected {
  background: #262f37;
  color: #f4f8fa;
  font-weight: 600;
}

.kca-opt-label {
  white-space: nowrap;
}

.kca-opt-check {
  width: 15px;
  height: 15px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--emerald);
}

.kca-intel-opt.is-selected .kca-opt-check::after {
  content: '';
  width: 12px;
  height: 12px;
  display: block;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round' d='M3 8.5 6.5 12 13 4.5'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round' d='M3 8.5 6.5 12 13 4.5'/%3E%3C/svg%3E") center/contain no-repeat;
}

@keyframes kca-pop-in {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.kca-lang-switch {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  padding: 2px;
}

.kca-lang-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.73rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 7px;
  cursor: pointer;
}

.kca-lang-btn.is-active {
  background: var(--surface-2);
  color: var(--emerald);
}

/* ---------- Scroll & Empty State ---------- */
.kca-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 16px 18px 28px;
  overscroll-behavior: contain;
}

.kca-empty {
  margin: auto;
  width: 100%;
  max-width: 680px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 12px 0 32px;
}

.kca-empty[hidden] {
  display: none;
}

/* ChatGPT × Gemini Hybrid-Emblem */
.kca-hybrid-emblem {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
}

.kca-emblem-ring {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  padding: 2px;
  background: conic-gradient(from 0deg, var(--emerald), var(--gold), var(--amber), var(--coral), var(--emerald));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: kca-spin 7s linear infinite;
}

.kca-gemini-star {
  animation: kca-star-breathe 3.6s ease-in-out infinite;
}

.kca-empty h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
}

.kca-starters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin-top: 4px;
}

.kca-starter {
  appearance: none;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 13px 15px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.kca-starter:hover {
  background: var(--surface-2);
  border-color: #36434d;
}

.kca-starter strong {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
}

.kca-starter span {
  color: var(--muted);
  font-size: 0.79rem;
}

/* ---------- Thread (Cleanes ChatGPT-Layout) ---------- */
.kca-thread {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.kca-msg {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.kca-msg-user {
  justify-content: flex-end;
}

.kca-user-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  max-width: 76%;
}

.kca-user-photos {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.kca-user-photos img {
  width: 136px;
  height: 104px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.kca-msg-user .kca-bubble {
  background: var(--surface-2);
  border-radius: 20px;
  padding: 11px 16px;
  color: var(--text);
  font-size: 0.96rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.kca-msg-assistant {
  width: 100%;
}

.kca-ai-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.kca-ai-content {
  flex: 1;
  min-width: 0;
}

.kca-ai-body {
  font-size: 0.96rem;
  line-height: 1.68;
  color: #e6eef2;
  word-break: break-word;
}

.kca-ai-body p {
  margin: 0 0 11px;
}

.kca-ai-body p:last-child {
  margin-bottom: 0;
}

.kca-ai-body ul,
.kca-ai-body ol {
  margin: 6px 0 12px;
  padding-left: 22px;
}

.kca-ai-body li {
  margin-bottom: 5px;
}

.kca-ai-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--gold);
}

/* Code-Block (Clean & ohne Layout-Sprünge) */
.kca-code-wrap {
  margin: 12px 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  contain: content;
}

.kca-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 13px;
  background: var(--surface-2);
  font-size: 0.74rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.kca-copy-code {
  appearance: none;
  border: 0;
  background: transparent;
  color: #cbd7df;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.kca-copy-code:hover {
  background: var(--surface-3);
  color: var(--emerald);
}

.kca-code-wrap pre {
  margin: 0;
  padding: 13px 15px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.54;
  color: #daf8e8;
}

.kca-code-wrap pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

/* ---------- ChatGPT × Gemini Denk-Symbol & Animation ---------- */
.kca-thinking-row {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 6px 2px;
}

.kca-think-glyph {
  position: relative;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

/* ChatGPT-Pulsring */
.kca-think-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 2px;
  background: conic-gradient(from 0deg, var(--emerald), var(--gold), var(--amber), var(--coral), var(--emerald));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: kca-spin 1.15s linear infinite;
}

/* Gemini-4-Punkt-Stern im Zentrum */
.kca-think-star {
  width: 14px;
  height: 14px;
  animation: kca-star-pulse 1.35s ease-in-out infinite;
}

.kca-think-text {
  font-size: 0.92rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--emerald), var(--gold), var(--amber), var(--coral), var(--emerald));
  background-size: 240% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: kca-flow 2.1s linear infinite;
}

.kca-think-meta {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
}

/* Hover-Aktionen unter KI-Antworten (wie ChatGPT) */
.kca-msg-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  opacity: 0.72;
  transition: opacity 0.14s ease;
}

.kca-msg-assistant:hover .kca-msg-actions {
  opacity: 1;
}

.kca-act-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 7px;
  cursor: pointer;
}

.kca-act-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* ---------- Schwebender ChatGPT-Composer unten ---------- */
.kca-composer-wrap {
  flex-shrink: 0;
  padding: 6px 16px 14px;
  background: linear-gradient(to top, var(--bg) 82%, rgba(15, 18, 20, 0));
}

.kca-composer {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

.kca-input-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.kca-input-box:focus-within {
  border-color: rgba(38, 208, 124, 0.65);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(38, 208, 124, 0.25),
    0 0 22px rgba(245, 184, 46, 0.12);
}

.kca-input-box.is-dragover {
  border-color: var(--emerald);
  background: var(--surface-3);
}

/* Foto-Vorschau im Composer */
.kca-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 4px;
}

.kca-attachments[hidden] {
  display: none;
}

.kca-thumb {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px 28px 5px 5px;
}

.kca-thumb img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 8px;
}

.kca-thumb-info {
  display: flex;
  flex-direction: column;
  max-width: 140px;
}

.kca-thumb-info strong {
  font-size: 0.76rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kca-thumb-info small {
  font-size: 0.69rem;
  color: var(--muted);
}

.kca-thumb-rm {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 0;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.72rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.kca-thumb-rm:hover {
  background: var(--coral);
  color: #fff;
}

.kca-input-box textarea {
  width: 100%;
  background: transparent;
  border: 0;
  outline: none;
  resize: none;
  color: var(--text);
  font: inherit;
  font-size: 0.97rem;
  line-height: 1.5;
  padding: 2px 4px;
  max-height: 180px;
}

.kca-input-box textarea::placeholder {
  color: #7c8b96;
}

/* Untere Aktionsleiste im Composer */
.kca-composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kca-bar-left,
.kca-bar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.kca-attach-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: #dbe5ea;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.kca-attach-btn:hover {
  background: var(--surface-3);
  border-color: var(--emerald);
  color: var(--text);
}

/* Intelligenz-Stufen-Pills im Composer */
.kca-intel-pills {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.kca-intel-pill {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.kca-intel-pill:hover {
  color: var(--text);
}

.kca-intel-pill.is-active[data-intel='low'] {
  background: rgba(38, 208, 124, 0.16);
  color: var(--emerald);
}

.kca-intel-pill.is-active[data-intel='medium'] {
  background: rgba(245, 184, 46, 0.16);
  color: var(--gold);
}

.kca-intel-pill.is-active[data-intel='high'] {
  background: rgba(255, 138, 61, 0.18);
  color: var(--amber);
}

.kca-intel-pill.is-active[data-intel='xhigh'] {
  background: rgba(255, 87, 34, 0.2);
  color: #ff9d7e;
}

.kca-send-btn,
.kca-stop-btn {
  appearance: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.1s ease, opacity 0.14s ease;
}

.kca-send-btn {
  background: var(--emerald);
  color: var(--emerald-ink);
  border-bottom: 3px solid var(--emerald-lip);
}

.kca-send-btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.kca-send-btn:not(:disabled):active,
.kca-stop-btn:active {
  transform: scale(0.95);
}

.kca-stop-btn {
  background: var(--coral);
  color: #fff;
}

.kca-stop-btn[hidden] {
  display: none;
}

.kca-disclaimer {
  margin: 8px 0 0;
  text-align: center;
  font-size: 0.72rem;
  color: #6d7c87;
}

/* ---------- Mobile ---------- */
.kca-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 13, 15, 0.62);
  z-index: 25;
}

.kca-backdrop[hidden] {
  display: none;
}

/* Auf der dedizierten Vollbild-Koda-Core-Seite kein schwebendes Mini-Support-Widget über dem Composer */
body.kca-body .nx-koda {
  display: none !important;
}

@media (max-width: 820px) {
  .kca-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    margin-left: 0 !important;
    transform: translateX(0);
    box-shadow: 16px 0 40px rgba(0, 0, 0, 0.45);
  }
  .kca-app[data-sidebar='closed'] .kca-sidebar {
    transform: translateX(-100%);
  }
  .kca-starters {
    grid-template-columns: 1fr;
  }
  .kca-user-stack {
    max-width: 90%;
  }
  .kca-intel-pills {
    display: none;
  }
}

/* ---------- Keyframes (GPU-beschleunigt, ruckelfrei) ---------- */
@keyframes kca-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes kca-star-breathe {
  0%,
  100% {
    transform: scale(0.94) rotate(0deg);
  }
  50% {
    transform: scale(1.06) rotate(12deg);
  }
}

@keyframes kca-star-pulse {
  0%,
  100% {
    transform: scale(0.84) rotate(0deg);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.14) rotate(45deg);
    opacity: 1;
  }
}

@keyframes kca-flow {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 240% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kca-emblem-ring,
  .kca-gemini-star,
  .kca-think-ring,
  .kca-think-star,
  .kca-think-text {
    animation: none !important;
  }
}

/* ==========================================================================
   v4: Echtes <thought>-Akkordeon (0fr->1fr), Antigravity-Tool-Karten mit Sprach-Logos,
       Compile-Academy Syntax-Highlighting & Split-Canvas (Vorschau/Dateien/Terminal)
   ========================================================================== */

/* ---------- Echtes Denk-Akkordeon (Gemini × ChatGPT) ---------- */
/* Backend activity reuses the chat's green/gray palette. */
.kca-activity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  padding: 2px 0;
  margin-bottom: 6px;
  color: #b7c5cf;
  font-size: 0.82rem;
}
.kca-activity[hidden],
.kca-steps:empty {
  display: none;
}
.kca-activity-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
}
.kca-activity[data-phase='planning'] .kca-activity-dot {
  animation: kca-activity-pulse 1.55s ease-in-out infinite;
}
.kca-activity[data-phase='creating_file'] .kca-activity-dot {
  background: var(--gold);
  animation: kca-activity-pulse 1.15s ease-in-out infinite;
}
.kca-activity[data-phase='verifying'] .kca-activity-dot,
.kca-activity[data-phase='tool'] .kca-activity-dot {
  background: var(--amber);
  animation: kca-activity-pulse 1.05s ease-in-out infinite;
}
.kca-activity[data-phase='writing'] .kca-activity-dot {
  background: var(--emerald);
  animation: kca-activity-pulse 1.35s ease-in-out infinite;
}
.kca-activity-time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.kca-stream-notice {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.81rem;
}
.kca-live-tail:empty {
  display: none;
}
@keyframes kca-activity-pulse {
  0%, 100% { opacity: 0.42; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.08); }
}
@keyframes kca-status-pop {
  0% { transform: scale(0.75); opacity: 0.5; }
  65% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .kca-model-popover,
  .kca-step-card,
  .kca-step-status.is-ok,
  .kca-step-status.is-err,
  .kca-step-spinner,
  .kca-activity .kca-activity-dot {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Antigravity Tool-Schritt-Karten (mit Compile-Academy-Kurslogos) ---------- */
.kca-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.kca-step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  animation: kca-step-in 0.14s ease-out;
}

.kca-step-card.is-error {
  border-color: rgba(255, 87, 34, 0.48);
  background: color-mix(in srgb, var(--coral) 5%, var(--surface));
}

.kca-step-head {
  width: 100%;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: var(--text);
  transition: background 0.11s ease;
}

.kca-step-head:hover {
  background: var(--surface-2);
}

.kca-lang-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}

.kca-course-badge {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: inline-grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 1.5px 0 rgba(0, 0, 0, 0.32);
}

.kca-step-verb {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.kca-step-target {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: #e4ecef;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.kca-step-err-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: #ffb199;
  background: rgba(255, 87, 34, 0.16);
  border: 1px solid rgba(255, 87, 34, 0.34);
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.kca-step-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px 10px;
  border-top: 1px solid var(--border-soft);
  background: rgba(15, 18, 20, 0.35);
}

.kca-file-dl-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 9px;
  border: 1px solid rgba(38, 208, 124, 0.38);
  border-bottom: 3px solid var(--emerald-lip);
  background: var(--emerald);
  color: var(--emerald-ink);
  font: inherit;
  font-size: 0.79rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.12s ease;
}

.kca-file-dl-btn:hover {
  filter: brightness(1.06);
}

.kca-file-dl-btn:active {
  transform: translateY(1px);
}

.kca-file-prev-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: #dce6ec;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.11s ease, border-color 0.11s ease, color 0.11s ease;
}

.kca-file-prev-btn:hover {
  background: var(--surface-3);
  border-color: var(--emerald);
  color: var(--text);
}

.kca-file-meta {
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.73rem;
  color: var(--muted);
}

.kca-diff-pills {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
}

.kca-diff-add {
  color: var(--emerald);
  background: rgba(38, 208, 124, 0.12);
  padding: 1px 6px;
  border-radius: 6px;
}

.kca-diff-del {
  color: var(--coral);
  background: rgba(255, 87, 34, 0.14);
  padding: 1px 6px;
  border-radius: 6px;
}

.kca-step-status {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.84rem;
  font-weight: 800;
}

.kca-step-status.is-ok {
  color: var(--emerald);
  animation: kca-status-pop 0.18s ease-out;
}

.kca-step-status.is-err {
  color: var(--coral);
  animation: kca-status-pop 0.18s ease-out;
}

.kca-step-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--emerald);
  border-right-color: var(--gold);
  animation: kca-spin 0.75s linear infinite;
}

.kca-step-drawer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.kca-step-card.is-open .kca-step-drawer {
  grid-template-rows: 1fr;
}

.kca-step-drawer-inner {
  overflow: hidden;
}

.kca-step-output {
  margin: 0;
  padding: 10px 13px;
  border-top: 1px solid var(--border-soft);
  background: var(--bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #c8d6df;
  white-space: pre-wrap;
  max-height: 220px;
  overflow: auto;
}

/* ---------- Code-Boxen im Compile-Academy-Design + Syntax-Highlighting ---------- */
.kca-code-lang {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  color: #cfdbe3;
}

.kca-code-acts {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.kca-code-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: #b7c5cf;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.73rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease, border-color 0.1s ease;
}

.kca-code-btn:hover {
  background: var(--surface-3);
  border-color: var(--border);
  color: var(--text);
}

.kca-code-btn.is-preview {
  color: var(--emerald);
}

.kca-code-lines {
  display: block;
  min-width: max-content;
  word-break: normal;
  overflow-wrap: normal;
}

.kca-code-line {
  display: flex;
  align-items: baseline;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
}

.kca-code-ln {
  flex: 0 0 3.2ch;
  min-width: 3.2ch;
  user-select: none;
  text-align: right;
  padding-right: 14px;
  color: #5b6a75;
  white-space: nowrap;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.kca-code-src {
  flex: 1 0 auto;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
}

/* Compile-Academy Syntax-Farben (Smaragd, Gold, Sunset-Amber, Kühles Grau – kein Lila/Neon-Blau) */
.tok-kw {
  color: #ff8a3d;
  font-weight: 600;
}
.tok-str {
  color: #26d07c;
}
.tok-num {
  color: #f5b82e;
}
.tok-com {
  color: #6b7a85;
  font-style: italic;
}
.tok-tag {
  color: #ff8a3d;
}
.tok-attr {
  color: #f5b82e;
}
.tok-fn {
  color: #e9f5ee;
  font-weight: 600;
}

/* ---------- Rechte Split-Ansicht (Gemini Canvas × Antigravity Workspace) ---------- */
.kca-canvas {
  width: 44%;
  max-width: 640px;
  min-width: 340px;
  flex-shrink: 0;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100dvh;
  transition: width 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease;
}

.kca-app[data-canvas='closed'] .kca-canvas {
  display: none;
}

.kca-canvas-head {
  height: 54px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kca-canvas-tabs {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px;
  gap: 2px;
}

.kca-ctab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.11s ease, color 0.11s ease;
}

.kca-ctab.is-active {
  background: var(--surface-2);
  color: var(--emerald);
}

.kca-canvas-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.kca-cpane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.kca-cpane[hidden] {
  display: none;
}

.kca-preview-empty {
  margin: auto;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
  max-width: 34ch;
  line-height: 1.5;
}

.kca-preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.kca-ws-list {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kca-ws-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
}

.kca-ws-item:hover {
  border-color: var(--emerald);
}

.kca-ws-item small {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.72rem;
}

.kca-ws-viewer {
  margin: 0 10px 10px;
}

.kca-term-log {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
}

.kca-term-entry {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.kca-term-cmd {
  color: var(--emerald);
  font-weight: 700;
  margin-bottom: 6px;
}

.kca-term-out {
  color: #cddae3;
  white-space: pre-wrap;
  margin: 0;
}

@keyframes kca-step-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
  .kca-canvas {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(100%, 460px);
    z-index: 45;
    box-shadow: -16px 0 40px rgba(0, 0, 0, 0.5);
  }
}

/* ==========================================================================
   v7: Calm Compact Collapsible Activity Timeline, Confirmed Artifact Cards
       & Exact Timing Spec (160ms in, 1.6s pulse, 120ms swap, 220ms check)
   ========================================================================== */
.kca-activity-panel {
  margin-bottom: 10px;
  border-radius: 12px;
  background: transparent;
  animation: kca-activity-in 160ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.kca-activity-panel[hidden] {
  display: none;
}

.kca-activity-bar {
  appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  color: #b7c5cf;
  font: inherit;
  font-size: 0.83rem;
  min-height: 30px;
  padding: 4px 6px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  text-align: left;
  transition: background 120ms ease, color 120ms ease;
}

.kca-activity-bar:hover {
  background: var(--surface);
  color: var(--text);
}

.kca-activity-bar:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 1px;
}

.kca-activity-bar[data-expandable='false'] {
  cursor: default;
}

.kca-activity-bar[data-expandable='false']:hover {
  background: transparent;
}

.kca-act-indicator {
  width: 14px;
  height: 14px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}

.kca-act-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  animation: kca-calm-pulse 1.6s ease-in-out infinite;
}

.kca-act-done-icon {
  color: var(--emerald);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
}

.kca-act-err-icon {
  color: var(--coral);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
}

.kca-act-summary {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  transition: opacity 120ms ease;
}

.kca-act-elapsed {
  font-variant-numeric: tabular-nums;
  font-size: 0.77rem;
  color: var(--muted);
  min-width: 3.6ch;
  text-align: right;
  flex-shrink: 0;
}

.kca-act-chev {
  width: 14px;
  height: 14px;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 150ms ease;
}

.kca-activity-panel.is-open .kca-act-chev {
  transform: rotate(180deg);
}

.kca-act-drawer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

.kca-activity-panel.is-open .kca-act-drawer {
  grid-template-rows: 1fr;
}

.kca-act-drawer-inner {
  overflow: hidden;
  padding-left: 16px;
}

.kca-act-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px 0 6px 8px;
  border-left: 1px solid var(--border);
}

.kca-act-step {
  border-radius: 8px;
  overflow: hidden;
}

.kca-act-step-row {
  appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 5px 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 0.8rem;
  color: #cdd8e0;
  text-align: left;
  cursor: pointer;
  min-height: 28px;
  transition: background 120ms ease;
}

.kca-act-step-row:hover {
  background: var(--surface);
}

.kca-act-step-state {
  width: 14px;
  height: 14px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 800;
}

.kca-act-step-state.is-ok {
  color: var(--emerald);
}

.kca-act-step-state.is-err {
  color: var(--coral);
}

.kca-act-step-runner {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.kca-act-step-desc {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kca-act-step-dur {
  font-variant-numeric: tabular-nums;
  font-size: 0.74rem;
  color: var(--muted);
  min-width: 3.4ch;
  text-align: right;
  flex-shrink: 0;
}

.kca-act-step-exit {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.69rem;
  color: #ffb199;
  background: rgba(255, 87, 34, 0.14);
  padding: 1px 5px;
  border-radius: 5px;
  flex-shrink: 0;
}

.kca-act-step-chev {
  color: var(--muted);
  font-size: 0.78rem;
  flex-shrink: 0;
  transition: transform 140ms ease;
}

.kca-act-step.is-open .kca-act-step-chev {
  transform: rotate(90deg);
}

.kca-act-step-detail {
  display: none;
  margin: 4px 8px 6px 24px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}

.kca-act-step.is-open .kca-act-step-detail {
  display: block;
}

.kca-act-step-cmd {
  padding: 6px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  color: var(--emerald);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft);
  white-space: pre-wrap;
  word-break: break-word;
}

.kca-act-step-out {
  margin: 0;
  padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.48;
  color: #c7d5de;
  white-space: pre-wrap;
  max-height: 190px;
  overflow: auto;
}

/* ---------- Confirmed File Artifact Card (Zielbild 1.1) ---------- */
.kca-artifacts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.kca-artifacts:empty {
  display: none;
}

.kca-artifact-card {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 13px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 140ms ease, background 140ms ease;
}

.kca-artifact-card:hover {
  border-color: #36434d;
  background: #181e23;
}

.kca-artifact-card.is-error {
  border-color: rgba(255, 87, 34, 0.45);
}

.kca-artifact-logo {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  animation: kca-logo-in 160ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.kca-artifact-logo .kca-course-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.kca-artifact-logo .kca-course-badge svg {
  width: 19px;
  height: 19px;
}

.kca-artifact-card.is-writing .kca-artifact-logo {
  animation: kca-logo-pulse 1.4s ease-in-out infinite;
}

.kca-artifact-info {
  flex: 1;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kca-artifact-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kca-artifact-sub {
  font-size: 0.76rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.kca-artifact-check {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(38, 208, 124, 0.16);
  color: var(--emerald);
  font-size: 0.7rem;
  font-weight: 800;
  animation: kca-check-in 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.kca-artifact-verified {
  font-size: 0.74rem;
  color: var(--emerald);
  margin-top: 2px;
}

.kca-artifact-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.kca-art-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: #dce6ec;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.kca-art-btn:hover {
  background: var(--surface-3);
  border-color: var(--emerald);
  color: var(--text);
}

.kca-art-btn.is-primary {
  background: var(--emerald);
  color: var(--emerald-ink);
  border-color: rgba(38, 208, 124, 0.4);
  border-bottom: 3px solid var(--emerald-lip);
  font-weight: 700;
}

.kca-art-btn.is-primary:hover {
  filter: brightness(1.06);
  color: var(--emerald-ink);
}

.kca-msg-meta {
  font-size: 0.72rem;
  color: #778792;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

/* Mobile-safe horizontal code scroll */
.kca-code-wrap {
  max-width: 100%;
}

.kca-code-line {
  align-items: flex-start;
}

.kca-code-ln {
  flex-shrink: 0;
  line-height: 1.54;
}

@keyframes kca-activity-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes kca-calm-pulse {
  0%, 100% {
    opacity: 0.45;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes kca-logo-in {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes kca-logo-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

@keyframes kca-check-in {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .kca-activity-panel,
  .kca-act-dot,
  .kca-artifact-logo,
  .kca-artifact-card.is-writing .kca-artifact-logo,
  .kca-artifact-check,
  .kca-act-drawer,
  .kca-act-chev {
    animation: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   V5: Antigravity-Prinzip + Echte Compile-Academy 16px Kursicons + Koda Grau-Grün
   ========================================================================== */
.kc-agent-activity {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 10px;
}

.kc-agent-activity:empty {
  display: none;
}

.kc-activity-item {
  display: flex;
  flex-direction: column;
}

.kc-activity-row {
  appearance: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  min-height: 34px;
  padding: 7px 8px;
  box-sizing: border-box;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8f9da8;
  font: inherit;
  font-size: 13px;
  line-height: 20px;
  text-align: left;
  max-width: 100%;
  transition: background-color 90ms ease-out, color 90ms ease-out;
}

.kc-activity-row[data-entering='true'] {
  animation: kc-v5-row-in 120ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.kc-activity-row[data-interactive='true'] {
  cursor: pointer;
}

.kc-activity-row[data-interactive='true']:hover {
  background: var(--surface);
  color: #d6e1e8;
}

.kc-activity-row:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: -2px;
}

.kc-icon-slot {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: inline-grid;
  place-items: center;
}

.kca-course-badge-sm {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: inline-grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.kca-course-badge-sm svg {
  width: 11px;
  height: 11px;
}

.kc-glyph-sm {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
}

.kc-row-verb {
  color: #8f9da8;
  font-weight: 400;
  white-space: nowrap;
}

.kc-row-target {
  color: #d7e2e9;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.kc-row-lines {
  color: #7d8d98;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.kc-row-exit {
  color: #f48b91;
  font-size: 12px;
  white-space: nowrap;
}

.kc-diff-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 2px;
  white-space: nowrap;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  animation: kc-v5-fade 120ms ease-out both;
}

.kc-diff-plus {
  color: #26d07c;
  font-weight: 500;
}

.kc-diff-minus {
  color: #f87171;
  font-weight: 500;
}

.kc-row-spin {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(38, 208, 124, 0.25);
  border-top-color: var(--emerald);
  animation: kca-spin 1.2s linear infinite;
  flex-shrink: 0;
}

.kc-row-chevron {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  color: #7d8d98;
  transition: transform 140ms ease-out;
}

.kc-activity-item.is-open > .kc-activity-row .kc-row-chevron,
.kc-summary-wrap.is-open > .kc-summary-row .kc-row-chevron {
  transform: rotate(90deg);
}

/* R2: Kompaktes Terminal-Detail direkt unter Ran-Zeile */
.kc-detail-drawer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.kc-activity-item.is-open > .kc-detail-drawer,
.kc-summary-wrap.is-open > .kc-detail-drawer {
  grid-template-rows: 1fr;
}

.kc-detail-inner {
  overflow: hidden;
}

.kc-command-detail {
  margin: 2px 0 6px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.kc-command-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 18px;
  color: #cdd9e1;
  overflow-x: auto;
}

.kc-command-prompt {
  color: var(--emerald);
  user-select: none;
  margin-right: 6px;
}

.kc-command-output {
  margin: 0;
  padding: 9px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 18px;
  color: #b8c6d0;
  max-height: 240px;
  overflow: auto;
  white-space: pre;
}

.kc-command-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-top: 1px solid var(--border-soft);
  background: rgba(15, 18, 20, 0.35);
}

/* R4: Kompakte Aufgabenliste (ohne dicken Titel/Prozentbalken) */
.kc-task-list {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 6px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kc-task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  font-size: 13.5px;
  line-height: 20px;
  color: #dbe5ec;
}

.kc-task-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
}

.kc-task-row[data-state='completed'] .kc-task-icon {
  color: #69d5a0;
}

.kc-task-row[data-state='failed'] .kc-task-icon {
  color: #f48b91;
}

/* R5: Kompakte Netto-Diff-Abschlusszeile (`8 files changed +720 -290 ›`) */
.kc-summary-wrap {
  margin: 4px 0 10px;
}

.kc-summary-row {
  appearance: none;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 32px;
  padding: 5px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #cdd8e0;
  font: inherit;
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 90ms ease-out;
  animation: kc-v5-row-in 120ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.kc-summary-row:hover {
  background: var(--surface);
  color: var(--text);
}

.kc-summary-row:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: -2px;
}

.kc-summary-files {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0 4px 10px;
  margin-left: 8px;
  border-left: 1px solid var(--border);
}

.kc-summary-file-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 30px;
  padding: 4px 6px;
  border-radius: 7px;
  font-size: 12.5px;
  color: #cdd8e0;
}

.kc-summary-file-row:hover {
  background: var(--surface);
}

.kc-summary-file-acts {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.kc-inline-act {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: #cdd8e0;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 90ms ease, color 90ms ease, background 90ms ease;
}

.kc-inline-act:hover {
  border-color: var(--emerald);
  color: var(--text);
}

.kc-inline-act.is-dl {
  color: var(--emerald);
}

@keyframes kc-v5-row-in {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes kc-v5-fade {
  from {
    opacity: 0.3;
  }
  to {
    opacity: 1;
  }
}

@media (pointer: coarse) {
  .kc-activity-row,
  .kc-summary-row {
    min-height: 44px;
  }
  .kc-icon-slot,
  .kca-course-badge-sm {
    width: 18px;
    height: 18px;
  }
  .kc-icon-slot {
    flex-basis: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kc-agent-activity *,
  .kc-summary-wrap *,
  .kc-task-list * {
    animation: none !important;
    transition: none !important;
  }
}


/* ==========================================================================
   v2.0: Antigravity-Style Motion System + Compile Academy Brand-Symbol
   Soft-Obsidian (#0F1214 / #151A1E / #1C2228 / #283138)
   Smaragd-Jade (#26D07C / #159A57) · Warm-Gold (#F5B82E / #B88214) · Sunset-Amber (#FF8A3D)
   STRIKT KEIN LILA / KEIN NEON-BLAU / KEIN KONFETTI
   ========================================================================== */

.ca-top-brand-sym {
  display: inline-grid;
  place-items: center;
  color: var(--text);
  margin-right: 6px;
}

.kca-top-brand {
  display: inline-flex;
  align-items: center;
}

/* 1. Antigravity Shimmer-Text ("Denkt nach…", "Analysiert…", "Editing…", "Recherchiert…") */
@keyframes ca-shimmer {
  0% {
    background-position: 200% center;
  }
  100% {
    background-position: -200% center;
  }
}

.ca-shimmer-text {
  background: linear-gradient(
    90deg,
    rgba(143, 157, 168, 0.58) 0%,
    rgba(143, 157, 168, 0.58) 34%,
    rgba(238, 243, 245, 0.98) 50%,
    rgba(143, 157, 168, 0.58) 66%,
    rgba(143, 157, 168, 0.58) 100%
  );
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: ca-shimmer 2.1s linear infinite;
}

/* 2. Compile Academy Symbol Status-Animationen (idle | active | writing | success | error) */
.ca-brand-symbol {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  color: #cbd7df;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), color 140ms ease;
}

@keyframes ca-symbol-breathe {
  0%, 100% {
    transform: scale(0.95);
    filter: drop-shadow(0 0 0 rgba(38, 208, 124, 0));
    opacity: 0.78;
  }
  50% {
    transform: scale(1.07);
    filter: drop-shadow(0 0 8px rgba(38, 208, 124, 0.55));
    opacity: 1;
  }
}

@keyframes ca-symbol-write-sweep {
  0% {
    filter: drop-shadow(0 0 2px rgba(38, 208, 124, 0.25)) brightness(0.95);
  }
  50% {
    filter: drop-shadow(0 0 7px rgba(245, 184, 46, 0.55)) brightness(1.18);
  }
  100% {
    filter: drop-shadow(0 0 2px rgba(38, 208, 124, 0.25)) brightness(0.95);
  }
}

@keyframes ca-symbol-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@keyframes ca-symbol-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.ca-brand-symbol[data-state='active'] {
  color: var(--emerald);
  animation: ca-symbol-breathe 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.ca-brand-symbol[data-state='writing'] {
  color: var(--emerald);
  animation: ca-symbol-write-sweep 1.4s ease-in-out infinite;
}

.ca-brand-symbol[data-state='success'] {
  color: var(--emerald);
  animation: ca-symbol-pop 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ca-brand-symbol[data-state='error'] {
  color: var(--coral);
  animation: ca-symbol-shake 240ms ease-in-out both;
}

/* 3. Fortschritts-Lichtbalken am unteren Rand aktiver Create/Edit-Pills (Smaragd -> Gold) */
@keyframes ca-border-beam {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.ca-pill-progress-beam {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 36%;
  background: linear-gradient(90deg, transparent, var(--emerald), var(--gold), transparent);
  animation: ca-border-beam 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  pointer-events: none;
}

/* Thinking status appears only between the backend start and end events. */
.ca-thinking-block {
  margin: 3px 0 8px;
}

.ca-thinking-head {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 4px 3px 1px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}

summary.ca-thinking-head {
  list-style: none;
  border-radius: 6px;
}

summary.ca-thinking-head::-webkit-details-marker { display: none; }
.ca-thinking-block.has-work .ca-thinking-head { cursor: pointer; }
.ca-thinking-block.has-work .ca-thinking-head:hover { color: var(--text); }
.ca-thinking-head:focus-visible { outline: 2px solid var(--emerald); outline-offset: 2px; }

.ca-thinking-chevron {
  width: 6px;
  height: 6px;
  margin: -2px 4px 0 2px;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  transform: rotate(-45deg);
  opacity: 0;
}

.ca-thinking-block.has-work .ca-thinking-chevron { opacity: 1; }
.ca-thinking-block[open] .ca-thinking-chevron { transform: rotate(45deg); }

.ca-thinking-work {
  list-style: none;
  margin: 2px 0 7px 8px;
  padding: 2px 0 2px 15px;
  border-inline-start: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

#kca-show-work { accent-color: var(--emerald); }

.ca-thinking-block.is-streaming .ca-thinking-head {
  animation: ca-thinking-enter 150ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

.ca-thinking-block.is-streaming .ca-thinking-label {
  color: var(--text);
}

.ca-thinking-status {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  color: var(--muted);
}

.ca-thinking-status::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: inherit;
  background: currentColor;
}

.ca-thinking-block.is-streaming .ca-thinking-status {
  color: var(--emerald);
}

.ca-thinking-block.is-streaming .ca-thinking-status::after {
  content: '';
  position: absolute;
  inset: 1px;
  border: 1px solid currentColor;
  border-radius: inherit;
  animation: ca-thinking-ring 1.6s ease-out infinite;
}

.ca-thinking-timer {
  min-width: 4ch;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

@keyframes ca-thinking-enter {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ca-thinking-ring {
  0% { opacity: 0.72; transform: scale(0.48); }
  76%, 100% { opacity: 0; transform: scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
  .ca-thinking-block.is-streaming .ca-thinking-head,
  .ca-thinking-block.is-streaming .ca-thinking-status::after {
    animation: none;
  }
  .ca-thinking-block.is-streaming .ca-thinking-status::after {
    opacity: 0.28;
  }
}

/* Antigravity "+" Add Context Popover (wie Bild 5: Bilder + Websuche) */
.ca-plus-menu {
  position: relative;
}

.ca-plus-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  width: 188px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42);
  z-index: 65;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transform-origin: bottom left;
  animation: kca-pop-in 120ms cubic-bezier(0.2, 0.9, 0.3, 1);
}

.ca-plus-popover[hidden] {
  display: none;
}

.ca-plus-heading {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 5px 9px 4px;
  user-select: none;
}

.ca-plus-opt {
  appearance: none;
  border: 0;
  background: transparent;
  width: 100%;
  padding: 7px 9px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 9px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #d6e0e6;
  cursor: pointer;
  text-align: left;
  transition: background-color 100ms ease, color 100ms ease;
}

.ca-plus-opt:hover {
  background: var(--surface-3);
  color: var(--text);
}

.ca-plus-opt-icon {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  flex-shrink: 0;
}

.ca-plus-opt.is-selected .ca-plus-opt-icon {
  color: var(--emerald);
}

.ca-plus-opt-label {
  flex: 1;
}

.ca-plus-opt.is-selected .kca-opt-check::after {
  content: '';
  width: 12px;
  height: 12px;
  display: block;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round' d='M3 8.5 6.5 12 13 4.5'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round' d='M3 8.5 6.5 12 13 4.5'/%3E%3C/svg%3E") center/contain no-repeat;
}

.ca-ctx-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(38, 208, 124, 0.12);
  border: 1px solid rgba(38, 208, 124, 0.34);
  color: var(--emerald);
  font-size: 12px;
  font-weight: 600;
}

.ca-ctx-chip button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0 2px;
  font-size: 11px;
  opacity: 0.8;
}

.ca-ctx-chip button:hover {
  opacity: 1;
}

/* Saubere Markdown-Überschriften in KI-Antworten */
.kca-ai-body h1,
.kca-ai-body h2,
.kca-ai-body h3,
.kca-ai-body h4 {
  margin: 14px 0 6px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.kca-ai-body h1 { font-size: 1.25rem; }
.kca-ai-body h2 { font-size: 1.1rem; }
.kca-ai-body h3 { font-size: 1rem; }
.kca-ai-body h4 { font-size: 0.94rem; color: #cfdbe3; }

/* 5. Dynamische Phasen-Indikatoren */
.ca-phase-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  margin-bottom: 6px;
  font-size: 12.5px;
  color: #9ba8b4;
}

.ca-phase-query {
  color: #798794;
  font-style: italic;
  max-width: 34ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ca-plan-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.ca-plan-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.35;
  animation: ca-plan-dot 1.2s ease-in-out infinite;
}

.ca-plan-dots span:nth-child(2) { animation-delay: 0.2s; }
.ca-plan-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ca-plan-dot {
  0%, 100% { opacity: 0.3; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* 6. Antigravity Single-Line Activity Rows (Analyzed, Created, Edited, Ran, Searched) */
.ca-file-icon:not(.kca-course-badge) {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}

.ca-pill-card {
  position: relative;
  overflow: hidden;
  max-width: 680px;
  margin: 1px 0;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.ca-pill-card.is-open {
  border-color: var(--border);
  background: var(--surface);
}

.ca-pill-card:not(.is-open) > .kc-detail-drawer {
  visibility: hidden;
}

.ca-pill-card.is-running {
  border-inline-start-color: var(--emerald);
}

.ca-pill-card.is-error {
  border-inline-start-color: var(--coral);
}

.ca-pill-head {
  appearance: none;
  border: 0;
  background: transparent;
  width: 100%;
  padding: 4px 6px;
  min-height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  color: var(--text);
  font: inherit;
  text-align: left;
  transition: background-color 100ms ease;
}

button.ca-pill-head:hover {
  background: var(--surface);
}

.ca-pill-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1;
}

.ca-pill-action {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  flex-shrink: 0;
}

.ca-pill-target {
  display: inline-flex;
  align-items: baseline;
  min-width: 0;
}

.ca-pill-path {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #d7e2e9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ca-pill-range {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #7d8d98;
  white-space: nowrap;
  flex-shrink: 0;
}

.ca-read-group-item {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 2px 4px;
}

.ca-pill-err {
  color: var(--coral);
  font-size: 11px;
}

.ca-pill-card.is-running .ca-pill-action {
  color: var(--emerald);
}

.ca-pill-card.is-error .ca-pill-action {
  color: var(--coral);
}

.ca-pill-card.is-running :is([data-course-logo], .ca-pill-action) {
  transition: color 140ms ease;
}

@keyframes ca-file-ready {
  0% { transform: scale(0.94); }
  45% { transform: scale(1.08); filter: drop-shadow(0 0 4px color-mix(in srgb, var(--emerald) 55%, transparent)); }
  100% { transform: scale(1); filter: none; }
}

.ca-pill-card[data-file-saved='true'] [data-course-logo] {
  animation: ca-file-ready 250ms ease-out both;
}

.ca-pill-card[data-runtime] .ca-pill-path {
  font-weight: 400;
  color: var(--muted);
}

.ca-terminal-detail {
  margin: 0 5px 5px;
  background: var(--bg);
}

.ca-terminal-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 8px 8px 8px 10px;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.ca-terminal-input .kc-command-prompt {
  margin: 0;
}

.ca-terminal-command {
  margin: 0;
  max-height: 240px;
  overflow: auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  tab-size: 4;
  color: var(--text);
  font: inherit;
}

.ca-terminal-command code {
  font: inherit;
}

.ca-terminal-command .tok-kw {
  color: #8fe2ad;
}

.ca-terminal-command .tok-str {
  color: #c4dc97;
}

.ca-terminal-command .tok-num {
  color: #ecbf83;
}

.ca-terminal-command .tok-com {
  color: var(--muted);
}

.ca-terminal-copy {
  display: grid;
  place-items: center;
  width: 26px;
  height: 24px;
  padding: 0;
  margin-top: -2px;
}

.ca-terminal-copy.is-copied {
  color: var(--emerald);
}

.ca-terminal-detail .kc-command-output {
  border-top: 1px solid var(--border);
}

/* Anti-Clutter Read-Gruppierung ("Analyzed 5 files ⌄") */
.ca-read-group {
  margin: 3px 0;
}

.ca-read-group-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 4px 8px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.ca-read-group-btn:hover {
  background: var(--surface);
  color: var(--text);
}

.ca-read-group-list {
  display: none;
  padding: 4px 0 4px 18px;
  margin-left: 8px;
  border-left: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #9db0bc;
}

.ca-read-group.is-open .ca-read-group-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* 7. Web-Search Pill & Domain Chips */
.ca-source-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 12px 9px;
}

.ca-domain-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: #cbd7df;
  font-size: 11.5px;
  text-decoration: none;
  transition: border-color 120ms ease, color 120ms ease;
}

.ca-domain-chip:hover {
  border-color: var(--emerald);
  color: var(--emerald);
}

.ca-source-card {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ca-source-card:last-child {
  border-bottom: 0;
}

.ca-source-card a {
  color: var(--emerald);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}

.ca-source-card a:hover {
  text-decoration: underline;
}

.ca-source-card small {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

/* 8. Adaptive Task-Group & Checkpoint-Karte (/rewind) */
.ca-task-group {
  margin: 8px 0 12px;
  border-radius: 13px;
  border: 1px solid var(--border);
  border-bottom: 4px solid #1e262c;
  background: var(--surface);
  overflow: hidden;
  max-width: 640px;
}

.ca-task-group-head {
  padding: 9px 13px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.ca-task-group-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ca-task-group-count {
  font-size: 11.5px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.ca-task-group-body {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ca-cp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 4px;
  border-radius: 7px;
  font-size: 13px;
  color: #dbe5ec;
}

.ca-cp-row-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ca-cp-rewind-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--amber);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 7px;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.ca-cp-rewind-btn:hover {
  border-color: var(--amber);
  background: rgba(255, 138, 61, 0.14);
}

.ca-task-group-files {
  padding: 8px 12px;
  border-top: 1px solid var(--border-soft);
  background: rgba(15, 18, 20, 0.35);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.ca-edited-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.ca-edited-chip:hover {
  border-color: var(--emerald);
}

/* Rewind Dialog Bar */
.ca-rewind-bar {
  max-width: 760px;
  width: calc(100% - 32px);
  margin: 0 auto 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid rgba(255, 138, 61, 0.45);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ca-rewind-bar[hidden] {
  display: none;
}

.ca-rewind-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12.5px;
}

.ca-rewind-info small {
  color: var(--muted);
  font-size: 11.5px;
}

.ca-rewind-acts {
  display: flex;
  gap: 6px;
}

/* Composer Permission Select & Web Toggle */
.ca-perm-select {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  color: #b4c2cc;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 9px;
  cursor: pointer;
  outline: none;
}

.ca-perm-select:hover,
.ca-perm-select:focus-visible {
  border-color: var(--emerald);
  color: var(--text);
}

.ca-web-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 9px;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, background-color 120ms ease;
}

.ca-web-toggle.is-active {
  border-color: rgba(38, 208, 124, 0.48);
  background: rgba(38, 208, 124, 0.12);
  color: var(--emerald);
}

/* Diff Viewer Pane */
.ca-diff-pane {
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.ca-diff-file-title {
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px 10px 0 0;
  font-weight: 700;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ca-diff-lines {
  margin: 0;
  padding: 8px 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  overflow-x: auto;
}

.ca-diff-line {
  display: block;
  padding: 0 12px;
  white-space: pre;
}

.ca-diff-line.is-add {
  background: rgba(38, 208, 124, 0.12);
  color: #7ee8b2;
}

.ca-diff-line.is-del {
  background: rgba(255, 87, 34, 0.13);
  color: #ff9d82;
}

.ca-diff-line.is-hunk {
  color: var(--gold);
  background: rgba(245, 184, 46, 0.08);
}

/* Interaktive VM-Terminal-Eingabe + Background Tasks */
.ca-bg-tasks {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ca-bg-tasks[hidden] {
  display: none;
}

.ca-term-input-row {
  margin-top: auto;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ca-term-rt {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--emerald);
  border-radius: 7px;
  padding: 5px 7px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.ca-term-input-row input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 9px;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  outline: none;
}

.ca-term-input-row input:focus {
  border-color: var(--emerald);
}

.ca-sources-list {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .ca-shimmer-text,
  .ca-brand-symbol,
  .ca-pill-progress-beam,
  .ca-plan-dots span,
  .ca-pill-card,
  .ca-pill-card[data-file-saved='true'] [data-course-logo],
  .kc-detail-drawer,
  .kc-row-chevron {
    animation: none !important;
    transition: none !important;
    -webkit-text-fill-color: currentColor;
  }
}

.ca-work-summary {
  width: fit-content;
  max-width: 100%;
  min-height: 27px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 2px 4px 2px 0;
  list-style: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

.ca-work-summary::-webkit-details-marker { display: none; }
.ca-work-summary::after {
  content: '';
  flex: 0 0 5px;
  height: 5px;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  transform: rotate(-45deg);
}

details[open] > .ca-work-summary::after { transform: rotate(45deg); }
.ca-work-summary:focus-visible { outline: 2px solid var(--emerald); outline-offset: 2px; }
.ca-work-details > .ca-work-summary { color: var(--text); }
.ca-work-details > .ca-work-actions, .ca-work-list { padding-inline-start: 11px; }
.ca-work-list > :first-child:nth-last-child(n+7):not(.is-open):not(:hover):not(:focus-within) { opacity: 1; }
.ca-work-list .ca-pill-card { border: 0; margin: 0; background: transparent; }
.ca-work-list .ca-pill-head, .ca-work-list button.ca-pill-head:hover { padding: 0; background: transparent; }
.ca-work-list .ca-pill-target { align-items: center; gap: 4px; padding: 1px 3px; border-radius: 5px; }
.ca-work-list .ca-pill-card:not([data-runtime]) .ca-pill-head:hover .ca-pill-target { background: var(--surface); }
.ca-work-list .kc-diff-count { display: inline-flex; gap: 4px; }
.ca-work-list .kc-row-chevron { margin-inline-start: 2px; }
.ca-command-exit { color: var(--muted); font-size: 11px; white-space: nowrap; }
.ca-work-list .is-error .ca-command-exit { color: var(--coral); }
.ca-work-list .kc-detail-inner { padding-inline: 0; }
.ca-artifact {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
}
.ca-artifact-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 5px 8px; border-bottom: 1px solid var(--border); }
.ca-artifact-bar [aria-pressed='true'] { color: var(--emerald); background: var(--bg); }
.ca-artifact-bar [data-v5-download] { margin-inline-start: auto; }
.ca-artifact-content pre { overflow: auto; max-height: 20rem; margin: 0; padding: 10px; }
.ca-artifact-content iframe { display: block; width: 100%; min-height: 230px; border: 0; background: white; }

.kca-input-box { border-radius: 19px; }
.kca-composer-wrap { background: linear-gradient(0deg, var(--bg) 72%, transparent); }
.ca-work-list .ca-pill-path { color: #b7b9bf; font-weight: 400; }
.ca-work-list .ca-pill-target > .kc-icon-slot .kca-course-badge { width: 15px; height: 15px; border-radius: 4px; }
.ca-work-list .ca-pill-target .kca-course-badge svg { width: 11px; height: 11px; }
.ca-work-list .ca-terminal-detail, .ca-work-list .ca-artifact { background: var(--bg); border-color: var(--border-soft); }
.ca-work-list .ca-terminal-command { overflow-wrap: anywhere; white-space: pre-wrap; max-height: 16rem; }
.ca-work-list .ca-source-card { background: var(--surface); border-radius: 6px; margin-block: 4px; }
.ca-work-details.is-empty > summary::after { display: none; }
.ca-work-details.is-empty > summary { cursor: default; }

.kca-live-tail { white-space: pre-wrap; overflow-wrap: anywhere; }
.ca-work-list .ca-pill-path, .ca-work-list .ca-pill-range { color: #a4a8ae; font: inherit; font-size: 13px; }

.kca-main, .kca-topbar { background: var(--surface); }
.kca-topbar { height: 46px; gap: 12px; }
.kca-top-left { min-width: 0; gap: 10px; }
.kca-top-right, .kca-top-brand { flex-shrink: 0; }
.kca-active-title {
  color: var(--muted);
  border-inline-start: 1px solid var(--border);
  padding-inline-start: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}
.kca-chat-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0 9px 9px 0;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--bg);
}
.kca-chat-panel .kca-scroll { min-height: 0; scrollbar-color: #3a3d40 transparent; }
.kca-thread, .kca-composer { max-width: 800px; }
.kca-chat-panel .kca-composer-wrap { border-radius: 0 0 12px 12px; padding: 8px 14px 10px; }
.kca-chat-panel .kca-input-box { border-radius: 16px; }
.kca-chat-panel .kca-disclaimer { margin-top: 6px; }
.kca-chat-list { scrollbar-width: thin; scrollbar-color: #3a3d40 transparent; }
.kca-chat-item.is-active { box-shadow: inset 0 0 0 1px var(--border-soft); }
.kca-chat-panel .kca-scroll, .kca-chat-list { scrollbar-width: none; }
.kca-chat-panel .kca-scroll::-webkit-scrollbar, .kca-chat-list::-webkit-scrollbar { display: none; }
.ca-work-details:has(> .ca-task-group) > summary::after { display: block; }
.ca-work-details:has(> .ca-task-group) > summary { cursor: pointer; }
.ca-work-details > .ca-task-group { border: 0; background: transparent; box-shadow: none; margin-inline-start: 10px; }
@media (max-width: 700px) {
  .kca-chat-panel { margin: 0 5px 5px; }
  .kca-chat-panel .kca-composer-wrap { padding-inline: 8px; }
}

/* ==========================================================================
   Koda Core Premium Redesign — Deep Black Canvas + Graphite Sidebar + Gemini RGB
   ========================================================================== */

@property --kca-rgb-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

@keyframes kca-rgb-spin {
  to { --kca-rgb-angle: 360deg; }
}

@keyframes kca-rgb-slide {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes kca-aura-breathe {
  0%, 100% { opacity: 0.42; transform: scale(0.96); }
  50% { opacity: 0.72; transform: scale(1.06); }
}

@keyframes kca-fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Deep Black Chat + Harmonious Graphite-Grey Sidebar --- */
.kca-app {
  background: #060708;
  color: #cdd5df;
}

.kca-sidebar {
  width: 256px;
  background: #15171a;
  border-right: 1px solid rgba(255, 255, 255, 0.065);
  padding: 10px 10px 12px;
  gap: 8px;
}

.kca-sb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 6px;
}

.kca-sb-top-left {
  display: flex;
  align-items: center;
  gap: 4px;
}

.kca-sb-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #d6dde6;
  text-decoration: none;
  transition: background 140ms ease, transform 140ms ease;
}

.kca-sb-logo:hover {
  background: #202329;
  transform: scale(1.04);
}

/* Premium + Neuer Chat Button mit dezenter RGB-Kante beim Hover */
.kca-new-row {
  position: relative;
  background: #1d2025;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 11px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #dce2ea;
  gap: 8px;
  overflow: hidden;
  transition: background 160ms ease, border-color 180ms ease, transform 120ms ease, box-shadow 180ms ease;
}

.kca-new-row::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(90deg, #26d07c, #1cc7d0, #4d8dff, #1cc7d0, #26d07c);
  background-size: 200% 100%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 220ms ease;
  pointer-events: none;
}

.kca-new-row:hover {
  background: #22262c;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(28, 199, 208, 0.08);
}

.kca-new-row:hover::before {
  opacity: 0.55;
  animation: kca-rgb-slide 4.5s linear infinite;
}

.kca-new-row:active {
  transform: translateY(1px) scale(0.99);
}

.kca-new-dot {
  width: auto;
  height: auto;
  background: transparent;
  color: #26d07c;
  border-radius: 0;
}

.kca-search-wrap {
  background: #101215;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 0 10px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.kca-search-wrap:focus-within {
  background: #0d0f12;
  border-color: rgba(38, 208, 124, 0.45);
  box-shadow: 0 0 0 2px rgba(38, 208, 124, 0.1);
}

.kca-search-wrap input {
  font-size: 12.5px;
  padding: 7px 0;
  color: #d6dde6;
}

.kca-search-wrap input::placeholder {
  color: #6b7480;
}

.kca-group-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #68717d;
  padding: 12px 10px 4px;
}

.kca-chat-item {
  position: relative;
  border-radius: 9px;
  padding-right: 4px;
  transition: background 140ms ease, transform 120ms ease;
}

.kca-chat-item:hover {
  background: #1d2026;
}

.kca-chat-item.is-active {
  background: #22262e;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.kca-chat-item.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2.5px;
  border-radius: 999px;
  background: linear-gradient(180deg, #26d07c, #1cc7d0, #4d8dff);
}

.kca-chat-open {
  font-size: 13px;
  font-weight: 400;
  color: #aeb7c2;
  padding: 7px 6px 7px 11px;
  transition: color 120ms ease;
}

.kca-chat-item:hover .kca-chat-open {
  color: #d7dee7;
}

.kca-chat-item.is-active .kca-chat-open {
  color: #e2e8f0;
  font-weight: 500;
}

.kca-chat-age {
  font-size: 11px;
  color: #646d79;
  padding-right: 7px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.kca-chat-item:hover .kca-chat-age {
  display: none;
}

.kca-chat-item .kca-chat-acts {
  display: none;
}

.kca-chat-item:hover .kca-chat-acts {
  display: flex;
  opacity: 1;
}

.kca-sb-foot {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px;
  gap: 5px;
}

.kca-sb-foot-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 8px;
  color: #9aa3af;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease;
}

.kca-sb-foot-row:hover {
  background: #1e2127;
  color: #dce2ea;
}

.kca-sb-links {
  padding: 0 9px;
}

.kca-sb-links a {
  font-size: 11.5px;
  color: #6c7582;
}

.kca-sb-links a:hover {
  color: #c9d2dc;
}

/* --- Main Area: Tiefschwarzer Chat-Hintergrund --- */
.kca-main {
  background: #060708;
}

.kca-topbar {
  height: 42px;
  background: #090a0c;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0 14px;
}

.kca-top-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #d4dce5;
}

.kca-chat-panel {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #060708;
}

.kca-lang-switch {
  background: #14161a;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 2px;
}

.kca-lang-btn {
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 6px;
  color: #7c8592;
}

.kca-lang-btn.is-active {
  background: #22262e;
  color: #dde3ea;
}

/* --- Empty State mit Gemini-Style RGB Aura & angenehmer Platin-Schrift --- */
.kca-empty {
  flex: 1;
  margin: 0 auto;
  width: 100%;
  max-width: 720px;
  padding: 28px 0 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  animation: kca-fade-up 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.kca-empty-center {
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.kca-hybrid-emblem {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: #111317;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  color: #cfd7e0;
  display: grid;
  place-items: center;
}

.kca-hybrid-emblem::before {
  content: '';
  position: absolute;
  inset: -14px;
  border-radius: 28px;
  background: radial-gradient(circle at 35% 35%, rgba(38, 208, 124, 0.2), rgba(28, 199, 208, 0.14) 45%, rgba(77, 141, 255, 0.14) 70%, transparent 78%);
  filter: blur(18px);
  z-index: -1;
  animation: kca-aura-breathe 6s ease-in-out infinite;
  pointer-events: none;
}

.kca-hybrid-emblem::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1.2px;
  background: conic-gradient(from var(--kca-rgb-angle), #26d07c, #1cc7d0, #4d8dff, #0e8fa6, #26d07c);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.42;
  animation: kca-rgb-spin 10s linear infinite;
  pointer-events: none;
}

.kca-center-mark {
  width: 34px;
  height: 34px;
  display: block;
}

.kca-empty h1 {
  margin: 0;
  font-size: clamp(1.38rem, 2.3vw, 1.65rem);
  font-weight: 550;
  letter-spacing: -0.025em;
  background: linear-gradient(110deg, #dde3ea 0%, #c8d2de 60%, #9fb2c5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.kca-starters {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  max-width: 680px;
  margin-top: 0;
  padding: 0 4px 6px;
}

.kca-starter {
  appearance: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 11px;
  width: fit-content;
  max-width: 100%;
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 7px 11px;
  cursor: pointer;
  text-align: left;
  transition: background 140ms ease, transform 140ms ease;
}

.kca-starter:hover {
  background: rgba(255, 255, 255, 0.045);
  transform: translateX(3px);
}

.kca-starter-icon {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}

.kca-starter-text {
  color: #9db0c4;
  font-size: 13.5px;
  font-weight: 450;
  line-height: 1.4;
  transition: color 140ms ease;
}

.kca-starter:hover .kca-starter-text {
  color: #dce4ee;
}

/* --- Premium Gemini-RGB Composer (Bild 3 — clean, ohne obere Leiste & ohne Disclaimer) --- */
.kca-chat-panel .kca-composer-wrap {
  border-radius: 0;
  padding: 8px 16px 18px;
  background: linear-gradient(0deg, #060708 82%, transparent);
}

.kca-composer {
  max-width: 720px;
}

.kca-chat-panel .kca-input-box {
  position: relative;
  background: #121418;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  padding: 4px 4px 2px;
  gap: 4px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 220ms ease, box-shadow 260ms ease, background 200ms ease;
}

.kca-chat-panel .kca-input-box::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1.2px;
  background: conic-gradient(from var(--kca-rgb-angle), #26d07c, #1cc7d0, #4d8dff, #0e8fa6, #26d07c);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.18;
  animation: kca-rgb-spin 11s linear infinite;
  transition: opacity 280ms ease;
  pointer-events: none;
}

.kca-chat-panel .kca-input-box:focus-within,
.kca-app[data-streaming='true'] .kca-chat-panel .kca-input-box {
  background: #13161b;
  border-color: transparent;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.kca-chat-panel .kca-input-box:focus-within::before,
.kca-app[data-streaming='true'] .kca-chat-panel .kca-input-box::before {
  opacity: 0.62;
  animation-duration: 6.5s;
}

.kca-chat-panel .kca-input-box textarea {
  padding: 12px 14px 6px;
  font-size: 14.5px;
  line-height: 1.55;
  color: #dce2ea;
}

.kca-chat-panel .kca-input-box textarea::placeholder {
  color: #6b7482;
}

.kca-chat-panel .kca-composer-bar {
  padding: 4px 10px 9px 10px;
}

.kca-plus-btn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: #8e98a6;
  transition: background 140ms ease, color 140ms ease, transform 120ms ease;
}

.kca-plus-btn:hover {
  background: #1e2229;
  border-color: transparent;
  color: #dce3ec;
}

.kca-inline-model {
  font-size: 12.5px;
  padding: 5px 9px;
  min-height: 30px;
  border-radius: 9px;
  color: #9aa4b2;
  transition: background 140ms ease, color 140ms ease;
}

.kca-inline-model:hover,
.kca-inline-model[aria-expanded='true'] {
  background: #1e2229;
  border-color: transparent;
  color: #dce3ec;
}

.kca-inline-name {
  color: #d4dce6;
  font-weight: 550;
}

.kca-inline-level {
  color: #8b95a3;
  min-width: auto;
}

.kca-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #26d07c 0%, #1cc7d0 55%, #4d8dff 100%);
  color: #061512;
  box-shadow: 0 2px 12px rgba(28, 199, 208, 0.26);
  border: 0;
  transition: transform 140ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 180ms ease, filter 160ms ease;
}

.kca-send-btn:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(28, 199, 208, 0.36), 0 0 12px rgba(77, 141, 255, 0.22);
}

.kca-send-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.kca-send-btn:disabled {
  background: #22262e;
  color: #636c79;
  box-shadow: none;
  opacity: 0.78;
}

/* --- Angenehme, nicht grell-weiße Platin-Typografie im Chat-Thread --- */
.kca-msg {
  animation: kca-fade-up 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.kca-msg-user .kca-bubble {
  background: #17191e;
  border: 1px solid rgba(255, 255, 255, 0.075);
  color: #d8dfe8;
  font-size: 0.94rem;
  line-height: 1.58;
}

.kca-ai-body {
  font-size: 0.945rem;
  line-height: 1.7;
  color: #c8d0da;
  letter-spacing: -0.004em;
}

.kca-ai-body strong {
  color: #e0e6ee;
  font-weight: 600;
}

.kca-ai-body h1,
.kca-ai-body h2,
.kca-ai-body h3,
.kca-ai-body h4 {
  color: #dde3ea;
}

.kca-ai-avatar {
  background: #14161a;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* --- Denk-Modus & Activity Summary ("Explored files, ran commands, edited files ⌄") --- */
.ca-work-summary {
  width: fit-content;
  max-width: 100%;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 2px 0;
  color: #8f98a6;
  font-size: 13.5px;
  font-weight: 450;
  letter-spacing: -0.005em;
  transition: color 140ms ease;
}

.ca-work-summary:hover {
  color: #d4dce6;
}

.ca-work-details > .ca-work-summary {
  color: #8e96a0;
  background: transparent;
  border: 0;
  padding: 2px 0;
  font-size: 13px;
  font-weight: 500;
  gap: 7px;
}

.ca-work-details.is-streaming > .ca-work-summary {
  color: #9aa2ac;
}

.ca-work-details.is-streaming > .ca-work-summary .ca-work-label {
  background: linear-gradient(90deg, #747c87 0%, #e2e6ec 50%, #747c87 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: kca-rgb-slide 2.1s linear infinite;
}

.ca-work-summary::after {
  content: '';
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  border: solid #8e96a0;
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(-45deg);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), border-color 140ms ease;
  margin-top: -1px;
  display: inline-block;
}

.ca-work-summary:hover::after {
  border-color: #d4d8df;
}

details[open] > .ca-work-summary::after {
  transform: rotate(45deg);
  margin-top: -3px;
}
  margin-top: -3px;
}

.ca-work-details.is-empty > .ca-work-summary {
  cursor: default;
}

.ca-work-details.is-empty > .ca-work-summary::after {
  display: none;
}

.ca-work-details > .ca-work-actions,
.ca-work-list {
  padding-inline-start: 0;
  margin-top: 3px;
}

/* --- Premium Command Execution Card --- */
.ca-work-list .ca-pill-card[data-runtime] {
  background: #111317;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  margin: 7px 0;
  max-width: 680px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.ca-work-list .ca-pill-card[data-runtime]:hover {
  border-color: rgba(255, 255, 255, 0.13);
}

.ca-work-list .ca-pill-card[data-runtime] .ca-pill-head {
  padding: 9px 13px;
  min-height: 38px;
  background: transparent;
}

.ca-work-list .ca-pill-card[data-runtime] .ca-pill-head:hover {
  background: rgba(255, 255, 255, 0.025);
}

.ca-work-list .ca-pill-card[data-runtime] .ca-pill-action,
.ca-work-list .ca-pill-card[data-runtime] .ca-pill-path,
.ca-work-list .ca-pill-card[data-runtime] .ca-command-exit {
  color: #9ba4b2;
  font-size: 13px;
  font-weight: 450;
}

.ca-work-list .ca-pill-card[data-runtime] .ca-pill-action {
  color: #b7c0cc;
}

.ca-work-list .ca-pill-card[data-runtime].is-error .ca-command-exit {
  color: #e08d72;
}

.ca-work-list .ca-pill-card[data-runtime] .kc-row-chevron {
  width: 13px;
  height: 13px;
  color: #828b98;
  transform: rotate(0deg);
  transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ca-work-list .ca-pill-card[data-runtime].is-open .kc-row-chevron {
  transform: rotate(90deg);
}

.ca-work-list .ca-pill-card[data-runtime] .ca-terminal-detail {
  margin: 0 7px 7px;
  background: #07080a;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9px;
}

.ca-terminal-input {
  padding: 10px 13px;
  gap: 10px;
  font: 12.5px/1.58 'JetBrains Mono', 'Cascadia Code', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.ca-terminal-input .kc-command-prompt {
  color: #626b78;
  user-select: none;
}

.ca-terminal-command {
  color: #cfd7e2;
}

.ca-terminal-command .tok-cmd {
  color: #dde4ed;
  font-weight: 600;
}

.ca-terminal-command .tok-str {
  color: #8be05c;
}

.ca-terminal-command .tok-flag {
  color: #e5c76b;
}

.ca-terminal-command .tok-num {
  color: #f09648;
}

.ca-terminal-command .tok-kw {
  color: #e5c76b;
}

.ca-terminal-detail .kc-command-output {
  margin: 0;
  padding: 10px 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #060708;
  color: #aeb7c4;
  font-size: 12px;
}

/* --- Analyzed & Edited/Created File Rows --- */
.ca-work-list .ca-pill-card:not([data-runtime]) .ca-pill-head {
  padding: 3px 2px;
  min-height: 27px;
}

.ca-work-list .ca-pill-card:not([data-runtime]) .ca-pill-left {
  gap: 6px;
}

.ca-work-list .ca-pill-card:not([data-runtime]) .ca-pill-action {
  color: #89929f;
  font-size: 13.5px;
  font-weight: 400;
}

.ca-work-list .ca-pill-card:not([data-runtime]) .ca-pill-target {
  gap: 6px;
  padding: 1px 5px;
  border-radius: 6px;
  transition: background 120ms ease;
}

.ca-work-list .ca-pill-card:not([data-runtime]) .ca-pill-path {
  color: #cbd3de;
  font-size: 13.5px;
  font-weight: 450;
}

.ca-work-list .ca-pill-card:not([data-runtime]) .ca-pill-range {
  color: #7d8694;
  font-size: 13px;
  font-family: inherit;
  margin-left: 2px;
}

.ca-work-list .kc-diff-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 4px;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.ca-work-list .kc-diff-plus {
  color: #57ab5a;
}

.ca-work-list .kc-diff-minus {
  color: #e5534b;
}

/* --- Exakte Lernapp-Programmiersprachen-Badges --- */
.kca-course-badge {
  width: 17px;
  height: 17px;
  border-radius: 5px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 1px 1px rgba(0, 0, 0, 0.45);
}

.kca-course-badge svg {
  width: 12px;
  height: 12px;
  display: block;
}

.ca-work-list .ca-pill-target > .kc-icon-slot .kca-course-badge {
  width: 17px;
  height: 17px;
  border-radius: 5px;
}

.ca-work-list .ca-pill-target .kca-course-badge svg {
  width: 12px;
  height: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .kca-hybrid-emblem::before,
  .kca-hybrid-emblem::after,
  .kca-chat-panel::before,
  .kca-chat-panel .kca-input-box::before,
  .kca-chat-panel .kca-input-box::after,
  .kca-new-row::before,
  .kca-new-row::after,
  .ca-work-details.is-streaming > .ca-work-summary,
  .kca-empty,
  .kca-empty h1,
  .kca-starter,
  .kca-msg {
    animation: none !important;
  }
}

/* ==========================================================================
   Cinematic Ultra-Premium Layer (v27) — Living Aurora Depth, Glass Sheen,
   Staggered Cinema Reveals, Volumetric Gemini-RGB Composer Glow
   ========================================================================== */

@keyframes kca-aurora-drift {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.78;
  }
  50% {
    transform: translate3d(0, -14px, 0) scale(1.06);
    opacity: 1;
  }
}

@keyframes kca-cinema-reveal {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
    filter: blur(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes kca-sheen-sweep {
  0%, 72% {
    transform: translateX(-140%) skewX(-22deg);
    opacity: 0;
  }
  82% {
    opacity: 0.45;
  }
  100% {
    transform: translateX(220%) skewX(-22deg);
    opacity: 0;
  }
}

/* --- Deep Black Canvas mit subtilem filmischem Aurora-Lichtschleier --- */
.kca-app,
.kca-main {
  background: #050607;
}

.kca-sidebar {
  background: linear-gradient(180deg, #16181c 0%, #131518 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.068);
  box-shadow: 4px 0 28px rgba(0, 0, 0, 0.45);
}

.kca-topbar {
  background: rgba(8, 9, 11, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.kca-chat-panel {
  position: relative;
  isolation: isolate;
  background: #050607;
  overflow: hidden;
}

.kca-chat-panel::before {
  display: none;
}

.kca-app[data-streaming='true'] .kca-chat-panel::before {
  display: none;
}

.kca-chat-panel > * {
  position: relative;
  z-index: 1;
}

/* --- Sidebar Premium Polish & Sheen --- */
.kca-new-row::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 45%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  pointer-events: none;
  opacity: 0;
}

.kca-new-row:hover::after {
  animation: kca-sheen-sweep 1.2s ease-out 1;
}

.kca-chat-item.is-active {
  background: linear-gradient(90deg, rgba(38, 208, 124, 0.09) 0%, #20242c 36%, #1d2027 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 14px rgba(0, 0, 0, 0.28);
}

.kca-chat-item.is-active::before {
  box-shadow: 0 0 10px rgba(38, 208, 124, 0.55);
}

/* --- Cinematic Empty State (3-Layer Halo + Staggered Reveal) --- */
.kca-hybrid-emblem {
  width: 74px;
  height: 74px;
  border-radius: 22px;
  background: linear-gradient(145deg, #16191f 0%, #0d0f13 100%);
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.78),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: visible;
  animation: kca-cinema-reveal 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.kca-hybrid-emblem::before {
  inset: -22px;
  border-radius: 34px;
  background: radial-gradient(
    circle at 42% 38%,
    rgba(38, 208, 124, 0.22),
    rgba(28, 199, 208, 0.16) 44%,
    rgba(77, 141, 255, 0.15) 68%,
    transparent 80%
  );
  filter: blur(22px);
}

.kca-hybrid-emblem::after {
  padding: 1.2px;
  opacity: 0.45;
}

.kca-empty h1 {
  font-size: clamp(1.48rem, 2.5vw, 1.82rem);
  font-weight: 560;
  letter-spacing: -0.028em;
  background: linear-gradient(108deg, #e5ebf2 0%, #cfd8e3 52%, #9eb3c8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: kca-cinema-reveal 620ms cubic-bezier(0.16, 1, 0.3, 1) 70ms both;
}

.kca-starter {
  padding: 8px 13px;
  border-radius: 11px;
  border: 1px solid transparent;
  animation: kca-cinema-reveal 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: background 180ms ease, border-color 180ms ease, transform 200ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 200ms ease;
}

.kca-starter:nth-child(1) { animation-delay: 120ms; }
.kca-starter:nth-child(2) { animation-delay: 170ms; }
.kca-starter:nth-child(3) { animation-delay: 220ms; }
.kca-starter:nth-child(4) { animation-delay: 270ms; }

.kca-starter:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.07);
  transform: translateX(5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.kca-starter:hover .kca-course-badge {
  transform: scale(1.1);
}

.kca-course-badge {
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), filter 180ms ease;
}

/* --- Cinematic Volumetric Gemini-RGB Composer --- */
.kca-chat-panel .kca-composer-wrap {
  padding: 10px 16px 20px;
  background: linear-gradient(0deg, #050607 78%, rgba(5, 6, 7, 0));
}

.kca-chat-panel .kca-input-box {
  background: rgba(17, 19, 24, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 22px;
  padding: 5px 5px 3px;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* Kein matschiger Nebel um den Composer — nur der gestochen scharfe animierte RGB-Rand */
.kca-chat-panel .kca-input-box::after {
  display: none;
}

.kca-chat-panel .kca-input-box::before {
  padding: 1.25px;
  opacity: 0.28;
}

.kca-chat-panel .kca-input-box:focus-within::before,
.kca-app[data-streaming='true'] .kca-chat-panel .kca-input-box::before {
  opacity: 0.78;
}

/* --- Cinematic Messages, Command Cards & File Rows --- */
.kca-msg {
  animation: kca-cinema-reveal 340ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.kca-msg-user .kca-bubble {
  background: linear-gradient(145deg, #1a1d23 0%, #14171c 100%);
  border: 1px solid rgba(255, 255, 255, 0.085);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: #dce3ec;
}

.kca-ai-body {
  color: #cbd3de;
}

.kca-ai-body code {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #e6c66e;
  padding: 1.5px 6px;
  border-radius: 6px;
}

.ca-work-list .ca-pill-card[data-runtime] {
  background: linear-gradient(180deg, #13161b 0%, #0f1115 100%);
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 13px;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 200ms ease;
}

.ca-work-list .ca-pill-card[data-runtime]:hover {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ca-work-list .ca-pill-card[data-runtime] .ca-terminal-detail {
  background: #060709;
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.55);
}

.ca-work-list .ca-pill-card:not([data-runtime]) .ca-pill-head:hover .ca-pill-target {
  background: rgba(255, 255, 255, 0.055);
}

.ca-work-list .ca-pill-card:not([data-runtime]) .ca-pill-head:hover .kca-course-badge {
  transform: scale(1.09);
}


/* ==========================================================================
   Koda Core v2.5 — Genuine Live Thinking Transcript, Settings Modal &
   Gemini / ChatGPT / Claude Visual Polish (Soft-Obsidian + Emerald + Gold)
   ========================================================================== */

.ca-thinking-body {
  margin: 6px 0 10px 2px;
  padding: 6px 12px;
  border-left: 2px solid rgba(148, 163, 184, 0.28);
  border-radius: 0 8px 8px 0;
  background: transparent;
  color: #949ca6;
  font-size: 13px;
  line-height: 1.62;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(143, 160, 178, 0.25) transparent;
  animation: kca-fade-up 180ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ca-thinking-body::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
.ca-thinking-body::-webkit-scrollbar-track {
  background: transparent;
}
.ca-thinking-body::-webkit-scrollbar-thumb {
  background: rgba(143, 160, 178, 0.24);
  border-radius: 999px;
}
.ca-thinking-body::-webkit-scrollbar-thumb:hover {
  background: rgba(143, 160, 178, 0.42);
}
.ca-thinking-body::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.ca-work-details.is-streaming > .ca-thinking-body {
  border-left-color: rgba(148, 163, 184, 0.45);
}

.kca-sb-settings-btn {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  border-radius: 10px;
  transition: background 140ms ease, border-color 140ms ease;
}
.kca-sb-settings-btn:hover {
  background: rgba(28, 34, 40, 0.85);
  border-color: #283138;
}

/* Telemetry & Compact Mode toggles */
body.kca-hide-telemetry .kca-msg-meta {
  display: none !important;
}

body.kca-compact .kca-thread {
  gap: 14px;
}
body.kca-compact .kca-ai-body {
  font-size: 14.2px;
  line-height: 1.56;
}

/* Gemini / ChatGPT / Claude Cleaner Composer & Message Rhythm */
.kca-input-box {
  border-radius: 22px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.34);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.kca-input-box:focus-within {
  border-color: rgba(38, 208, 124, 0.55);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.38), 0 0 0 3px rgba(38, 208, 124, 0.12);
}

/* Settings Modal */
.kca-modal-backdrop[hidden] {
  display: none !important;
}
.kca-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(9, 11, 13, 0.72);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: kca-fade-in 160ms ease both;
}

.kca-modal-card {
  width: min(560px, 100%);
  max-height: min(86vh, 760px);
  background: #151A1E;
  border: 1px solid #283138;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: kca-modal-pop 200ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.kca-modal-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(241, 245, 249, 0.08);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.kca-modal-head h2 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: #F1F5F9;
}
.kca-modal-sub {
  margin: 3px 0 0;
  font-size: 0.8rem;
  color: #8FA0B2;
}

.kca-modal-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.kca-set-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.kca-set-group-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #F5B82E;
}

.kca-set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 13px;
  background: #0F1214;
  border: 1px solid #232C33;
  flex-wrap: wrap;
}
.kca-set-toggle-row {
  cursor: pointer;
}
.kca-set-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 190px;
}
.kca-set-meta strong {
  font-size: 0.86rem;
  font-weight: 700;
  color: #F1F5F9;
}
.kca-set-meta small {
  font-size: 0.75rem;
  color: #8FA0B2;
  line-height: 1.38;
}

.kca-seg {
  display: inline-flex;
  background: #151A1E;
  border: 1px solid #283138;
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.kca-seg-opt {
  border: 0;
  background: transparent;
  color: #94A3B8;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 140ms ease;
}
.kca-seg-opt:hover {
  color: #F1F5F9;
}
.kca-seg-opt.is-active {
  background: rgba(38, 208, 124, 0.16);
  color: #26D07C;
}

.kca-slider-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.kca-slider-wrap input[type="range"] {
  width: 120px;
  accent-color: #26D07C;
  cursor: pointer;
}
.kca-slider-val {
  min-width: 34px;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 700;
  color: #F5B82E;
  font-variant-numeric: tabular-nums;
}

.kca-set-select {
  background: #1C2228;
  border: 1px solid #283138;
  color: #F1F5F9;
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}
.kca-set-select:focus {
  border-color: #26D07C;
}

.kca-switch {
  appearance: none;
  -webkit-appearance: none;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #283138;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 160ms ease;
}
.kca-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #CBD5E1;
  transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1), background 160ms ease;
}
.kca-switch:checked {
  background: #26D07C;
}
.kca-switch:checked::after {
  transform: translateX(18px);
  background: #062415;
}

.kca-set-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.kca-set-btn {
  flex: 1;
  min-width: 180px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #283138;
  background: #1C2228;
  color: #E2E8F0;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 140ms ease;
}
.kca-set-btn:hover {
  border-color: #26D07C;
  color: #26D07C;
}
.kca-set-btn.is-danger:hover {
  border-color: #FF8A3D;
  background: rgba(255, 138, 61, 0.12);
  color: #FF8A3D;
}

@keyframes kca-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes kca-fade-up {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes kca-modal-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Account & Auth UI (Google + E-Mail, Cloud-Sync) + Schnell-Code Toggle */
.kca-sb-account-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: 10px;
  border: 1px solid #283138;
  background: #151A1E;
  color: #E2E8F0;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}
.kca-sb-account-btn:hover {
  border-color: #26D07C;
  background: #1C2228;
}
.kca-account-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #1C2228;
  border: 1px solid #283138;
  color: #26D07C;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
}
.kca-account-avatar.is-signed-in {
  background: #26D07C;
  border-color: #159A57;
  color: #062415;
}
.kca-account-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.kca-account-name {
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kca-account-sub {
  font-size: 0.69rem;
  color: #94A3B8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kca-sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #475569;
  flex-shrink: 0;
}
.kca-sync-dot.is-online {
  background: #26D07C;
  box-shadow: 0 0 0 3px rgba(38, 208, 124, 0.18);
}
.kca-sync-dot.is-syncing {
  background: #F5B82E;
}

.kca-top-auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid #283138;
  background: #151A1E;
  color: #E2E8F0;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}
.kca-top-auth-btn:hover {
  border-color: #26D07C;
  background: #1C2228;
}
.kca-top-auth-btn.is-signed-in {
  border-color: rgba(38, 208, 124, 0.4);
}
.kca-top-auth-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #64748B;
}
.kca-top-auth-btn.is-signed-in .kca-top-auth-dot {
  background: #26D07C;
}

.kca-fast-code-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #283138;
  background: #151A1E;
  color: #94A3B8;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 140ms ease;
}
.kca-fast-code-btn:hover {
  border-color: #26D07C;
  color: #E2E8F0;
}
.kca-fast-code-btn.is-active {
  background: rgba(38, 208, 124, 0.14);
  border-color: #26D07C;
  color: #26D07C;
}

.kca-auth-card {
  max-width: 440px;
}
.kca-google-btn {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1px solid #283138;
  background: #1C2228;
  color: #F8FAFC;
  font-size: 0.9rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 3px 0 #0c0d0e;
  transition: transform 120ms ease, border-color 140ms ease, background 140ms ease;
}
.kca-google-btn:hover {
  border-color: #26D07C;
  background: #222930;
}
.kca-google-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #0c0d0e;
}
.kca-auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: #64748B;
  font-size: 0.75rem;
  font-weight: 600;
}
.kca-auth-divider::before,
.kca-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #283138;
}
.kca-auth-tabs {
  width: 100%;
  margin-bottom: 14px;
}
.kca-auth-tabs .kca-seg-opt {
  flex: 1;
}
.kca-auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.kca-auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.kca-auth-field span {
  font-size: 0.77rem;
  font-weight: 700;
  color: #CBD5E1;
}
.kca-auth-field input {
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #283138;
  background: #0F1214;
  color: #F8FAFC;
  font: inherit;
  font-size: 0.88rem;
  outline: none;
}
.kca-auth-field input:focus {
  border-color: #26D07C;
}
.kca-auth-feedback {
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.8rem;
  line-height: 1.4;
  border: 1px solid rgba(255, 138, 61, 0.4);
  background: rgba(255, 138, 61, 0.1);
  color: #FFB07A;
}
.kca-auth-feedback.is-ok {
  border-color: rgba(38, 208, 124, 0.45);
  background: rgba(38, 208, 124, 0.12);
  color: #6EE7B7;
}
.kca-auth-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.kca-auth-submit {
  height: 42px;
  border-radius: 12px;
  border: 0;
  background: #26D07C;
  color: #062415;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 #159A57;
  transition: transform 120ms ease, filter 140ms ease;
}
.kca-auth-submit:hover {
  filter: brightness(1.04);
}
.kca-auth-submit:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #159A57;
}
.kca-auth-submit:disabled {
  opacity: 0.6;
  cursor: wait;
}
.kca-auth-link-btn {
  background: transparent;
  border: 0;
  color: #94A3B8;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  align-self: center;
  padding: 4px 8px;
}
.kca-auth-link-btn:hover {
  color: #26D07C;
}
.kca-auth-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #283138;
  background: #0F1214;
}
.kca-auth-profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #26D07C;
  color: #062415;
  font-weight: 900;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kca-auth-profile-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.kca-auth-profile-info strong {
  font-size: 0.9rem;
  color: #F8FAFC;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kca-auth-sync-badge {
  font-size: 0.75rem;
  color: #26D07C;
  font-weight: 600;
}

/* ChatGPT / Gemini Style Sidebar Account Popover & Settings Tabs */
.kca-sb-account-wrap {
  position: relative;
}
.kca-account-avatar {
  border-radius: 999px;
  overflow: hidden;
}
.kca-account-avatar img,
.kca-top-auth-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 999px;
}
.kca-account-dots {
  color: #64748B;
  flex-shrink: 0;
}
.kca-sb-account-btn:hover .kca-account-dots {
  color: #CBD5E1;
}
.kca-account-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  background: #151A1E;
  border: 1px solid #283138;
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
  z-index: 60;
  animation: kca-fade-up 140ms ease;
}
.kca-account-menu[hidden] {
  display: none;
}
.kca-account-menu-head {
  padding: 8px 10px 6px;
  border-bottom: 1px solid #283138;
  margin-bottom: 4px;
}
.kca-account-menu-email {
  display: block;
  font-size: 0.74rem;
  color: #94A3B8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kca-account-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: #E2E8F0;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.kca-account-menu-item:hover {
  background: #1C2228;
  color: #26D07C;
}
.kca-account-menu-item.is-danger:hover {
  background: rgba(255, 138, 61, 0.12);
  color: #FF8A3D;
}
.kca-account-menu-sep {
  height: 1px;
  background: #283138;
  margin: 4px 6px;
}

.kca-top-auth-avatar {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #1C2228;
  color: #062415;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  overflow: hidden;
  flex-shrink: 0;
}
.kca-top-auth-btn.is-signed-in .kca-top-auth-avatar {
  background: #26D07C;
}

.kca-settings-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.kca-settings-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid #283138;
}
.kca-settings-tab {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #283138;
  background: #151A1E;
  color: #94A3B8;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 140ms ease;
}
.kca-settings-tab:hover {
  color: #E2E8F0;
  border-color: #3B4752;
}
.kca-settings-tab.is-active {
  background: #26D07C;
  border-color: #159A57;
  color: #062415;
}
.kca-settings-panels {
  display: flex;
  flex-direction: column;
  gap: 18px;
}


/* ==========================================================================
   Koda Core v3.0 — Ultra-Clean Soft-Obsidian Visual & Smooth Motion Polish
   (Gemini / ChatGPT / Claude aesthetic · Emerald-Jade + Warm-Gold accents)
   ========================================================================== */

:root {
  --kca-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Global thin, clean scrollbars — no clunky OS arrows anywhere */
.kca-scroll,
.kca-chat-list,
.kca-modal-body,
.kca-canvas-body,
.kca-ws-list,
.kca-term-log,
.kca-code-body,
.ca-thinking-body {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.22) transparent;
}
.kca-scroll::-webkit-scrollbar,
.kca-chat-list::-webkit-scrollbar,
.kca-modal-body::-webkit-scrollbar,
.kca-canvas-body::-webkit-scrollbar,
.kca-ws-list::-webkit-scrollbar,
.kca-term-log::-webkit-scrollbar,
.kca-code-body::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.kca-scroll::-webkit-scrollbar-track,
.kca-chat-list::-webkit-scrollbar-track,
.kca-modal-body::-webkit-scrollbar-track,
.kca-canvas-body::-webkit-scrollbar-track {
  background: transparent;
}
.kca-scroll::-webkit-scrollbar-thumb,
.kca-chat-list::-webkit-scrollbar-thumb,
.kca-modal-body::-webkit-scrollbar-thumb,
.kca-canvas-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.22);
  border-radius: 999px;
}
.kca-scroll::-webkit-scrollbar-thumb:hover,
.kca-chat-list::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.38);
}
.kca-scroll::-webkit-scrollbar-button,
.kca-chat-list::-webkit-scrollbar-button,
.kca-modal-body::-webkit-scrollbar-button,
.kca-canvas-body::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

/* Calmer Soft-Obsidian Surfaces & Subtle Radial Depth */
.kca-body {
  background: #0F1214;
  color: #F1F5F9;
  -webkit-font-smoothing: antialiased;
}

.kca-main {
  background: radial-gradient(ellipse 70% 42% at 50% -10%, rgba(38, 208, 124, 0.045), transparent 65%), #0F1214;
}

.kca-sidebar {
  background: #13171B;
  border-right: 1px solid rgba(241, 245, 249, 0.07);
  transition: transform 240ms var(--kca-ease), width 240ms var(--kca-ease), opacity 200ms ease;
}

.kca-topbar {
  background: rgba(15, 18, 20, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(241, 245, 249, 0.06);
}

/* Smooth New Chat & Starter Cards */
.kca-new-row {
  border-radius: 12px;
  transition: background 160ms ease, border-color 160ms ease, transform 140ms var(--kca-ease);
}
.kca-new-row:hover {
  background: #1C2228;
  border-color: rgba(38, 208, 124, 0.35);
}
.kca-new-row:active {
  transform: scale(0.985);
}

.kca-chat-item {
  border-radius: 10px;
  transition: background 150ms ease, color 150ms ease;
}
.kca-chat-item:hover {
  background: rgba(28, 34, 40, 0.78);
}
.kca-chat-item.is-active {
  background: #1C2228;
}

/* Empty Hero & Starter Cards (Gemini / Claude airy polish) */
.kca-empty-center {
  animation: kca-fade-up 360ms var(--kca-ease) both;
}
.kca-empty h1 {
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #F8FAFC;
}
.kca-starter {
  background: #151A1E;
  border: 1px solid rgba(241, 245, 249, 0.08);
  border-radius: 14px;
  transition: transform 180ms var(--kca-ease), background 160ms ease, border-color 160ms ease, box-shadow 180ms ease;
}
.kca-starter:hover {
  transform: translateY(-2px);
  background: #1B2127;
  border-color: rgba(38, 208, 124, 0.38);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}
.kca-starter:active {
  transform: translateY(0);
}

/* Airy Editorial Messages */
.kca-thread {
  max-width: 820px;
  margin-inline: auto;
  gap: 24px;
}

.kca-msg {
  animation: kca-fade-up 240ms var(--kca-ease) both;
}

.kca-msg-user .kca-bubble {
  background: #1B2127;
  border: 1px solid rgba(241, 245, 249, 0.08);
  border-radius: 18px 18px 5px 18px;
  color: #F1F5F9;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
}

.kca-ai-body {
  color: #E8EEF5;
  line-height: 1.68;
  letter-spacing: -0.003em;
}
.kca-ai-body strong {
  color: #FFFFFF;
  font-weight: 700;
}
.kca-ai-body code:not(pre code) {
  background: #1B2127;
  border: 1px solid rgba(241, 245, 249, 0.09);
  color: #F5B82E;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.86em;
}

/* Sleek Code Blocks */
.kca-code-block,
.kca-ai-body pre {
  background: #111519;
  border: 1px solid rgba(241, 245, 249, 0.08);
  border-radius: 13px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}
.kca-code-head {
  background: #161B20;
  border-bottom: 1px solid rgba(241, 245, 249, 0.06);
}

/* Refined Thinking Block (Gemini / ChatGPT feel) */
.ca-work-details {
  margin: 2px 0 10px;
}
.ca-work-summary {
  padding: 4px 8px 4px 2px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: #94A3B8;
  transition: color 150ms ease, background 150ms ease;
}
.ca-work-summary:hover {
  color: #F1F5F9;
  background: rgba(255, 255, 255, 0.03);
}
.ca-thinking-body {
  margin: 6px 0 10px 4px;
  padding: 11px 15px;
  border-left: 2px solid rgba(38, 208, 124, 0.45);
  border-radius: 0 12px 12px 0;
  background: rgba(21, 26, 30, 0.58);
  color: #9BAAB9;
  font-size: 13.2px;
  line-height: 1.64;
}

/* Floating Pill Composer (ChatGPT / Claude / Gemini) */
.kca-composer-wrap {
  background: linear-gradient(to top, #0F1214 68%, rgba(15, 18, 20, 0));
}
.kca-input-box {
  background: #151A1E;
  border: 1px solid #283138;
  border-radius: 22px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.32);
  transition: border-color 180ms ease, box-shadow 200ms var(--kca-ease), background 180ms ease;
}
.kca-input-box:focus-within {
  background: #171D22;
  border-color: rgba(38, 208, 124, 0.52);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38), 0 0 0 3px rgba(38, 208, 124, 0.11);
}

.kca-send-btn {
  background: #26D07C;
  color: #062415;
  box-shadow: 0 3px 0 #159A57, inset 0 1px 0 rgba(255, 255, 255, 0.26);
  transition: transform 110ms var(--kca-ease), filter 150ms ease, opacity 150ms ease;
}
.kca-send-btn:hover:not(:disabled) {
  filter: brightness(1.06);
}
.kca-send-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #159A57;
}

.kca-stop-btn {
  background: #FF8A3D;
  color: #240D02;
  box-shadow: 0 3px 0 #C2510C;
  transition: transform 110ms var(--kca-ease), filter 150ms ease;
}
.kca-stop-btn:hover {
  filter: brightness(1.06);
}
.kca-stop-btn:active {
  transform: translateY(2px);
}

/* Smooth Canvas & Popovers */
.kca-canvas {
  background: #13171B;
  border-left: 1px solid rgba(241, 245, 249, 0.08);
  transition: transform 240ms var(--kca-ease), width 240ms var(--kca-ease);
}

.kca-model-popover,
.ca-plus-popover {
  background: #151A1E;
  border: 1px solid #283138;
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.48);
  animation: kca-modal-pop 160ms var(--kca-ease) both;
}

/* Smooth subtle action buttons under AI replies */
.kca-act-btn {
  border-radius: 8px;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.kca-act-btn:hover {
  background: #1C2228;
  color: #F1F5F9;
}


/* ==========================================================================
   Koda Core v3.1 — Deep Cinematic Dark Background & Account Switcher Card
   ========================================================================== */

.kca-body,
.kca-app {
  background: #0A0C0E;
}

.kca-main {
  background:
    radial-gradient(ellipse 65% 38% at 50% -12%, rgba(38, 208, 124, 0.055), transparent 64%),
    radial-gradient(ellipse 40% 28% at 85% 100%, rgba(245, 184, 46, 0.028), transparent 60%),
    #0A0C0E;
}

.kca-sidebar {
  background: #0E1114;
  border-right: 1px solid rgba(255, 255, 255, 0.065);
}

.kca-topbar {
  background: rgba(10, 12, 14, 0.84);
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.kca-composer-wrap {
  background: linear-gradient(to top, #0A0C0E 70%, rgba(10, 12, 14, 0));
}

.kca-input-box {
  background: #13171B;
  border-color: #232B32;
}
.kca-input-box:focus-within {
  background: #151A1E;
}

/* Account Avatar Trigger & Cinematic Floating Account Card */
.kca-account-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.kca-account-trigger {
  width: 34px;
  height: 34px;
  padding: 2px;
  border-radius: 50%;
  border: 2px solid transparent;
  background:
    linear-gradient(#0A0C0E, #0A0C0E) padding-box,
    linear-gradient(135deg, #26D07C, #F5B82E, #FF8A3D) border-box;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 140ms var(--kca-ease), filter 140ms ease;
}
.kca-account-trigger:hover {
  transform: scale(1.06);
  filter: brightness(1.08);
}

.kca-account-avatar-sm {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #151A1E;
  color: #F1F5F9;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  letter-spacing: -0.02em;
}

.kca-account-card[hidden] {
  display: none !important;
}

.kca-account-card {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 336px;
  max-width: calc(100vw - 24px);
  background: #171B1F;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 26px;
  padding: 42px 14px 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.72);
  z-index: 110;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: kca-modal-pop 180ms var(--kca-ease) both;
}

.kca-acc-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: #94A3B8;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.kca-acc-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #F1F5F9;
}

.kca-acc-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-radius: 20px;
  overflow: hidden;
}

.kca-acc-primary {
  background: #0F1214;
  padding: 14px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.kca-acc-avatar-ring {
  position: relative;
  width: 52px;
  height: 52px;
  padding: 2.5px;
  border-radius: 50%;
  background: linear-gradient(135deg, #26D07C, #F5B82E, #FF8A3D);
  flex-shrink: 0;
}

.kca-acc-avatar-lg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #151A1E;
  color: #F1F5F9;
  font-size: 16px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.kca-acc-edit-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1C2228;
  border: 2px solid #0F1214;
  color: #E2E8F0;
  display: grid;
  place-items: center;
  text-decoration: none;
}

.kca-acc-identity {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kca-acc-name {
  font-size: 15px;
  font-weight: 700;
  color: #F8FAFC;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kca-acc-email {
  font-size: 12.5px;
  color: #94A3B8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kca-acc-plan {
  align-self: flex-start;
  margin-top: 3px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #062415;
  background: linear-gradient(135deg, #26D07C, #F5B82E);
}

.kca-acc-caret {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  background: #1C2228;
  color: #CBD5E1;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 180ms var(--kca-ease), background 140ms ease;
}
.kca-acc-caret[aria-expanded="false"] {
  transform: rotate(180deg);
}
.kca-acc-caret:hover {
  background: #283138;
}

.kca-acc-sublist {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.kca-acc-sublist[hidden] {
  display: none !important;
}

.kca-acc-row {
  width: 100%;
  border: 0;
  background: #0F1214;
  color: #E2E8F0;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  transition: background 140ms ease;
}
.kca-acc-row:hover {
  background: #1F262D;
}

.kca-acc-mini-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #26D07C, #159A57);
  color: #062415;
  font-size: 12.5px;
  font-weight: 900;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.kca-acc-icon-circle {
  width: 24px;
  height: 24px;
  margin-left: 2px;
  border-radius: 50%;
  background: rgba(38, 208, 124, 0.14);
  color: #26D07C;
  font-size: 16px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.kca-acc-icon-plain {
  width: 24px;
  height: 24px;
  margin-left: 2px;
  color: #CBD5E1;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.kca-acc-row-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kca-acc-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(245, 184, 46, 0.16);
  color: #F5B82E;
}

.kca-acc-pills {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kca-acc-pill-btn {
  width: 100%;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: #0F1214;
  color: #F1F5F9;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}
.kca-acc-pill-btn:hover {
  background: #1C2228;
  border-color: rgba(38, 208, 124, 0.35);
}

.kca-acc-pill-icon {
  font-size: 15px;
  width: 20px;
  text-align: center;
}
.kca-acc-pill-icon.is-emerald { color: #26D07C; }
.kca-acc-pill-icon.is-gold { color: #F5B82E; }

.kca-acc-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 4px;
  font-size: 11.5px;
  color: #8FA0B2;
}
.kca-acc-footer a {
  color: #8FA0B2;
  text-decoration: none;
}
.kca-acc-footer a:hover {
  color: #F1F5F9;
  text-decoration: underline;
}

/* Final ChatGPT-Style Thinking Bar & Explicit Chevron Arrow (highest priority) */
.ca-work-details > .ca-work-summary {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 2px 4px 2px 0 !important;
  background: transparent !important;
  border: 0 !important;
  color: #8e8e8e !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  letter-spacing: -0.005em;
  cursor: pointer;
}
.ca-work-details > .ca-work-summary::after {
  display: none !important;
}
.ca-work-details.is-empty > .ca-work-summary {
  cursor: default;
}
.ca-work-details.is-empty > .ca-work-summary .ca-work-chevron {
  display: none;
}
.ca-work-chevron {
  width: 14px;
  height: 14px;
  color: #8e8e8e;
  flex-shrink: 0;
  transform: rotate(-90deg);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), color 140ms ease;
}
.ca-work-details[open] > .ca-work-summary .ca-work-chevron {
  transform: rotate(0deg);
}
.ca-work-details > .ca-work-summary:hover,
.ca-work-details > .ca-work-summary:hover .ca-work-chevron {
  color: #d4d4d4 !important;
}
.ca-work-details.is-streaming > .ca-work-summary {
  color: #8e8e8e !important;
}
.ca-work-details.is-streaming > .ca-work-summary .ca-work-label {
  background: linear-gradient(90deg, #6f6f6f 0%, #dcdcdc 50%, #6f6f6f 100%) !important;
  background-size: 220% 100% !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
  animation: kca-rgb-slide 2s linear infinite !important;
}
.ca-thinking-body,
.ca-work-details.is-streaming > .ca-thinking-body {
  margin: 6px 0 10px 2px !important;
  padding: 6px 12px !important;
  border-left: 2px solid rgba(142, 142, 142, 0.3) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #8e8e8e !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
}

/* ==========================================================================
   Koda Core — Near-Black Grey + Subtle Dark-Blue RGB Theme (No other accents)
   ========================================================================== */
@keyframes kca-darkblue-rgb {
  0% {
    border-color: rgba(30, 58, 138, 0.72);
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(29, 78, 216, 0.28), 0 0 22px rgba(29, 78, 216, 0.14);
  }
  50% {
    border-color: rgba(37, 99, 235, 0.78);
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(37, 99, 235, 0.36), 0 0 28px rgba(30, 64, 175, 0.24);
  }
  100% {
    border-color: rgba(30, 58, 138, 0.72);
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(29, 78, 216, 0.28), 0 0 22px rgba(29, 78, 216, 0.14);
  }
}

.kca-body {
  background: #090b0e !important;
  color: #e5e9f0 !important;
}

.kca-sidebar {
  background: #0b0d11 !important;
  border-right: 1px solid #1c212b !important;
}

.kca-main {
  background:
    radial-gradient(ellipse 72% 40% at 50% -12%, rgba(29, 78, 216, 0.16), transparent 68%),
    #0c0e12 !important;
}

.kca-topbar {
  background: rgba(11, 13, 17, 0.86) !important;
  border-bottom: 1px solid #1c212b !important;
}

.kca-composer-wrap {
  background: linear-gradient(to top, #0c0e12 68%, rgba(12, 14, 18, 0)) !important;
}

.kca-input-box {
  background: #11141a !important;
  border: 1px solid #222834 !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.42), 0 0 18px rgba(23, 37, 84, 0.18) !important;
}

.kca-input-box:focus-within {
  background: #131720 !important;
  animation: kca-darkblue-rgb 4.2s ease-in-out infinite !important;
}

.kca-new-row,
.kca-starter,
.kca-sb-account-btn,
.kca-top-auth-btn,
.kca-fast-code-btn,
.kca-settings-tab,
.kca-set-btn,
.kca-google-btn,
.kca-account-menu,
.kca-model-popover,
.ca-plus-popover,
.kca-modal-card,
.kca-canvas {
  background: #11141a !important;
  border-color: #222834 !important;
}

.kca-new-row:hover,
.kca-starter:hover,
.kca-sb-account-btn:hover,
.kca-top-auth-btn:hover,
.kca-fast-code-btn:hover,
.kca-set-btn:hover,
.kca-google-btn:hover {
  background: #161b24 !important;
  border-color: #1d4ed8 !important;
  color: #e5e9f0 !important;
  box-shadow: 0 0 16px rgba(29, 78, 216, 0.18) !important;
}

.kca-chat-item:hover,
.kca-chat-item.is-active,
.kca-msg-user .kca-bubble {
  background: #161a22 !important;
  border-color: #232a36 !important;
}

.kca-send-btn,
.kca-auth-submit,
.kca-settings-tab.is-active,
.kca-switch:checked,
.kca-account-avatar.is-signed-in,
.kca-top-auth-btn.is-signed-in .kca-top-auth-avatar,
.kca-auth-profile-avatar {
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 55%, #2563eb 100%) !important;
  border-color: #1e3a8a !important;
  color: #f8fafc !important;
  box-shadow: 0 3px 0 #172554, 0 0 14px rgba(29, 78, 216, 0.35) !important;
}

.kca-switch:checked::after {
  background: #f8fafc !important;
}

.kca-stop-btn {
  background: #1c222d !important;
  border: 1px solid #2d3748 !important;
  color: #e5e9f0 !important;
  box-shadow: 0 3px 0 #0d1016 !important;
}

.kca-fast-code-btn.is-active {
  background: rgba(29, 78, 216, 0.2) !important;
  border-color: #2563eb !important;
  color: #93c5fd !important;
  box-shadow: 0 0 14px rgba(29, 78, 216, 0.24) !important;
}

.kca-sync-dot.is-online,
.kca-sync-dot.is-syncing {
  background: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.24) !important;
}

.kca-auth-sync-badge,
.kca-account-menu-item:hover,
.kca-auth-link-btn:hover,
.kca-ai-body code:not(pre code),
.ca-term-rt {
  color: #93c5fd !important;
}

.kca-ai-body code:not(pre code) {
  background: #141923 !important;
  border-color: #232d40 !important;
}

.kca-code-block,
.kca-ai-body pre {
  background: #0d1016 !important;
  border-color: #1f2633 !important;
}

.kca-code-head {
  background: #12161f !important;
  border-bottom-color: #1f2633 !important;
}

.kca-sb-logo path[stroke="#26D07C"],
.ca-top-brand-sym path[stroke="#26D07C"] {
  stroke: #2563eb !important;
}

.kca-auth-field input {
  background: #0a0c10 !important;
  border-color: #222834 !important;
}

.kca-auth-field input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.25) !important;
}

.kca-auth-feedback,
.kca-auth-feedback.is-ok {
  border-color: rgba(37, 99, 235, 0.45) !important;
  background: rgba(29, 78, 216, 0.14) !important;
  color: #bfdbfe !important;
}

.kca-set-btn.is-danger:hover,
.kca-account-menu-item.is-danger:hover {
  border-color: #2563eb !important;
  background: rgba(29, 78, 216, 0.14) !important;
  color: #e5e9f0 !important;
}

.kc-live-file-code {
  margin: 0;
  padding: 10px 12px;
  max-height: 260px;
  overflow: auto;
  background: #0b0e12;
  border: 1px solid rgba(38, 208, 124, 0.24);
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.48;
  color: #dbe7ee;
  white-space: pre;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.28) transparent;
}

.kc-live-file-code::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.kc-live-file-code::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.28);
  border-radius: 999px;
}

@media (prefers-reduced-motion: reduce) {
  .kca-input-box:focus-within {
    animation: none !important;
  }
}

/* Search results and workspace editor */
.kca-answer-sources { margin-block: 14px 6px; }
.kca-answer-sources h3 { margin: 0 0 7px; color: var(--muted); font-size: 0.8rem; font-weight: 650; }
.kca-source-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 7px; list-style: none; margin: 0; padding: 0; }
.kca-source-grid > li { min-width: 0; display: flex; }
.kca-source-result {
  display: grid;
  align-content: start;
  gap: 4px;
  width: 100%;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}
.kca-source-result:hover, .kca-source-result:focus-visible { border-color: var(--emerald); color: inherit; }
.kca-source-domain { display: flex; justify-content: space-between; gap: 8px; overflow-wrap: anywhere; color: var(--emerald); font-size: 0.72rem; }
.kca-source-result strong, .kca-source-result small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.kca-source-result strong { font-size: 0.82rem; }
.kca-source-result small { font-size: 0.74rem; color: var(--muted); }
.kca-file-downloads { display: grid; gap: 6px; margin-block: 12px 4px; max-width: 440px; justify-items: start; }
.kca-file-download { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 4px 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.kca-file-download-open { display: flex; gap: 7px; align-items: center; min-width: 0; color: inherit; border: 0; background: transparent; padding: 5px 0; cursor: pointer; text-align: left; }
.kca-file-download-open > span:last-child, .kca-file-editor-head > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kca-file-save { color: var(--emerald); margin-inline-start: auto; white-space: nowrap; }
.kca-file-editor { display: grid; grid-template-rows: auto auto minmax(0, 1fr); height: 100%; min-height: 0; }
.kca-file-editor-head, .kca-file-editor-actions { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.kca-file-editor-head { font-size: 0.86rem; font-weight: 650; }
.kca-file-editor-actions { flex-wrap: wrap; padding-block: 6px; }
.kca-file-editor-actions [aria-pressed='true'] { color: var(--emerald); }
.kca-file-editor-body { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.kca-file-editor-body .kca-code-wrap { border: 0; border-radius: 0; margin: 0; }
.kca-file-editor-body .kca-code-wrap pre { max-height: none; }
.kca-file-editor-body iframe { display: block; width: 100%; height: 100%; min-height: 280px; border: 0; background: #fff; }
.kca-cpane#kca-pane-diff, .ca-diff-pane:has(.kca-file-editor) { height: 100%; min-height: 0; }

/* ---------- Cinematic Web-Search Animation & Source Cards (Emerald-Jade + Soft-Obsidian) ---------- */
@keyframes ca-web-radar-pulse {
  0% {
    transform: scale(0.82);
    opacity: 0.72;
  }
  70% {
    transform: scale(1.95);
    opacity: 0;
  }
  100% {
    transform: scale(1.95);
    opacity: 0;
  }
}

@keyframes ca-web-globe-spin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.06); }
  100% { transform: rotate(360deg) scale(1); }
}

@keyframes ca-web-beam-sweep {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(220%); }
}

@keyframes ca-web-dot-wave {
  0%, 80%, 100% {
    opacity: 0.25;
    transform: translateY(0) scale(0.85);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px) scale(1.15);
  }
}

@keyframes ca-source-card-in {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ca-pill-card[data-web='true'] {
  position: relative;
  border-radius: 11px;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 220ms ease;
}

.ca-pill-card[data-web='true'].is-running {
  background: linear-gradient(135deg, rgba(21, 26, 30, 0.96), rgba(15, 18, 20, 0.92)) !important;
  border: 1px solid rgba(38, 208, 124, 0.34) !important;
  padding: 5px 10px !important;
  margin-block: 4px !important;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(38, 208, 124, 0.08), 0 6px 20px -8px rgba(38, 208, 124, 0.28);
}

.ca-pill-card[data-web='true'].is-running::before {
  content: '';
  position: absolute;
  inset: 0;
  width: 48%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(38, 208, 124, 0.14) 45%,
    rgba(245, 184, 46, 0.1) 60%,
    transparent 100%
  );
  pointer-events: none;
  animation: ca-web-beam-sweep 2.1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.ca-pill-card[data-web='true'].is-running .ca-pill-action {
  background: linear-gradient(90deg, #26d07c 0%, #c8f9df 50%, #26d07c 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 600;
  animation: ca-shimmer 1.9s linear infinite;
}

.ca-pill-card[data-web='true'].is-running .ca-pill-path {
  color: #e6f2ec !important;
  font-weight: 500;
}

.ca-web-orb {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #26d07c;
  flex-shrink: 0;
}

.ca-web-orb.is-searching .ca-web-globe {
  filter: drop-shadow(0 0 6px rgba(38, 208, 124, 0.55));
  animation: ca-web-globe-spin 3.8s linear infinite;
}

.ca-web-radar {
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  border: 1.5px solid rgba(38, 208, 124, 0.65);
  pointer-events: none;
  animation: ca-web-radar-pulse 1.85s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.ca-web-radar.is-delayed {
  animation-delay: 0.92s;
}

.ca-web-scan-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-inline-start: 4px;
}

.ca-web-scan-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #26d07c;
  animation: ca-web-dot-wave 1.2s ease-in-out infinite;
}

.ca-web-scan-dots span:nth-child(2) {
  animation-delay: 0.16s;
  background: #6ee7b7;
}

.ca-web-scan-dots span:nth-child(3) {
  animation-delay: 0.32s;
  background: #f5b82e;
}

/* Stacked overlapping domain monogram pills (ChatGPT / Perplexity / Gemini style) */
.ca-web-domain-stack {
  display: inline-flex;
  align-items: center;
  margin-inline-start: 4px;
  flex-shrink: 0;
}

.ca-web-domain-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #26d07c;
  background: #151a1e;
  border: 1.5px solid #283138;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  margin-inline-start: -5px;
  transition: transform 150ms ease, border-color 150ms ease;
}

.ca-web-domain-dot:first-child {
  margin-inline-start: 0;
}

.ca-web-domain-dot:nth-child(2) { color: #f5b82e; }
.ca-web-domain-dot:nth-child(3) { color: #67e8f9; }
.ca-web-domain-dot:nth-child(4) { color: #ff8a3d; }

.ca-pill-head:hover .ca-web-domain-dot {
  border-color: rgba(38, 208, 124, 0.5);
  transform: translateY(-1px);
}

/* Top work header emerald shimmer while actively searching */
.ca-work-details.is-streaming[data-phase='searching'] > .ca-work-summary .ca-work-label {
  background: linear-gradient(90deg, #9fb4aa 0%, #26d07c 45%, #f5b82e 55%, #9fb4aa 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: ca-shimmer 2s linear infinite;
}

/* Upgraded staggered source cards */
.kca-source-grid {
  gap: 8px;
  margin-top: 6px;
}

.kca-source-grid > li {
  animation: ca-source-card-in 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--src-i, 0) * 45ms);
}

.kca-source-result {
  background: linear-gradient(180deg, #151a1e 0%, #111518 100%);
  border: 1px solid #283138;
  border-radius: 11px;
  padding: 10px 12px;
  gap: 5px;
  transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1), border-color 160ms ease, box-shadow 180ms ease, background-color 160ms ease;
}

.kca-source-result:hover,
.kca-source-result:focus-visible {
  border-color: rgba(38, 208, 124, 0.65);
  background: linear-gradient(180deg, #192025 0%, #14191d 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -10px rgba(38, 208, 124, 0.35);
}

.kca-source-domain {
  align-items: center;
  color: #26d07c;
  font-weight: 600;
}

.kca-source-domain-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.kca-source-badge {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: rgba(38, 208, 124, 0.14);
  border: 1px solid rgba(38, 208, 124, 0.32);
  color: #26d07c;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kca-source-host {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kca-source-ext {
  opacity: 0.72;
  transition: transform 150ms ease, opacity 150ms ease;
}

.kca-source-result:hover .kca-source-ext {
  opacity: 1;
  transform: translate(2px, -2px);
}

@media (prefers-reduced-motion: reduce) {
  .ca-pill-card[data-web='true'].is-running::before,
  .ca-pill-card[data-web='true'].is-running .ca-pill-action,
  .ca-web-orb.is-searching .ca-web-globe,
  .ca-web-radar,
  .ca-web-scan-dots span,
  .ca-work-details.is-streaming[data-phase='searching'] > .ca-work-summary .ca-work-label,
  .kca-source-grid > li {
    animation: none !important;
  }
}

/* ==========================================================================
   Koda Core UI Polish — Soft-Obsidian Depth, Crisp Typography & Micro-Motion
   (Beibehaltung der grauen Grundpalette #0c0d0e / #151618 / #1b1c1f / #242628)
   ========================================================================== */

/* Dezente, schlanke Scrollbars im passenden Grau */
.kca-scroll::-webkit-scrollbar,
.kca-chat-list::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.kca-scroll::-webkit-scrollbar-track,
.kca-chat-list::-webkit-scrollbar-track {
  background: transparent;
}

.kca-scroll::-webkit-scrollbar-thumb,
.kca-chat-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
}

.kca-scroll::-webkit-scrollbar-thumb:hover,
.kca-chat-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Sidebar: feine Tiefen-Trennung & aktiver Smaragd-Akzent */
.kca-sidebar {
  background: linear-gradient(180deg, #16181a 0%, #131517 100%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.045);
}

.kca-new-row {
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.02);
  transition: background 160ms ease, border-color 160ms ease, transform 140ms ease;
}

.kca-new-row:hover {
  background: #1e2024;
  border-color: rgba(38, 208, 124, 0.28);
  transform: translateY(-1px);
}

.kca-chat-item {
  position: relative;
  transition: background 140ms ease, transform 140ms ease;
}

.kca-chat-item.is-active {
  background: linear-gradient(90deg, rgba(38, 208, 124, 0.1) 0%, #23262a 24%, #202327 100%);
  box-shadow: inset 2.5px 0 0 var(--emerald);
}

/* Topbar: sanfter Frost-Effekt beim Scrollen */
.kca-topbar {
  background: rgba(12, 13, 14, 0.84);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

/* Starter-Karten (Empty State): mehr Tiefe & eleganter Hover */
.kca-starter {
  background: linear-gradient(180deg, #181a1d 0%, #141618 100%);
  border: 1px solid rgba(255, 255, 255, 0.075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 6px 18px rgba(0, 0, 0, 0.24);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.kca-starter:hover {
  background: linear-gradient(180deg, #1e2125 0%, #181b1e 100%);
  border-color: rgba(38, 208, 124, 0.42);
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 26px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(38, 208, 124, 0.12);
}

/* Nachrichten: sanftes Einblenden & veredelte User-Bubble */
@keyframes kca-msg-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kca-msg {
  animation: kca-msg-enter 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.kca-msg-user .kca-bubble {
  background: linear-gradient(180deg, #212428 0%, #1b1d21 100%);
  border: 1px solid rgba(255, 255, 255, 0.075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 4px 14px rgba(0, 0, 0, 0.22);
}

.kca-ai-avatar {
  background: linear-gradient(180deg, #1b1d20 0%, #141618 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* Composer: schwebendes Soft-Obsidian-Panel mit feinem Fokus-Glow */
.kca-composer-box,
.kca-input-shell,
.kca-composer {
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.kca-composer-box:focus-within,
.kca-input-shell:focus-within {
  border-color: rgba(38, 208, 124, 0.55) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 32px rgba(0, 0, 0, 0.42), 0 0 0 3px rgba(38, 208, 124, 0.12) !important;
}

/* Popover-Menüs (Modell & + Kontext): edles Glas-Grau */
.kca-model-popover,
.kca-context-popover {
  background: rgba(27, 29, 32, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 36px rgba(0, 0, 0, 0.52);
}

/* Code-Blöcke: klarere Kontur & dezente Tiefe */
.kca-code-block,
.kca-code-card {
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  border-radius: 13px;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .kca-msg {
    animation: none !important;
  }
}
