[x-cloak] { display: none !important; }

/* ============ Tokens ============ */
:root {
  --bg: #FBFAF8;
  --bg-elev: #FFFFFF;
  --bg-sunken: #F3F1ED;
  --ink: #2D2D2D;
  --ink-2: #5A5A5A;
  --ink-3: #8A8784;
  --line: rgba(45,45,45,0.10);
  --line-strong: rgba(45,45,45,0.18);
  --red: #B40F1B;
  --red-hover: #9A0D17;
  --red-soft: #FF6659;
  --red-tint: rgba(180,15,27,0.08);
  --sidebar-bg: #1C1C1C;
  --sidebar-ink: #EDEAE4;
  --sidebar-ink-2: #8C8984;
  --sidebar-line: rgba(255,255,255,0.08);
  --assistant-bubble: #FFFFFF;
  --user-bubble: #2D2D2D;
  --user-bubble-ink: #FBFAF8;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.06);
  --shadow-lg: 0 32px 80px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414;
    --bg-elev: #1C1C1C;
    --bg-sunken: #0E0E0E;
    --ink: #EDEAE4;
    --ink-2: #A8A5A0;
    --ink-3: #6B6865;
    --line: rgba(255,255,255,0.08);
    --line-strong: rgba(255,255,255,0.14);
    --red: #FF4B5B;
    --red-hover: #FF6B79;
    --red-soft: #FF6659;
    --red-tint: rgba(255,75,91,0.12);
    --sidebar-bg: #0A0A0A;
    --sidebar-ink: #EDEAE4;
    --sidebar-ink-2: #7A7874;
    --sidebar-line: rgba(255,255,255,0.06);
    --assistant-bubble: #1C1C1C;
    --user-bubble: #EDEAE4;
    --user-bubble-ink: #141414;
    --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
    --shadow-lg: 0 32px 80px rgba(0,0,0,0.5);
  }
}

/* ============ Reset ============ */
*, *::before, *::after { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv11";
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
h1,h2,h3,h4,h5,p { margin: 0; }

/* ============ Logo ============ */
.logo-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.logo-mark svg { flex-shrink: 0; }
.logo-mark .sub {
  font-weight: 500;
  color: var(--ink-2);
}

/* ============ Login ============ */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
.login-left {
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
}
.login-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink-2);
  font-size: 13px;
}
.login-topbar .crumb {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
}
.login-form-wrap {
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 0;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--red);
  border-radius: 50%;
}
.login-title {
  font-size: 48px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.login-title em {
  font-style: normal;
  color: var(--red);
}
.login-subtitle {
  font-size: 16px;
  color: var(--ink-2);
  margin-bottom: 40px;
  max-width: 36ch;
}
.field { margin-bottom: 20px; }
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.field-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  font-size: 15px;
  transition: border 0.15s, box-shadow 0.15s;
}
.field-input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 4px var(--red-tint);
}
.field-input.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}
.field-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-3);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 15px;
  transition: transform 0.1s, background 0.15s, border-color 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--red);
  color: #FFF;
  width: 100%;
}
.btn-primary:hover { background: var(--red-hover); }
.btn-primary:disabled {
  background: var(--line-strong);
  color: var(--ink-3);
  cursor: not-allowed;
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { background: var(--bg-sunken); }

.login-foot {
  color: var(--ink-3);
  font-size: 12px;
  font-family: var(--font-mono);
  display: flex;
  justify-content: space-between;
}

.login-right {
  position: relative;
  background: var(--ink);
  color: #FBFAF8;
  padding: 48px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-right::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, #FF6659 0%, #B40F1B 35%, transparent 65%);
  opacity: 0.85;
  pointer-events: none;
}
.login-right > * { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  color: #FBFAF8;
  background: rgba(0,0,0,0.2);
  backdrop-filter: blur(8px);
}
.hero-text {
  font-size: 44px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
  max-width: 14ch;
}
.hero-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.15);
}
.hero-meta .label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 4px;
}
.hero-meta .val {
  font-size: 14px;
  font-weight: 500;
}

/* ============ Disclaimer Modal ============ */
.modal-scrim {
  position: fixed;
  inset: 0;
  background: rgba(10,10,10,0.5);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fade 0.2s;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--bg-elev);
  color: var(--ink);
  border-radius: var(--radius-xl);
  max-width: 560px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: rise 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid var(--line);
}
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }
.modal-top {
  padding: 32px 32px 0;
  display: flex;
  align-items: flex-start;
  gap: 20px;
}
.modal-icon {
  width: 48px; height: 48px;
  background: var(--red-tint);
  color: var(--red);
  border-radius: var(--radius-md);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.modal-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 6px;
}
.modal h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.modal-body {
  padding: 24px 32px 0;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.6;
}
.modal-body p + p { margin-top: 12px; }
.modal-body strong { color: var(--ink); font-weight: 600; }
.modal-list {
  background: var(--bg-sunken);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-top: 16px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.modal-list-row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.modal-list-row + .modal-list-row { margin-top: 8px; }
.modal-list-row code {
  font-family: var(--font-mono);
  background: var(--bg-elev);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--ink);
  border: 1px solid var(--line);
}
.modal-actions {
  padding: 24px 32px 32px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
}
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  color: var(--ink-2);
  margin-right: auto;
}
.checkbox input { display: none; }
.checkbox .box {
  width: 18px; height: 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
  display: grid; place-items: center;
  transition: all 0.15s;
}
.checkbox input:checked + .box {
  background: var(--red);
  border-color: var(--red);
  color: #FFF;
}
.checkbox .box svg { opacity: 0; transition: opacity 0.1s; }
.checkbox input:checked + .box svg { opacity: 1; }

/* ============ Chat App Shell ============ */
.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--sidebar-line);
}
.sidebar-head {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--sidebar-line);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.sidebar-brand .brand-name {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.005em;
}
.sidebar-brand .brand-sub {
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--sidebar-ink-2);
  text-transform: uppercase;
  margin-left: auto;
  padding: 3px 6px;
  border: 1px solid var(--sidebar-line);
  border-radius: 4px;
}
.sidebar-tool-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-top: 14px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  font-size: 13px;
  color: var(--sidebar-ink);
  cursor: pointer;
  border: 1px solid var(--sidebar-line);
  transition: background 0.15s;
}
.sidebar-tool-switch:hover { background: rgba(255,255,255,0.07); }
.sidebar-tool-switch .active-dot {
  width: 7px; height: 7px;
  background: var(--red-soft);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255,102,89,0.2);
}
.sidebar-tool-switch .tool-name { flex: 1; font-weight: 500; }
.sidebar-tool-switch .tool-count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--sidebar-ink-2);
}

.new-chat-btn {
  margin: 12px 12px 0;
  padding: 11px 14px;
  background: var(--red);
  color: #FFF;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}
.new-chat-btn:hover { background: var(--red-hover); }

.sidebar-section {
  padding: 16px 12px 4px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sidebar-ink-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 20px;
}
.chat-item {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--sidebar-ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0;
  transition: background 0.12s;
  position: relative;
}
.chat-item:hover { background: rgba(255,255,255,0.04); }
.chat-item.active {
  background: rgba(255,255,255,0.08);
}
.chat-item.active::before {
  content: "";
  position: absolute;
  left: 0; top: 10px; bottom: 10px;
  width: 2px;
  background: var(--red-soft);
  border-radius: 0 2px 2px 0;
}
.chat-item .title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.chat-item .meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--sidebar-ink-2);
}

.sidebar-foot {
  padding: 12px;
  border-top: 1px solid var(--sidebar-line);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #B40F1B, #FF6659);
  color: #FFF;
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.user-info { flex: 1; line-height: 1.2; }
.user-info .name { font-weight: 600; color: var(--sidebar-ink); }
.user-info .code {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--sidebar-ink-2);
}
.icon-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: grid; place-items: center;
  color: var(--sidebar-ink-2);
  transition: background 0.12s, color 0.12s;
}
.icon-btn:hover { background: rgba(255,255,255,0.07); color: var(--sidebar-ink); }

/* Main chat area */
.chat-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  /* min-height:0 ist nötig, damit messages-wrap (flex:1 + overflow:auto)
     tatsächlich scrollt statt seine Geschwister aus dem Viewport zu drücken. */
  min-height: 0;
  background: var(--bg);
}

.chat-topbar {
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg);
  flex-shrink: 0;
  z-index: 2;
}
.chat-title-wrap { flex: 1; min-width: 0; }
.chat-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-title .badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-sunken);
  color: var(--ink-2);
  letter-spacing: 0.04em;
}
.chat-title-meta {
  font-size: 12px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.topbar-actions { display: flex; gap: 6px; }
.topbar-btn {
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.12s, color 0.12s;
  border: 1px solid transparent;
}
.topbar-btn:hover { background: var(--bg-sunken); color: var(--ink); }
.topbar-btn.primary {
  background: var(--ink);
  color: var(--bg);
}
.topbar-btn.primary:hover { background: var(--ink); opacity: 0.9; color: var(--bg); }

/* Briefing bar (regler) */
.briefing {
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
  z-index: 1;
}
.briefing-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-right: 4px;
}
.briefing-label-btn {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 4px 8px 4px 4px;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
}
.briefing-label-btn:hover {
  color: var(--ink);
  background: var(--bg-elev);
}
.briefing-label-btn:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}

/* ============ Briefing-Modal (Workshop-Intro) ============ */
.briefing-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: 20px;
}
.briefing-modal {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 520px;
  width: 100%;
  padding: 28px 28px 22px;
  max-height: 90vh;
  overflow-y: auto;
}
.briefing-modal h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.briefing-modal p {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.55;
  margin-bottom: 14px;
}
.briefing-modal-list {
  padding-left: 18px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.55;
}
.briefing-modal-list li {
  margin-bottom: 10px;
}
.briefing-modal-list li strong {
  color: var(--ink);
}
.briefing-modal-hint {
  font-size: 12.5px;
  color: var(--ink-3);
  background: var(--bg-elev);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
}
.briefing-modal-hint kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.briefing-modal-actions {
  display: flex;
  justify-content: flex-end;
}
.briefing-modal-actions .btn-primary {
  background: var(--ink);
  color: var(--bg);
  border: 0;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}
.briefing-modal-actions .btn-primary:hover {
  background: var(--red);
}
[x-cloak] { display: none !important; }
.regler {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  position: relative;
}
.regler:hover { border-color: var(--line-strong); }
.regler.open { border-color: var(--ink); background: var(--bg-elev); }
.regler .r-label {
  color: var(--ink-3);
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.regler .r-value { color: var(--ink); font-weight: 600; }
.regler .chev {
  color: var(--ink-3);
  transition: transform 0.15s;
}
.regler.open .chev { transform: rotate(180deg); }

.regler-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 240px;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 10;
  animation: rise 0.15s;
}
.regler-option {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  transition: background 0.1s;
}
.regler-option:hover { background: var(--bg-sunken); }
.regler-option.selected {
  background: var(--red-tint);
  color: var(--red);
  font-weight: 600;
}
.regler-option .opt-sub {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 400;
  margin-left: auto;
  font-family: var(--font-mono);
}
.regler-option.selected .opt-sub { color: var(--red); opacity: 0.7; }

.briefing-toggles {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
  user-select: none;
}
.toggle:hover { background: var(--bg-sunken); color: var(--ink); }
.toggle:active { background: var(--bg-elev); }
.toggle .switch {
  width: 28px; height: 16px;
  background: var(--line-strong);
  border-radius: 999px;
  position: relative;
  transition: background 0.15s;
}
.toggle .switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  background: #FFF;
  border-radius: 50%;
  transition: left 0.15s;
}
.toggle.on { color: var(--ink); }
.toggle.on .switch { background: var(--red); }
.toggle.on .switch::after { left: 14px; }

/* Messages */
.messages-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scroll-behavior: smooth;
}
.messages {
  max-width: 780px;
  margin: 0 auto;
  padding: 32px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.msg-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  animation: slidein 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slidein { from { opacity: 0; transform: translateY(6px); } }
.msg-row.user { flex-direction: row-reverse; }

.msg-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
}
.msg-avatar.bot {
  background: var(--ink);
  color: var(--bg);
}
.msg-avatar.user {
  background: linear-gradient(135deg, #B40F1B, #FF6659);
  color: #FFF;
}

.msg-body { min-width: 0; max-width: calc(100% - 46px); }

.msg-meta {
  font-size: 11px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.msg-row.user .msg-meta { justify-content: flex-end; }

.bubble {
  background: var(--assistant-bubble);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.bubble.user {
  background: var(--user-bubble);
  color: var(--user-bubble-ink);
  border-color: transparent;
}
.bubble p + p { margin-top: 10px; }
.bubble strong { font-weight: 600; }

.highlight {
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255,214,0,0.18);
  cursor: help;
  border-bottom: 1px dashed rgba(180,15,27,0.4);
  transition: background 0.15s;
}
.highlight.audit { background: rgba(255,102,89,0.12); border-bottom-color: #FF6659; }
.highlight.labeling { background: rgba(102,180,255,0.12); border-bottom-color: #6BAEFF; }
.highlight.cialdini { background: rgba(110,205,140,0.14); border-bottom-color: #6ECD8C; }
.highlight.question { background: rgba(245,180,70,0.14); border-bottom-color: #F5B446; }
.highlight.no-cta { background: rgba(180,110,255,0.14); border-bottom-color: #B46EFF; }

.msg-toolbar {
  margin-top: 10px;
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}
.tool-btn {
  padding: 6px 10px;
  font-size: 12px;
  color: var(--ink-2);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.12s, color 0.12s;
}
.tool-btn:hover { background: var(--bg-sunken); color: var(--ink); }
.tool-btn.active { background: var(--red-tint); color: var(--red); }
.tool-btn.divider {
  margin: 0 4px;
  width: 1px; height: 14px;
  background: var(--line);
  padding: 0;
  pointer-events: none;
}

/* Quick actions */
.quick-actions {
  margin-top: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.quick-action {
  padding: 6px 11px;
  font-size: 12px;
  border-radius: 999px;
  background: var(--bg-sunken);
  color: var(--ink-2);
  border: 1px solid transparent;
  transition: all 0.12s;
  font-weight: 500;
}
.quick-action:hover {
  background: var(--bg-elev);
  color: var(--ink);
  border-color: var(--line-strong);
}

/* Explain panel */
.explain {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-sunken);
  overflow: hidden;
}
.explain-head {
  padding: 10px 14px;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.explain-head .chev { margin-left: auto; transition: transform 0.15s; color: var(--ink-3); }
.explain.open .chev { transform: rotate(90deg); }
.explain-body {
  padding: 0 14px 14px;
  display: grid;
  gap: 8px;
}
.hebel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-elev);
  border-radius: 8px;
  border-left: 3px solid;
  font-size: 13px;
  line-height: 1.5;
}
.hebel.audit { border-color: #FF6659; }
.hebel.labeling { border-color: #6BAEFF; }
.hebel.cialdini { border-color: #6ECD8C; }
.hebel.question { border-color: #F5B446; }
.hebel.no-cta { border-color: #B46EFF; }
.hebel-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 2px;
  white-space: nowrap;
}
.hebel-text { color: var(--ink); }
.hebel-text em { color: var(--ink-2); font-style: italic; }

/* Typing indicator */
.typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 6px 0;
}
.typing span {
  width: 6px; height: 6px;
  background: var(--ink-3);
  border-radius: 50%;
  animation: bounce 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* DSGVO warning */
.dsgvo-warn {
  margin-bottom: 12px;
  padding: 12px 14px;
  background: rgba(255,102,89,0.08);
  border: 1px solid rgba(255,102,89,0.25);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--ink);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.dsgvo-warn .warn-ic {
  color: var(--red);
  flex-shrink: 0;
  margin-top: 1px;
}
.dsgvo-warn strong { font-weight: 600; }
.dsgvo-warn code {
  background: var(--bg-elev);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  border: 1px solid var(--line);
}
.dsgvo-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}
.dsgvo-actions button {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--ink-2);
  transition: all 0.12s;
}
.dsgvo-actions button:hover { color: var(--ink); border-color: var(--ink); }
.dsgvo-actions button.primary {
  background: var(--red);
  color: #FFF;
  border-color: var(--red);
}

/* Composer */
.composer-wrap {
  padding: 16px 24px 20px;
  background: var(--bg);
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.composer {
  max-width: 780px;
  margin: 0 auto;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
}
.composer:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px var(--red-tint);
}
.composer-textarea {
  width: 100%;
  min-height: 54px;
  max-height: 200px;
  padding: 16px 18px 8px;
  background: transparent;
  border: 0;
  outline: 0;
  resize: none;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
}
.composer-textarea::placeholder { color: var(--ink-3); }
.composer-foot {
  padding: 8px 10px 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.composer-hint {
  font-size: 11px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  flex: 1;
}
.composer-mode-hint {
  margin: 12px 14px 0;
  padding: 10px 12px;
  background: var(--red-tint);
  color: var(--red);
  border-radius: var(--radius-md);
  font-size: 12.5px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 500;
}
.composer-hint kbd {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg-sunken);
}
.send-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  display: grid; place-items: center;
  transition: background 0.12s;
}
.send-btn:hover:not(:disabled) { background: var(--red); color: #FFF; }
.send-btn:disabled {
  background: var(--line-strong);
  color: var(--ink-3);
  cursor: not-allowed;
}
.send-btn svg,
.empty-sug > * { pointer-events: none; }

/* Empty state */
.empty {
  max-width: 620px;
  margin: 48px auto 0;
  padding: 24px;
  text-align: center;
}
.empty-ic {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: var(--red-tint);
  color: var(--red);
  display: grid; place-items: center;
}
.empty h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
}
.empty p {
  color: var(--ink-2);
  max-width: 48ch;
  margin: 0 auto;
  font-size: 14.5px;
}
.empty-suggestions {
  margin-top: 28px;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  text-align: left;
}
.empty-sug {
  padding: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
}
.empty-sug:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.empty-sug .sug-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 6px;
}
.empty-sug .sug-title {
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 3px;
}
.empty-sug .sug-sub {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.4;
}

/* ============ Tweaks panel ============ */
.tweaks {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 14px;
  width: 240px;
  z-index: 30;
  animation: rise 0.2s;
}
.tweaks-title {
  font-size: 11px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tweaks-title::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--red);
  border-radius: 50%;
}
.tweak-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
}
.tweak-row + .tweak-row { border-top: 1px solid var(--line); }
.tweak-row .tk-label { color: var(--ink); font-weight: 500; }
.tweak-seg {
  display: inline-flex;
  background: var(--bg-sunken);
  border-radius: 6px;
  padding: 2px;
}
.tweak-seg button {
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-3);
  border-radius: 4px;
  transition: all 0.12s;
}
.tweak-seg button.active {
  background: var(--bg-elev);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* Scrollbar */
.chat-list::-webkit-scrollbar, .messages-wrap::-webkit-scrollbar { width: 8px; }
.chat-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }
.messages-wrap::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.messages-wrap::-webkit-scrollbar-track { background: transparent; }
