@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}


:root {
  --bg0: #050506; --bg1: #0a0a0b; --bg2: #131316; --bg3: #1c1c21; --bg4: #26262d;
  --fg0: #ffffff; --fg1: #e8e8ed; --fg2: #8b8b96; --fg3: #55555e;
  --accent: #6c5ce7; --accent-2: #a29bfe;
  --autopilot-akzent: var(--accent-2);
  --ok: #00b894; --warn: #fdcb6e; --err: #e17055; --info: #74b9ff;
  --warn-fg: #1c1c21;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;
  --radius: 12px; --radius-sm: 8px;
  --shadow-1: 0 1px 3px rgba(0,0,0,0.3); --shadow-2: 0 4px 16px rgba(0,0,0,0.4); --shadow-3: 0 8px 32px rgba(0,0,0,0.5);
  --text-xs: 13px; --text-sm: 14px; --text-base: 16px; --text-lg: 20px; --text-xl: 24px;
  --dur-fast: 120ms; --dur-base: 180ms;

  --bg: var(--bg1); --fg: var(--fg1);
  --accent2: var(--accent-2);
  --green: var(--ok); --red: var(--err); --yellow: var(--warn); --blue: var(--info);
  --accent-dim: rgba(108,92,231,0.12);
  --accent-gradient: linear-gradient(135deg, #6c5ce7, #8b7cf7);
  --gap: var(--space-4);
  --transition: var(--dur-base) ease;
  --glass-bg: rgba(19,19,22,0.8);
  --glass-border: rgba(255,255,255,0.06);
  --shadow-sm: var(--shadow-1); --shadow-md: var(--shadow-2); --shadow-lg: var(--shadow-3);
}
[data-theme="light"] {
  --bg0: #ececf2; --bg1: #f4f4f8; --bg2: #ffffff; --bg3: #eaeaef; --bg4: #dddde3;
  --fg0: #000000; --fg1: #18181b; --fg2: #6b6b76; --fg3: #9b9ba6;
  --shadow-1: 0 1px 3px rgba(0,0,0,0.08); --shadow-2: 0 4px 16px rgba(0,0,0,0.1); --shadow-3: 0 8px 32px rgba(0,0,0,0.12);
  --accent-dim: rgba(108,92,231,0.08);
  --autopilot-akzent: var(--accent);
  --glass-bg: rgba(255,255,255,0.9);
  --glass-border: rgba(0,0,0,0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--fg);
  height: 100vh; height: 100dvh; display: flex; overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
.lucide { vertical-align: middle; flex-shrink: 0; }

.page { animation: pageIn 0.25s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.skeleton {
  position: relative; overflow: hidden;
  background: var(--bg3);
  border-radius: var(--radius-sm);
}
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 25%, var(--bg4) 50%, transparent 75%);
  transform: translateX(-100%);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.status-dot.online {
  background: var(--green);
  box-shadow: 0 0 8px var(--green), 0 0 14px rgba(0,184,148,0.25);
  animation: pulse 2s ease-in-out 3;
}
.status-dot.offline { background: var(--red); }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.sidebar {
  width: 240px; background: var(--bg2);
  border-right: 1px solid var(--glass-border);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.sidebar-header {
  padding: 16px; border-bottom: 1px solid var(--glass-border);
}
.sidebar-header h1 {
  font-size: 1.05em; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.sidebar-header .status {
  font-size: 0.72em; color: var(--fg2); margin-top: 6px;
  display: flex; align-items: center; gap: 5px;
}
.sidebar-header .status .status-version {
  margin-left: auto; opacity: 0.7;
  font-variant-numeric: tabular-nums; letter-spacing: 0.01em;
  white-space: nowrap;
}
.nav { flex: 1; padding: 8px; overflow-y: auto; }
.nav-section {
  font-size: 0.62em; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--fg3); padding: 14px 10px 4px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none; transition: color var(--dur-fast) ease;
}
.nav-section:hover { color: var(--fg2); }
.nav-section.active { color: var(--accent-2); }
.nav-section-chevron { transition: transform var(--dur-fast) ease; opacity: 0.7; }
.nav-section.collapsed .nav-section-chevron { transform: rotate(-90deg); }
.nav-section-items {
  overflow: hidden; max-height: 800px;
  transition: max-height var(--dur-base) ease;
}
.nav-section-items.collapsed { max-height: 0; }
@media (prefers-reduced-motion: reduce) {
  .nav-section-chevron, .nav-section-items { transition: none; }
}
.nav-item {
  padding: 7px 12px; border-radius: var(--radius-sm); cursor: pointer;
  display: flex; align-items: center; gap: 10px; color: var(--fg2);
  transition: all var(--transition); font-size: 0.84em; user-select: none;
  font-weight: 450; position: relative;
}
.nav-item:hover { background: var(--bg3); color: var(--fg); }
.nav-item.active {
  background: var(--accent-gradient); color: white;
  box-shadow: 0 2px 8px rgba(108,92,231,0.3);
}
.nav-item .lucide { opacity: 0.7; }
.nav-item.active .lucide { opacity: 1; }

.sidebar-footer {
  padding: 10px; border-top: 1px solid var(--glass-border);
  display: flex; gap: 6px;
}
.sidebar-footer button {
  flex: 1; background: var(--bg3); border: none; color: var(--fg2);
  padding: 7px 4px; border-radius: 6px; cursor: pointer;
  font-size: 0.72em; transition: all var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 4px;
  font-family: inherit; font-weight: 500;
}
.sidebar-footer button:hover { background: var(--bg4); color: var(--fg); }
.sidebar-footer .lang-toggle {
  font-weight: 600; letter-spacing: 0.02em;
}
.sidebar-footer .lang-toggle .lang-active { color: var(--accent2); }
.sidebar-footer .logout-btn { flex: 0 0 auto; padding: 7px 9px; opacity: 0.85; }
.sidebar-footer .logout-btn:hover { opacity: 1; }
html.nav-umschaltet .sidebar, html.nav-umschaltet .sidebar * { transition: none !important; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }

.topbar {
  padding: 10px 20px; border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg2); gap: 12px; flex-shrink: 0;
}
.topbar-mitte { flex: 1; min-width: 0; overflow: hidden; display: flex; justify-content: center; }
.topbar h2 {
  font-size: 0.92em; font-weight: 550; white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
}
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-kbd {
  font-size: 0.65em; color: var(--fg3); background: var(--bg3);
  padding: 2px 6px; border-radius: 4px; font-family: inherit;
  border: 1px solid var(--glass-border); cursor: pointer;
  transition: all var(--transition);
}
.topbar-kbd:hover { color: var(--fg2); border-color: var(--accent); }
.topbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
#page-title { min-width: 0; overflow: hidden; }
.page-title-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cron-pill {
  background: var(--warn); color: var(--warn-fg); border: none; border-radius: 999px;
  padding: 2px 10px; font: inherit; font-size: 0.72em; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.cron-pill .cron-pill-kurz { display: none; }
.cron-pill.grau { background: var(--bg3); color: var(--fg1); cursor: default; }
.cron-pill.puls { animation: cron-pill-puls 0.9s ease-in-out 3; }
@keyframes cron-pill-puls { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.72; transform: scale(1.06); } }
.cron-ticker { font-size: 0.78em; color: var(--fg2); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cron-ticker.einfahren { animation: cron-ticker-ein 0.6s ease-out 1; }
@keyframes cron-ticker-ein { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
.topbar-btn {
  width: 28px; height: 28px; flex-shrink: 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; border-radius: 6px;
  color: var(--fg2); cursor: pointer; font-family: inherit;
}
.topbar-btn:hover { background: var(--bg3); color: var(--fg); }
.topbar-btn:focus-visible { outline: none; border-color: var(--accent); }

.badge {
  font-size: 0.7em; padding: 3px 10px; border-radius: 20px;
  background: var(--bg3); color: var(--fg2); white-space: nowrap;
  font-weight: 500;
}
.badge-green { background: rgba(0,184,148,0.12); color: var(--green); }
.badge-yellow { background: rgba(253,203,110,0.12); color: var(--yellow); }
.badge-red { background: rgba(225,112,85,0.12); color: var(--red); }
.badge-blue { background: rgba(116,185,255,0.12); color: var(--info); }
.badge-accent { background: var(--accent-dim); color: var(--accent2); }

.cron-filter { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.cron-filter-zeile { display: flex; flex-wrap: wrap; gap: 8px; }
.cron-filter-zeile .input { width: auto; flex: 1 1 150px; min-width: 0; padding: 8px 10px; }
.cron-filter-zeile .cron-suche { flex: 2 1 220px; }
.cron-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cron-chip {
  background: var(--bg3); border: 1px solid var(--glass-border); color: var(--fg2);
  border-radius: 20px; padding: 4px 12px; font: inherit; font-size: 0.78em; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: all var(--transition);
}
.cron-chip:hover { border-color: var(--accent); color: var(--fg); }
.cron-chip.aktiv { border-color: var(--accent); color: var(--fg); background: var(--accent-dim); }
.cron-chip .zahl { color: var(--fg3); font-variant-numeric: tabular-nums; }
.cron-chip.aktiv .zahl { color: var(--fg2); }
.cron-auswahl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.82em; color: var(--fg2); }
.cron-auswahl label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.cron-auswahl-zahl { color: var(--fg3); margin-right: 4px; }
.cron-auswahl .btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.cron-wahl { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.card.cron-gewaehlt { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }

.user-last-msg { font-size: 0.82em; color: var(--fg3); margin-top: 6px; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 500px; }
.user-session-info { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; font-size: 0.78em; color: var(--fg2); align-items: center; }
.user-session-info span { white-space: nowrap; }

.page { display: none; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; }
.page.active { display: flex; }
.content { flex: 1; overflow-y: auto; padding: var(--gap); min-height: 0; }

.chat-container { flex-direction: column; height: 100%; min-height: 0; overflow: hidden; }
.chat-header {
  padding: 8px 16px; background: var(--bg2);
  border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center; gap: 8px;
  font-size: 0.8em; flex-shrink: 0;
}
.chat-header select {
  background: var(--bg3); border: 1px solid var(--glass-border);
  color: var(--fg); border-radius: 6px; padding: 4px 8px;
  font-size: 0.9em; cursor: pointer; font-family: inherit;
}
.chat-header label { color: var(--fg2); font-size: 0.88em; font-weight: 500; }
.chat-kopf-gruppe { display: contents; }
.chat-header-trenner { width: 1px; height: 18px; background: var(--glass-border); margin: 0 4px; flex-shrink: 0; }
#chat-neue-session:disabled { opacity: 0.45; cursor: progress; }

.messages {
  flex: 1; overflow-y: auto; padding: var(--gap);
  display: flex; flex-direction: column; gap: 8px; min-height: 0;
}
.msg {
  max-width: 75%; padding: 10px 14px; border-radius: var(--radius);
  line-height: 1.55; word-break: break-word; font-size: 0.88em;
  position: relative; animation: fadeIn 0.22s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.lane-messages.lane-neuaufbau .msg { animation: none; }
.msg .time { font-size: 0.65em; color: var(--fg3); margin-top: 4px; display: block; padding-right: 64px; }
#messages .msg .time { padding-right: 132px; }
.msg.user {
  align-self: flex-end; background: var(--accent-gradient); color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(108,92,231,0.2);
}
.msg.user .time { color: rgba(255,255,255,0.5); }
.msg.assistant { align-self: flex-start; background: var(--bg3); border-bottom-left-radius: 4px; }
.msg.assistant strong { color: var(--accent2); }
.msg.assistant code { background: rgba(0,0,0,0.25); padding: 1px 5px; border-radius: 4px; font-size: 0.85em; font-family: 'SF Mono', Monaco, monospace; }
.msg.assistant pre { background: rgba(0,0,0,0.3); padding: 10px; border-radius: 6px; overflow-x: auto; margin: 6px 0; font-size: 0.85em; }
.msg.assistant pre code { background: none; padding: 0; }
.msg.assistant .md-h { display: block; margin: 8px 0 2px; color: var(--fg); }
.msg.assistant .md-h1, .msg.assistant .md-h2 { font-size: 1.08em; }
.msg.assistant .md-quote { border-left: 3px solid var(--accent2); margin: 4px 0; padding: 2px 10px; color: var(--fg2); }
.msg.assistant .md-hr { border: 0; border-top: 1px solid var(--glass-border); margin: 8px 0; }
.msg.assistant .md-table { border-collapse: collapse; margin: 6px 0; font-size: 0.9em; display: block; overflow-x: auto; max-width: 100%; }
.msg.assistant .md-table th, .msg.assistant .md-table td { border: 1px solid var(--glass-border); padding: 3px 8px; text-align: left; vertical-align: top; }
.msg.assistant .md-table th { background: rgba(0,0,0,0.2); font-weight: 600; }
.msg.assistant .md-table td strong { color: var(--accent2); }
.msg.assistant a { color: var(--accent2); text-decoration: underline; }
.msg.system { align-self: center; background: transparent; color: var(--fg2); font-size: 0.78em; font-style: italic; padding: 4px; white-space: pre-wrap; }
.lane-col .msg.system { max-width: 92%; position: relative; padding-left: 20px; }
.lane-col .msg.system::before {
  content: '!';
  position: absolute; left: 2px; top: 4px;
  width: 12px; height: 12px; box-sizing: border-box;
  border: 1px solid var(--err); border-radius: 50%;
  color: var(--err); font-style: normal; font-weight: 700;
  font-size: 9px; line-height: 10px; text-align: center;
}
.msg.agent-note {
  align-self: center; max-width: 92%; background: var(--bg3); color: var(--fg2);
  border-left: 3px solid var(--accent); font-size: 0.8em; white-space: pre-wrap;
}
.msg.pro-prompt {
  align-self: center; max-width: 92%; background: var(--bg3); color: var(--fg2);
  border-left: 3px solid var(--fg3); font-size: 0.8em; white-space: pre-wrap;
}
.msg.tool { align-self: flex-start; background: var(--bg2); border-left: 3px solid var(--yellow); font-family: monospace; font-size: 0.8em; max-width: 90%; }

.tool-group { align-self: flex-start; background: var(--bg2); border-left: 3px solid var(--yellow); border-radius: var(--radius-sm); max-width: 85%; padding: 0; overflow: hidden; font-size: 0.82em; }
.tool-group-header { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; user-select: none; transition: background var(--transition); }
.tool-group-header:hover { background: var(--bg3); }
.tool-group-icon { display: flex; align-items: center; }
.tool-group-label { font-weight: 500; color: var(--fg); white-space: nowrap; }
.tool-group-names { color: var(--fg2); font-family: 'SF Mono', Monaco, monospace; font-size: 0.85em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.tool-group-chevron { color: var(--fg3); transition: transform 0.2s ease; display: flex; }
.tool-group.expanded .tool-group-chevron { transform: rotate(90deg); }
.tool-group-details { display: none; border-top: 1px solid var(--bg3); }
.tool-group.expanded .tool-group-details { display: block; }
.tool-group-item { padding: 6px 12px; border-bottom: 1px solid var(--bg3); }
.tool-group-item:last-child { border-bottom: none; }
.tool-item-name { font-family: 'SF Mono', Monaco, monospace; color: var(--accent2); font-size: 0.85em; font-weight: 500; }
.tool-item-input { background: rgba(0,0,0,0.2); padding: 6px 8px; border-radius: 4px; margin-top: 4px; font-size: 0.8em; color: var(--fg2); overflow-x: auto; max-height: 200px; overflow-y: auto; white-space: pre-wrap; word-break: break-all; }

.typing-indicator { align-self: flex-start; padding: 12px 16px; background: var(--bg3); border-radius: var(--radius); border-bottom-left-radius: 4px; display: none; }
.typing-indicator.visible { display: flex; gap: 4px; align-items: center; }
.typing-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--fg2); animation: typingBounce 1.4s infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-6px); opacity: 1; } }

.input-area {
  padding: 12px var(--gap); border-top: 1px solid var(--glass-border);
  background: var(--bg2); display: flex; gap: 8px; align-items: flex-end;
  flex-shrink: 0; position: relative; z-index: 10;
}
.input-area textarea {
  flex: 1; background: var(--bg3); border: 1px solid transparent;
  border-radius: var(--radius-sm); padding: 10px 14px; color: var(--fg);
  font: inherit; font-size: 0.9em; resize: none; outline: none;
  min-height: 42px; max-height: 140px; transition: border var(--transition);
}
.input-area textarea:focus { border-color: var(--accent); }
.input-area .btn-send {
  background: var(--accent-gradient); color: white; border: none;
  border-radius: var(--radius-sm); padding: 10px 18px; cursor: pointer;
  font-weight: 550; font-size: 0.9em; transition: all var(--transition);
  white-space: nowrap; font-family: inherit;
  box-shadow: 0 2px 8px rgba(108,92,231,0.25);
  display: flex; align-items: center; gap: 6px;
}
.input-area .btn-send:hover { opacity: 0.9; box-shadow: 0 4px 12px rgba(108,92,231,0.35); }
.input-area .btn-send:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; }

.messages.drag-over {
  outline: 2px dashed var(--accent2); outline-offset: -4px;
  background: rgba(108,92,231,0.05);
}
.messages.drag-over::after {
  content: attr(data-drop-text);
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1em; color: var(--accent2);
  background: rgba(10,10,11,0.85); border-radius: var(--radius);
  pointer-events: none; z-index: 20;
}

.msg .msg-reply-btn {
  display: none; position: absolute; bottom: 4px; right: 4px;
  background: var(--bg3); border: none; color: var(--fg2);
  border-radius: 4px; padding: 2px 6px; cursor: pointer;
  font-size: 0.75em; opacity: 0.7; transition: opacity 0.15s;
}
.msg:hover .msg-reply-btn { display: flex; align-items: center; gap: 2px; }
.msg .msg-reply-btn:hover { opacity: 1; background: var(--accent); color: white; }
.msg .msg-iterate-btn {
  display: none; position: absolute; bottom: 4px; right: 130px;
  background: var(--bg3); border: none; color: var(--fg2);
  border-radius: 4px; padding: 2px 6px; cursor: pointer;
  font-size: 0.75em; opacity: 0.7; transition: opacity 0.15s;
}
.msg:hover .msg-iterate-btn { display: flex; align-items: center; gap: 2px; }
.msg .msg-iterate-btn:hover { opacity: 1; background: var(--accent); color: white; }
.msg.assistant .msg-vorlesen-btn {
  display: none; position: absolute; top: 6px; left: 6px;
  width: 22px; height: 22px; border-radius: 50%; border: none;
  background: var(--bg2); color: var(--fg2); cursor: pointer;
  font-size: 0.7em; line-height: 22px; text-align: center; padding: 0;
  opacity: 0.7; transition: opacity 0.15s;
}
.msg.assistant:hover .msg-vorlesen-btn,
.msg.assistant .msg-vorlesen-btn.spielt,
.msg.assistant .msg-vorlesen-btn.laedt { display: block; }
.msg.assistant .msg-vorlesen-btn:hover { opacity: 1; background: var(--accent); color: white; }
.msg.assistant .msg-vorlesen-btn.spielt { opacity: 1; background: var(--accent); color: white; }
.msg.assistant .msg-vorlesen-btn.laedt { opacity: 0.9; cursor: progress; }
@media (hover: none) { .msg.assistant .msg-vorlesen-btn { display: block; opacity: 0.45; } }
.msg.assistant.hat-vorlesen .msg-text { display: block; padding-left: 28px; }
.msg.assistant.hat-vorlesen .msg-text > *:first-child { margin-top: 0; }
.chat-aeltere { display: block; margin: 4px auto 12px; opacity: 0.8; }
.msg .reply-quote { font-size: 0.8em; color: var(--fg2); border-left: 2px solid var(--accent2); padding-left: 8px; margin-bottom: 6px; opacity: 0.8; max-height: 40px; overflow: hidden; text-overflow: ellipsis; }
.msg .file-badge { font-size: 0.78em; background: var(--bg3); padding: 3px 8px; border-radius: 4px; margin-bottom: 4px; display: inline-flex; align-items: center; gap: 4px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--gap); }
.card {
  background: var(--glass-bg); border-radius: var(--radius);
  padding: 20px; border: 1px solid var(--glass-border);
  transition: border var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: rgba(108,92,231,0.2); box-shadow: var(--shadow-sm); }
.card h3 { font-size: 0.72em; color: var(--fg2); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.card .value { font-size: 1.6em; font-weight: 650; }
.card .sub { color: var(--fg2); font-size: 0.78em; margin-top: 4px; }

.link-preview {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 8px; padding: 10px 12px;
  background: var(--bg3); border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  max-width: 100%; text-decoration: none;
}
.link-preview img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.link-preview-text { min-width: 0; }
.link-preview-titel { font-size: 0.85em; font-weight: 600; color: var(--fg1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-preview-domain { font-size: 0.7em; color: var(--fg3); margin-top: 2px; }
.link-preview-beschreibung { font-size: 0.75em; color: var(--fg2); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.8em; color: var(--fg2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea, .input {
  width: 100%; background: var(--bg3); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); padding: 10px 12px; color: var(--fg);
  font: inherit; font-size: 0.9em; outline: none; transition: border var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus, .input:focus { border-color: var(--accent); }

.btn {
  background: var(--accent-gradient); color: white; border: none;
  border-radius: var(--radius-sm); padding: 8px 16px; cursor: pointer;
  font-size: 0.85em; font-weight: 550; transition: all var(--transition);
  font-family: inherit; display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { opacity: 0.88; box-shadow: 0 2px 8px rgba(108,92,231,0.25); }
.btn-sm { padding: 5px 12px; font-size: 0.78em; }
.btn-outline {
  background: transparent; border: 1px solid var(--glass-border); color: var(--fg2);
  box-shadow: none;
}
.btn-outline:hover { border-color: var(--accent); color: var(--fg); box-shadow: none; }
.btn-danger { background: var(--red); }
.btn-danger:hover { box-shadow: 0 2px 8px rgba(225,112,85,0.3); }
.btn-success { background: var(--green); }

.list-item {
  padding: 12px 16px; border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center; gap: 12px;
  transition: background var(--transition);
}
.list-item:hover { background: var(--bg3); }
.list-item:last-child { border-bottom: none; }
.list-item .icon { font-size: 1.2em; width: 28px; text-align: center; display: flex; align-items: center; justify-content: center; }
.list-item .info { flex: 1; min-width: 0; }
.list-item .info .name { font-weight: 500; font-size: 0.9em; }
.list-item .info .desc { font-size: 0.78em; color: var(--fg2); margin-top: 2px; }

.file-item {
  padding: 10px 16px; border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  font-size: 0.88em; transition: background var(--transition);
}
.file-item:hover { background: var(--bg3); }
.file-item .file-icon { width: 22px; text-align: center; display: flex; align-items: center; justify-content: center; }
.file-item .file-name { flex: 1; }
.file-item .file-meta { color: var(--fg2); font-size: 0.75em; }

.editor {
  width: 100%; min-height: 350px; background: var(--bg3);
  border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  padding: 14px; color: var(--fg); font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 0.82em; resize: vertical; outline: none;
  line-height: 1.5; transition: border var(--transition);
}
.editor:focus { border-color: var(--accent); }
.editor-toolbar {
  display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center;
}
.editor-toolbar select {
  background: var(--bg3); color: var(--fg); border: 1px solid var(--glass-border);
  border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: 0.82em; font-family: inherit;
}

.terminal-output {
  background: var(--bg2); border-radius: var(--radius-sm); padding: 16px;
  font-family: 'SF Mono', Monaco, monospace; font-size: 0.82em;
  min-height: 300px; max-height: 60vh; overflow-y: auto;
  white-space: pre-wrap; color: var(--green); line-height: 1.5;
  border: 1px solid var(--glass-border);
}
.term-cmd { color: var(--accent2); }
.term-err { color: var(--red); }

.toast {
  position: fixed; bottom: 20px; right: 20px;
  max-width: calc(100vw - 40px);
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); padding: 12px 20px;
  font-size: 0.85em; z-index: 10000;
  animation: slideUp 0.3s ease;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; gap: 8px;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.warn { border-left: 3px solid var(--yellow); }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

#logrot-days:disabled { opacity: 0.5; }

.setup-card { transition: border var(--transition), box-shadow var(--transition); }
.setup-card:hover { border-color: rgba(108,92,231,0.2); box-shadow: 0 2px 12px rgba(108,92,231,0.06); }
.setup-card details summary { list-style: none; }
.setup-card details summary::-webkit-details-marker { display: none; }
.setup-card details summary::before { content: ""; }
.setup-card a { text-decoration: none; color: var(--accent2); }
.setup-card a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg4); }

.drop-overlay {
  position: fixed; inset: 0;
  background: rgba(108,92,231,0.15); border: 3px dashed var(--accent);
  z-index: 999; display: none; align-items: center; justify-content: center;
  font-size: 1.5em; color: var(--accent2);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.drop-overlay.visible { display: flex; }

.cmd-palette-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 9999; display: flex; align-items: flex-start; justify-content: center;
  padding-top: min(20vh, 160px);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.15s ease;
}
.cmd-palette {
  width: 560px; max-width: 90vw; background: var(--bg2);
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: slideDown 0.2s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.cmd-palette-input {
  width: 100%; background: transparent; border: none;
  border-bottom: 1px solid var(--glass-border);
  padding: 16px 20px; color: var(--fg); font: inherit; font-size: 1em;
  outline: none;
}
.cmd-palette-input::placeholder { color: var(--fg3); }
.cmd-palette-results {
  max-height: 360px; overflow-y: auto; padding: 8px;
}
.cmd-palette-section {
  font-size: 0.68em; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--fg3); padding: 8px 12px 4px; font-weight: 600;
}
.cmd-palette-item {
  padding: 10px 14px; border-radius: var(--radius-sm); cursor: pointer;
  display: flex; align-items: center; gap: 10px; color: var(--fg2);
  font-size: 0.88em; transition: all 0.1s ease;
}
.cmd-palette-item:hover, .cmd-palette-item.selected {
  background: var(--accent-dim); color: var(--fg);
}
.cmd-palette-item .lucide { opacity: 0.6; }
.cmd-palette-item:hover .lucide, .cmd-palette-item.selected .lucide { opacity: 1; }
.cmd-palette-item kbd {
  margin-left: auto; font-size: 0.75em; color: var(--fg3);
  background: var(--bg3); padding: 2px 6px; border-radius: 4px;
  font-family: inherit;
}
.cmd-palette-empty {
  padding: 20px; text-align: center; color: var(--fg3); font-size: 0.88em;
}

.wizard-overlay {
  position: fixed; inset: 0; background: var(--bg);
  z-index: 99999; display: flex; align-items: flex-start; justify-content: center;
  padding: 20px; overflow-y: auto;
}
.wizard {
  width: 620px; max-width: 100%; margin: auto; background: var(--bg2);
  border: 1px solid var(--glass-border); border-radius: 16px;
  box-shadow: var(--shadow-lg); overflow: hidden;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.wizard-header {
  padding: 32px 32px 0; text-align: center;
}
.wizard-header h1 {
  font-size: 1.5em; font-weight: 700; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.wizard-header .wizard-subtitle { color: var(--fg2); font-size: 0.9em; }
.wizard-header .wizard-steps {
  display: flex; gap: 8px; justify-content: center; margin-top: 20px;
}
.wizard-step-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--bg4);
  transition: all 0.3s ease;
}
.wizard-step-dot.active { background: var(--accent); box-shadow: 0 0 8px var(--accent); width: 28px; border-radius: 5px; }
.wizard-step-dot.done { background: var(--green); }

.wizard-body { padding: 24px 32px; min-height: 280px; }
.wizard-body h2 { font-size: 1.1em; font-weight: 600; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.wizard-body .wizard-desc { color: var(--fg2); font-size: 0.88em; margin-bottom: 20px; }

.wizard-body .wizard-field { margin-bottom: 16px; }
.wizard-body .wizard-field label {
  display: block; font-size: 0.82em; color: var(--fg2); margin-bottom: 6px;
  font-weight: 500; text-transform: uppercase; letter-spacing: 0.03em;
}
.wizard-body .wizard-field input {
  width: 100%; background: var(--bg3); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); padding: 12px 14px; color: var(--fg);
  font: inherit; font-size: 0.9em; outline: none; transition: border 0.2s;
}
.wizard-body .wizard-field input:focus { border-color: var(--accent); }
.wizard-body .wizard-hint {
  font-size: 0.78em; color: var(--fg3); margin-top: 4px; line-height: 1.4;
}
.wizard-body .wizard-hint a { color: var(--accent2); text-decoration: none; }
.wizard-body .wizard-hint a:hover { text-decoration: underline; }
.wizard-body .wizard-hint + .btn { margin-top: 8px; }
.wizard-body .wizard-field .wizard-hint {
  font-size: 0.78em; color: var(--fg3); margin-top: 4px; line-height: 1.4;
}
.wizard-body .wizard-field .wizard-hint a { color: var(--accent2); text-decoration: none; }
.wizard-body .wizard-field .wizard-hint a:hover { text-decoration: underline; }

.wizard-body .wizard-validation {
  padding: 10px 14px; border-radius: var(--radius-sm); margin-top: 8px;
  font-size: 0.85em; animation: fadeIn 0.2s ease;
}
.wizard-body .wizard-validation.success { background: rgba(0,184,148,0.1); color: var(--green); border: 1px solid rgba(0,184,148,0.2); }
.wizard-body .wizard-validation.error { background: rgba(225,112,85,0.1); color: var(--red); border: 1px solid rgba(225,112,85,0.2); }

.wizard-provider-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px;
}
.wizard-provider-card {
  padding: 14px; border-radius: var(--radius-sm); border: 2px solid var(--glass-border);
  cursor: pointer; transition: all 0.2s ease; min-width: 0;
}
.wizard-provider-card:hover { border-color: var(--accent); background: var(--bg3); }
.wizard-provider-card.selected { border-color: var(--accent); background: var(--accent-dim); box-shadow: 0 0 12px rgba(108,92,231,0.15); }
.wizard-provider-card .provider-head {
  display: flex; flex-wrap: wrap; gap: 2px 8px;
  align-items: baseline; justify-content: space-between;
}
.wizard-provider-card .provider-name {
  font-weight: 600; font-size: 0.9em; margin-bottom: 2px;
  min-width: 0; overflow-wrap: anywhere;
}
.wizard-provider-card .provider-desc { font-size: 0.75em; color: var(--fg2); }
.wizard-provider-card .provider-badges {
  display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; margin-left: auto;
}
.wizard-provider-card .provider-badge {
  font-size: 0.6em; padding: 2px 6px; border-radius: 10px; font-weight: 600;
}
.wizard-provider-card .provider-badge.free { background: rgba(0,184,148,0.15); color: var(--green); }
.wizard-provider-card .provider-badge.recommended { background: var(--accent-dim); color: var(--accent2); }

.wizard-footer {
  padding: 16px 32px 24px; display: flex; gap: 10px; justify-content: flex-end;
}
.wizard-footer .btn { min-width: 100px; justify-content: center; }

.lanes-page { flex-direction: column; height: 100%; min-height: 0; overflow: hidden; }
.lanes-track {
  flex: 1; display: flex; gap: var(--space-4); padding: var(--space-4);
  overflow-x: auto; overflow-y: hidden; min-height: 0; align-items: stretch;
}
.lane-col {
  flex: 0 0 340px; width: 340px; display: flex; flex-direction: column;
  background: var(--bg2); border: 1px solid var(--glass-border);
  border-top: 3px solid var(--accent); border-radius: var(--radius);
  overflow: hidden; min-height: 0;
  transition: transform var(--dur-base) ease;
}
.lane-col-header {
  padding: var(--space-3) var(--space-4); flex-shrink: 0;
  border-bottom: 1px solid var(--glass-border);
  display: flex; flex-direction: column; gap: 6px;
}
.lane-col-kopf {
  display: flex; align-items: center; gap: var(--space-2); min-width: 0;
  min-height: 34px;
}
.lane-col-leiste {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  min-height: 24px;
}
.lane-col-leiste .lane-col-actions { margin-left: auto; }
.lane-col-name { font-weight: 600; font-size: 0.9em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  line-height: 18px; }
.lane-col-star { color: var(--warn); font-size: 0.9em; }
.lane-col-switch {
  background: var(--bg3); border: 1px solid var(--glass-border); color: var(--fg2);
  border-radius: var(--radius-sm); padding: 3px 7px; cursor: pointer; flex-shrink: 0;
  font-size: 0.72em; font-family: inherit; transition: all var(--dur-base) ease;
  line-height: 14px;
}
.lane-col-switch:hover { background: var(--accent-dim); color: var(--fg); border-color: var(--accent); }
.lane-col-meta { width: 100%; display: flex; align-items: center; gap: var(--space-2); font-size: 0.72em; color: var(--fg2);
  line-height: 16px; min-height: 20px; }
.lane-model {
  flex: 0 4 auto;
  min-width: 22px;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.85;

  cursor: pointer;
  display: flex;
}
.lane-model-name,
.lane-model-sub {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lane-model-name { flex: 0 0 auto; max-width: 100%; }
.lane-model-sub { flex: 0 1 auto; white-space: pre; }
.lane-cost-text { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lane-col-meta .lane-autopilot, .lane-col-meta .lane-agents { margin-right: 0; }

.lane-budget-bar { flex: 1 20 24px; height: 4px; border-radius: 2px; background: var(--bg4); overflow: hidden; min-width: 0; }
.lane-budget-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width var(--dur-base) ease; }
.lane-budget-fill.over { background: var(--err); }
@media (max-width: 480px) {
  .lane-cost-einheit { display: none; }
  .lane-col-meta { gap: 6px; }
}

.lane-lamp { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.lane-lamp.working { background: var(--ok); box-shadow: 0 0 8px var(--ok), 0 0 14px rgba(0,184,148,0.3); animation: lane-lamp-beat 1.4s ease-in-out infinite; will-change: opacity, transform; }
@keyframes lane-lamp-beat {
  0%, 100% { opacity: 1;    transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.72); }
}
.lane-lamp.waiting { background: var(--warn); box-shadow: 0 0 4px var(--warn); }
.lane-lamp.idle { background: var(--ok); }
.lane-lamp.error { background: var(--err); box-shadow: 0 0 6px var(--err); }
.lane-lamp.agents { position: relative; }
.lane-lamp.agents::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(162, 155, 254, 0.35);
  border-top-color: var(--accent-2);
  animation: lane-lamp-orbit 1.8s linear infinite;
}
@keyframes lane-lamp-orbit { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.lane-agents {
  font-size: var(--text-xs);
  color: var(--accent-2);
  white-space: nowrap;
  margin-right: var(--space-2);
}

.lane-autopilot {
  font-size: var(--text-xs);
  white-space: nowrap;
  margin-right: var(--space-2);
  padding: 1px 6px;
  border-radius: 999px;
  line-height: 14px;
  flex: 0 0 auto;
}
.lane-autopilot.running {
  color: var(--autopilot-akzent);
  border: 1px solid var(--autopilot-akzent);
  background: var(--accent-dim);
  animation: lane-autopilot-puls 2.4s ease-in-out infinite;
}
.lane-autopilot.done {
  color: var(--fg2);
  border: 1px solid var(--bg3);
  opacity: 0.75;
}
@keyframes lane-autopilot-puls { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

@media (prefers-reduced-motion: reduce) {
  .lane-autopilot.running { animation: none; }
  .lane-lamp.working { animation: none; box-shadow: 0 0 6px var(--ok); }
  .lane-lamp.agents::after { animation: none; opacity: 0.7; }
}

.lane-messages { flex: 1; overflow-y: auto; padding: var(--space-3); display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.lane-typing { align-self: flex-start; padding: 8px 12px; background: var(--bg3); border-radius: var(--radius); border-bottom-left-radius: 4px; display: none; font-size: 0.78em; color: var(--fg2); align-items: center; gap: 6px; }
.lane-typing.visible { display: flex; }
.lane-agents-hint {
  flex-shrink: 0;
  padding: 4px var(--space-3);
  font-size: var(--text-xs);
  line-height: 16px;
  color: var(--accent-2);
  background: var(--accent-dim);
  border-top: 1px solid var(--glass-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lane-input-area {
  padding: var(--space-2) var(--space-3); border-top: 1px solid var(--glass-border);
  background: var(--bg2); display: flex; gap: 6px; align-items: flex-end; flex-shrink: 0;
  position: relative;
}

.lane-col-name.is-auto-title { font-style: italic; opacity: 0.9; }

.lane-suggest {
  position: absolute; bottom: calc(100% - 1px); left: var(--space-3); right: var(--space-3);
  background: var(--bg3); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); box-shadow: 0 -6px 20px rgba(0,0,0,0.35);
  max-height: 230px; overflow-y: auto; z-index: 20; font-size: 0.82em;
}
.lane-suggest-item {
  display: flex; align-items: baseline; gap: 8px; padding: 6px 10px; cursor: pointer;
}
.lane-suggest-item:hover, .lane-suggest-item.active { background: var(--bg2); }
.lane-suggest-name {
  font-family: 'SF Mono', Monaco, monospace; color: var(--accent2); white-space: nowrap;
}
.lane-suggest-hint {
  color: var(--fg2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.lane-suggest-warn {
  color: var(--yellow); font-weight: 700; font-family: monospace;
}

.msg.command-result {
  align-self: stretch; max-width: 100%; background: var(--bg3); color: var(--fg);
  border: 1px solid var(--glass-border); border-left: 3px solid var(--accent2);
  font-size: 0.82em; white-space: pre-wrap;
}
.lane-cmd-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lane-cmd-btn {
  background: var(--bg2); border: 1px solid var(--glass-border); color: var(--fg);
  border-radius: var(--radius-sm); padding: 4px 10px; cursor: pointer;
  font: inherit; font-size: 0.95em; transition: background var(--dur-base) ease;
}
.lane-cmd-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.lane-input-area textarea {
  flex: 1; background: var(--bg3); border: 1px solid transparent;
  border-radius: var(--radius-sm); padding: 8px 10px; color: var(--fg);
  font: inherit; font-size: 0.85em; outline: none;
  resize: vertical;
  min-height: 36px; max-height: 60vh; transition: border var(--dur-base) ease;
}
.lane-input-area textarea::-webkit-resizer { border-color: transparent var(--fg3) var(--fg3) transparent; }
.lane-input-area textarea:focus { border-color: var(--accent); }
.lane-input-area button {
  background: var(--accent-gradient); color: white; border: none;
  border-radius: var(--radius-sm); padding: 8px 12px; cursor: pointer;
  font-family: inherit; display: flex; align-items: center;
  transition: opacity var(--dur-base) ease;
}
.lane-input-area button:disabled { opacity: 0.35; cursor: not-allowed; }

.lane-finish-bar { display: flex; justify-content: flex-end; padding: 6px var(--space-3) 0; }
.lane-finish-btn {
  background: none;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--fg2);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78em;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease,
              background var(--dur-fast) ease;
}
.lane-finish-btn:hover:not(:disabled) {
  color: var(--fg0);
  border-color: var(--accent);
  background: var(--bg3);
}
.lane-finish-btn:disabled { opacity: 0.75; cursor: default; }
.lane-send-error { padding: 4px 12px 0; font-size: 0.72em; color: var(--err); display: flex; align-items: center; gap: 6px; }
.lane-send-error button { background: none; border: none; color: var(--accent2); cursor: pointer; font-size: 1em; padding: 0; text-decoration: underline; font-family: inherit; }

.lanes-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--fg2); text-align: center; padding: var(--space-6);
}
.lanes-empty .lanes-empty-icon { opacity: 0.5; margin-bottom: 4px; }
.lanes-empty .lanes-empty-title { font-size: 1em; font-weight: 600; color: var(--fg); }
.lanes-empty .lanes-empty-hint { font-size: 0.85em; max-width: 340px; }
.lane-history-empty { color: var(--fg3); font-size: 0.8em; text-align: center; padding: var(--space-4) 0; font-style: italic; }
.lane-col.skeleton-col { opacity: 0.5; }

.lane-dots { display: none; justify-content: center; gap: 8px; padding: var(--space-2) 0; flex-shrink: 0; }
.lane-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--bg4); border: none;
  cursor: pointer; padding: 0; transition: all var(--dur-base) ease;
}
.lane-dot.in-view { background: var(--accent2); width: 20px; border-radius: 4px; }
.lane-dot.working { box-shadow: 0 0 8px var(--ok); animation: pulse 2s ease-in-out infinite; will-change: opacity; }
@media (prefers-reduced-motion: reduce) {
  .lane-dot.working, .status-dot.online, .lane-lamp.working, .skeleton::after, .typing-dot,
  [class*="lane-autopilot"], .cron-pill.puls, .cron-ticker.einfahren { animation: none !important; }
}

@media (max-width: 768px) {
  .sidebar { width: 56px; }
  .sidebar .nav-item span, .sidebar-header h1 span, .sidebar-header .status,
  .nav-section, .sidebar-footer span, .sidebar-footer .lang-toggle span { display: none; }
  .nav-section-items.collapsed { max-height: 800px; }
  .sidebar-footer.has-logout { display: grid; grid-template-columns: 1fr 1fr; padding: 4px 6px; gap: 3px; }
  .sidebar-footer.has-logout button { min-width: 0; padding: 3px 0; }
  .sidebar-footer.has-logout .logout-btn { padding: 3px 0; }
  .sidebar-header h1 { justify-content: center; }
  .cards { grid-template-columns: 1fr; }
  .msg { max-width: 92%; }
  .chat-header { flex-wrap: wrap; }
  .chat-header select { min-width: 0; max-width: 100%; overflow: hidden; }
  .chat-kopf-gruppe { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
  .chat-kopf-gruppe label { white-space: nowrap; }
  .chat-kopf-provider { flex: 1 1 100%; }
  #chat-model { flex: 1 1 auto; text-overflow: ellipsis; }
  #chat-input::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cmd-palette { width: 95vw; }

  .lanes-track {
    scroll-snap-type: x mandatory; padding: var(--space-3); gap: var(--space-3);
    scroll-padding-inline: var(--space-3);
  }
  .lane-col { flex: 0 0 100%; width: 100%; max-width: 100%; scroll-snap-align: start; }
  .lane-dots { display: flex; }
}

@media (min-width: 769px) {
  html.nav-schmal .sidebar { width: 56px; }
  html.nav-schmal .sidebar .nav-item span,
  html.nav-schmal .sidebar-header h1 span,
  html.nav-schmal .nav-section,
  html.nav-schmal .sidebar-footer span,
  html.nav-schmal .sidebar-footer .lang-toggle span { display: none; }
  html.nav-schmal .nav-section-items.collapsed { max-height: 800px; }
  html.nav-schmal .sidebar-header h1 { justify-content: center; }
  html.nav-schmal .sidebar-header { padding: 16px 8px; }
  html.nav-schmal .sidebar-header .status { font-size: 0; justify-content: center; }
  html.nav-schmal .sidebar-header .status .status-version { display: none; }
  html.nav-schmal .nav-item { justify-content: center; padding: 7px 0; }
  html.nav-schmal .sidebar-footer { display: grid; grid-template-columns: 1fr 1fr; padding: 8px 6px; gap: 4px; }
  html.nav-schmal .sidebar-footer button { min-width: 0; padding: 7px 0; }
}
@media (max-width: 479px) {
  .topbar-eng .page-title-text { display: none; }
  .topbar-eng .cron-pill .cron-pill-lang { display: none; }
  .topbar-eng .cron-pill .cron-pill-kurz { display: inline; }
  .topbar-eng #model-badge { max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chat-knopf-text { display: none; }
  .chat-header .btn-sm { padding: 5px 7px; }
}
@media (max-width: 768px) { #nav-umschalter { display: none; } }


.lane-col-title { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }

.lane-col-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.lane-col-key {
  font-size: 11px; color: var(--fg3); line-height: 13px;
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lane-rename-input {
  font: inherit;
  color: var(--fg1);
  background: var(--bg3);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 1px var(--space-1);
  width: 100%;
  min-width: 0;
  line-height: 14px;
}

.lane-col-stop, .lane-col-reset, .lane-col-rename, .lane-col-delete {
  background: none;
  border: none;
  color: var(--fg2);
  cursor: pointer;
  padding: 2px;
  line-height: 0;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.lane-col-reset:hover, .lane-col-rename:hover { color: var(--fg1); background: var(--bg3); }
.lane-col-delete:hover { color: var(--err); background: var(--bg3); }
.lane-col-stop:not(:disabled) { color: var(--err); }
.lane-col-stop:not(:disabled):hover { background: var(--bg3); }
@media (pointer: coarse) {
  .lane-col-stop, .lane-col-reset, .lane-col-rename, .lane-col-delete { padding: 8px; }
  .lane-col-actions { gap: 4px; }
  .lane-col-switch { padding: 7px 12px; }
  .lane-col-leiste { min-height: 32px; }
}
.lane-col-stop:disabled, .lane-col-reset:disabled, .lane-col-delete:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  background: none;
  color: var(--fg3);
}

.msg-badge {
  display: inline-block;
  margin-left: var(--space-2);
  padding: 0 var(--space-1);
  font-size: 11px;
  color: var(--accent-2);
  border: 1px solid var(--accent-2);
  border-radius: var(--radius-sm);
  opacity: 0.85;
  white-space: nowrap;
}

.lane-col.drop-target { outline: 2px dashed var(--accent-2); outline-offset: -4px; }
.lane-col.uploading { opacity: 0.85; }


.lanes-bar {
  position: relative; flex-shrink: 0;
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-4) 0;
}
.lanes-add-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg3); border: 1px solid var(--glass-border); color: var(--fg2);
  border-radius: var(--radius-sm); padding: 5px 10px; cursor: pointer;
  font-size: 0.78em; font-family: inherit; line-height: 1;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.lanes-add-btn:hover { background: var(--accent-dim); color: var(--fg1); border-color: var(--accent); }
.lanes-koerper { flex: 1; display: flex; min-height: 0; min-width: 0; }
.lanes-koerper > .lanes-track { min-width: 0; }
.lanes-liste, #lanes-zurueck { display: none; }
.lanes-ansicht .lanes-add-btn { transition: none; }
.lanes-ansicht .lanes-add-btn[aria-pressed="true"] { background: var(--accent-dim); border-color: var(--accent); }
.lanes-ansicht { display: flex; gap: 2px; flex-shrink: 0; }
@media (max-width: 768px) {
  .lanes-ansicht .lanes-add-label { display: none; }
  .lanes-ansicht .lanes-add-btn { padding: 5px 6px; }
}

.lane-popover {
  position: absolute; top: calc(100% + 6px); left: var(--space-4); z-index: 40;
  width: 260px; max-width: calc(100vw - 2 * var(--space-4));
  display: flex; flex-direction: column; gap: 6px;
  padding: var(--space-3);
  background: var(--bg2); border: 1px solid var(--glass-border);
  border-radius: var(--radius); box-shadow: var(--shadow-3);
}
.lane-form-title { font-size: 0.85em; font-weight: 600; color: var(--fg1); }
.lane-form-label { font-size: 0.72em; color: var(--fg2); margin-top: 2px; }
.lane-form-hint { font-size: 0.7em; color: var(--fg3); }
.lane-popover input, .lane-popover select {
  font: inherit; font-size: 0.8em;
  color: var(--fg1); background: var(--bg3);
  border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  padding: 5px var(--space-2); width: 100%; min-width: 0;
}
.lane-popover input:focus, .lane-popover select:focus { border-color: var(--accent); outline: none; }
.lane-form-newws, .lane-ws-new {
  background: none; border: none; color: var(--accent2); cursor: pointer;
  font-family: inherit; font-size: 0.72em; padding: 2px 0; text-align: left;
}
.lane-form-newws:hover, .lane-ws-new:hover { text-decoration: underline; }
.lane-form-error { font-size: 0.72em; color: var(--err); }
.lane-form-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 2px; }
.lane-form-actions button {
  font-family: inherit; font-size: 0.75em; cursor: pointer;
  border-radius: var(--radius-sm); padding: 4px 10px;
  border: 1px solid var(--glass-border); background: var(--bg3); color: var(--fg2);
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
}
.lane-form-actions .lane-form-submit, .lane-form-actions .lane-ws-submit {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.lane-form-actions button:disabled { opacity: 0.45; cursor: not-allowed; }

.lane-col-emoji {
  font-size: 1.1em; line-height: 1; flex-shrink: 0;
  background: none; border: none; padding: 0 1px; margin: 0;
  color: inherit; font-family: inherit; cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--dur-fast) ease;
}
.lane-col-emoji:hover:not(:disabled) { background: var(--bg3); }
.lane-col-emoji:disabled { cursor: default; }

.lane-col-header { position: relative; }
.lane-ws-menu {
  position: absolute; top: 100%; left: var(--space-4); z-index: 30;
  width: calc(100% - 2 * var(--space-4)); max-width: 400px;
  max-height: 320px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--space-2);
  background: var(--bg2); border: 1px solid var(--glass-border);
  border-radius: var(--radius); box-shadow: var(--shadow-3);
}
.lane-ws-option {
  background: none; border: none; color: var(--fg1); cursor: pointer;
  font-family: inherit; font-size: 0.78em; text-align: left;
  padding: 5px var(--space-2); border-radius: var(--radius-sm);
  white-space: normal;
}
.lane-ws-menu > * { flex-shrink: 0; }
@media (pointer: coarse) {
  .lane-ws-menu { max-height: 65vh; }
  .lane-ws-option { font-size: 0.9em; padding: 11px var(--space-3); }
}
.lane-ws-option:hover { background: var(--bg3); }
.lane-ws-option.current { color: var(--accent2); font-weight: 600; }
.lane-ws-menu .lane-ws-new { padding-top: 6px; border-top: 1px solid var(--glass-border); margin-top: 2px; }
.lane-ws-menu input {
  font: inherit; font-size: 0.78em; width: 100%; min-width: 0;
  color: var(--fg1); background: var(--bg3);
  border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  padding: 4px var(--space-2);
}
.lane-ws-menu input:focus { border-color: var(--accent); outline: none; }

.lanes-empty-btn {
  margin-top: var(--space-2);
  background: var(--accent); border: 1px solid var(--accent); color: #fff;
  border-radius: var(--radius-sm); padding: 6px 14px; cursor: pointer;
  font-family: inherit; font-size: 0.85em;
}
.lanes-empty-btn:hover { background: var(--accent-2); border-color: var(--accent-2); }

.notice-overlay {
  position: fixed; inset: 0; z-index: 10001;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  padding: 20px;
}
.notice-box {
  background: var(--bg2); border: 1px solid var(--glass-border);
  border-left: 3px solid var(--yellow, #e0a33e);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  max-width: 560px; width: 100%; padding: 20px 22px;
}
.notice-box pre {
  margin: 0 0 16px; white-space: pre-wrap; word-break: break-word;
  font-family: inherit; font-size: 0.9em; line-height: 1.55; color: var(--fg);
}
.notice-box .notice-actions { display: flex; justify-content: flex-end; gap: 8px; }

.msg { position: relative; }
.msg-reply-btn {
  position: absolute;
  bottom: 2px;
  right: 4px;
  border: none;
  background: transparent;
  color: var(--fg2);
  font-size: 0.95em;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.msg:hover .msg-reply-btn { opacity: 0.75; }
.msg-reply-btn:hover { opacity: 1; background: var(--bg3); }
@media (hover: none) {
  .msg-reply-btn { opacity: 0.5; }
}

.lane-messages .msg-iterate-btn {
  display: inline-block;
  position: absolute;
  bottom: 2px;
  right: 40px;
  border: none;
  background: transparent;
  color: var(--fg2);
  font-size: 0.95em;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.lane-messages .msg:hover .msg-iterate-btn { opacity: 0.75; }
.lane-messages .msg-iterate-btn:hover { opacity: 1; background: var(--bg3); }
@media (hover: none) {
  .lane-messages .msg-iterate-btn { opacity: 0.5; }
}

.lane-reply-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 8px 4px;
  padding: 5px 8px;
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  background: var(--bg3);
  font-size: 0.8em;
}
.lane-reply-chip-label { color: var(--accent); font-weight: 500; flex: none; }
.lane-reply-chip-text {
  color: var(--fg2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}
.lane-reply-chip-clear {
  border: none;
  background: transparent;
  color: var(--fg2);
  cursor: pointer;
  font-size: 0.95em;
  line-height: 1;
  padding: 2px 4px;
  flex: none;
}
.lane-reply-chip-clear:hover { color: var(--fg); }

.chat-cmd-buttons { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.chat-cmd-button-row { display: flex; flex-wrap: wrap; gap: 4px; }
.chat-cmd-btn {
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--fg);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.85em;
  cursor: pointer;
}
.chat-cmd-btn:hover:not(:disabled) { background: var(--bg2); border-color: var(--accent); }
.chat-cmd-btn:disabled { opacity: 0.45; cursor: default; }

.chat-suggest {
  position: absolute; bottom: calc(100% - 1px); left: var(--gap); right: var(--gap);
  background: var(--bg3); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); box-shadow: 0 -6px 20px rgba(0,0,0,0.35);
  max-height: 230px; overflow-y: auto; z-index: 20; font-size: 0.82em;
}
.chat-suggest-item {
  display: flex; align-items: baseline; gap: 8px; padding: 6px 10px; cursor: pointer;
}
.chat-suggest-item:hover, .chat-suggest-item.active { background: var(--bg2); }
.chat-suggest-name {
  font-family: 'SF Mono', Monaco, monospace; color: var(--accent2); white-space: nowrap;
}
.chat-suggest-hint {
  color: var(--fg2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.chat-suggest-warn { color: var(--yellow); font-weight: 700; font-family: monospace; }

.lane-ws-option-gone {
  opacity: 0.55;
  cursor: default;
  font-style: italic;
}

#zustellung-hinweis, #zustellung-fehl {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 2000;
  max-width: calc(100% - 32px); width: max-content; box-sizing: border-box;
  padding: 8px 14px; border-radius: var(--radius-sm); font-size: 0.85em;
}
#zustellung-hinweis { top: 8px; background: var(--warn); color: var(--warn-fg); box-shadow: 0 2px 10px rgba(0,0,0,.25); }
#zustellung-fehl { bottom: 84px; background: var(--bg3); color: var(--fg1); display: flex; gap: 10px; align-items: center; }
#zustellung-fehl button { background: none; border: none; color: inherit; cursor: pointer; font-size: 1.1em; padding: 0 2px; }
