/* Albert v2 — one design system for chat, tasks and settings. */
:root {
  --bg: #0a0c10;
  --bg-2: #0e1116;
  --panel: #12161c;
  --panel-2: #171c24;
  --panel-3: #1d232d;
  --border: #232a35;
  --border-2: #2e3644;
  --text: #e8ebf1;
  --text-2: #b9c0cc;
  --muted: #7d8696;
  --accent: #8aa6ff;
  --accent-2: #6d8bff;
  --accent-soft: rgba(138, 166, 255, 0.12);
  --spark: #2fd1c1;
  --wonder: #b892ff;
  --claude: #ff9d63;
  --planned: #ff7ab8;
  --queued: #9aa4b5;
  --running: #4ea6ff;
  --review: #f6c453;
  --done: #3fd18c;
  --failed: #ff6161;
  --cancelled: #6b7383;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --top: 60px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, rgba(109, 139, 255, 0.08), transparent 60%), var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--top);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: rgba(10, 12, 16, 0.82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -0.01em; font-size: 17px; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 15px;
  background: linear-gradient(135deg, var(--accent), #b892ff); color: #0b0d12;
}
.brand .sub { font-weight: 450; font-size: 12px; color: var(--muted); margin-left: 2px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.dot.ok { background: var(--done); box-shadow: 0 0 0 3px rgba(63, 209, 140, 0.15); }
.dot.bad { background: var(--failed); box-shadow: 0 0 0 3px rgba(255, 97, 97, 0.15); }
.nav { margin-left: auto; display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 4px; }
.nav a {
  color: var(--text-2); padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; position: relative;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav a:hover { color: var(--text); }
.nav a.active { background: var(--panel-3); color: var(--text); }
.nav a .short { display: none; }
.nav a .ext { color: var(--muted); font-size: 11px; }
.badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; font-size: 11px; font-weight: 650;
  display: inline-grid; place-items: center; background: var(--planned); color: #1a0a12;
}

/* ---------- generic ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 22px 20px 40px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.section { padding: 20px 22px; }
.section + .section { margin-top: 16px; }
.section h2 { margin: 0 0 4px; font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.section .lead { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; }
.grid { display: grid; gap: 12px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.btn {
  border: 1px solid var(--border-2); background: var(--panel-2); border-radius: 10px; padding: 8px 14px; cursor: pointer;
  font-weight: 550; font-size: 14px; transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: var(--panel-3); border-color: #3a4456; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0b0d12; }
.btn.primary:hover { background: #a3b8ff; }
.btn.good { background: rgba(63, 209, 140, 0.14); border-color: rgba(63, 209, 140, 0.45); color: #8ff0bf; }
.btn.warn { background: rgba(255, 97, 97, 0.1); border-color: rgba(255, 97, 97, 0.4); color: #ffa3a3; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.small { padding: 5px 11px; font-size: 13px; border-radius: 9px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 550; padding: 3px 9px;
  border-radius: 999px; background: var(--panel-3); color: var(--text-2); border: 1px solid var(--border-2); white-space: nowrap;
}
.chip .dot { width: 6px; height: 6px; }
.status-planned { --c: var(--planned); }
.status-queued { --c: var(--queued); }
.status-running { --c: var(--running); }
.status-review { --c: var(--review); }
.status-done { --c: var(--done); }
.status-failed { --c: var(--failed); }
.status-cancelled { --c: var(--cancelled); }
.chip.status { color: var(--c); border-color: color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent); }
.chip.status .dot { background: var(--c); }
.status-running .dot, .pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.8); } }
.exec { --x: var(--muted); }
.exec-muse-spark { --x: var(--spark); }
.exec-muse-wonder { --x: var(--wonder); }
.exec-claude-code { --x: var(--claude); }
.exec-codex { --x: var(--codex, #7fb4ff); }
.app-claude-code { --x: var(--claude); }
.app-cursor { --x: #d6dbe4; }
.app-grok-bot { --x: #ff8f6b; }
.app-muse { --x: var(--wonder); }
.mac-working { --c: var(--running); }
.mac-waiting { --c: var(--planned); }
.mac-idle { --c: var(--done); }
.mac-working .dot { animation: pulse 1.4s ease-in-out infinite; }
.tcard.mac { border-style: dashed; }
details.old-mac > summary { cursor: pointer; color: var(--muted); font-size: 12.5px; padding: 6px 2px; }
details.old-mac[open] > summary { margin-bottom: 8px; }
details.old-mac .tcard { opacity: 0.7; margin-bottom: 10px; }
.facts .add { color: var(--done); }
.facts .del { color: var(--failed); }
.chip.exec { color: var(--x); border-color: color-mix(in srgb, var(--x) 40%, transparent); background: color-mix(in srgb, var(--x) 10%, transparent); }

/* ---------- agent strip + task cards ---------- */
.strip { display: flex; gap: 12px; overflow-x: auto; padding: 14px 20px; scrollbar-width: thin; border-bottom: 1px solid var(--border); background: var(--bg-2); }
.strip:empty::before { content: "Keine laufenden Aufgaben. Sag Albert, was erledigt werden soll."; color: var(--muted); font-size: 13.5px; padding: 6px 2px; }
.tcard {
  position: relative; flex: 0 0 270px; text-align: left; cursor: pointer; overflow: hidden;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px 12px 16px;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.tcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--x); }
.tcard:hover { border-color: var(--border-2); transform: translateY(-1px); box-shadow: var(--shadow); }
.tcard .row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tcard .title { font-weight: 600; font-size: 14px; margin: 8px 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tcard .meta { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; }
.tcard .log { margin-top: 8px; font: 11.5px/1.45 var(--mono); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0.85; }
.tcard .elapsed { margin-left: auto; font-variant-numeric: tabular-nums; }
.pipe { display: flex; align-items: center; gap: 0; margin-top: 10px; }
.pipe i { width: 8px; height: 8px; border-radius: 50%; background: var(--border-2); flex: none; }
.pipe b { flex: 1; height: 2px; background: var(--border-2); }
.pipe i.on, .pipe b.on { background: var(--x); }
.pipe i.now { background: var(--x); box-shadow: 0 0 0 4px color-mix(in srgb, var(--x) 25%, transparent); animation: pulse 1.4s infinite; }
.pipe i.bad { background: var(--failed); }

/* ---------- chat: thread sidebar + conversation (like the Claude app) ---------- */
body.chat-page { --top: 0px; background: var(--bg); overflow: hidden; }
.app { display: flex; height: 100dvh; }
.side {
  width: 272px; flex: none; display: flex; flex-direction: column; min-height: 0;
  background: var(--bg-2); border-right: 1px solid var(--border); transition: margin-left 0.2s ease;
}
.app.side-hidden .side { margin-left: -272px; }
.app:not(.side-hidden) #sideShow { visibility: hidden; }
.side-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px 16px; }
.side-head .brand { font-size: 16px; gap: 9px; }
.side-head .brand .name { display: inline; }
.side-head .brand .logo { width: 26px; height: 26px; border-radius: 8px; font-size: 13px; }
.side-head .icon-btn { margin-left: auto; }
.icon-btn.ghost { width: 34px; height: 34px; border-radius: 9px; background: none; color: var(--muted); }
.icon-btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.new-chat {
  margin: 4px 10px 6px; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border-2); background: var(--panel); color: var(--text); font-weight: 550; font-size: 14px; text-align: left;
}
.new-chat:hover { background: var(--panel-2); border-color: #3a4456; }
.new-chat svg { color: var(--accent); }
.side-nav { display: flex; flex-direction: column; padding: 2px 10px 8px; border-bottom: 1px solid var(--border); }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 9px; color: var(--text-2); font-size: 14px; }
.side-nav a:hover { background: var(--panel); color: var(--text); }
.side-nav a svg { color: var(--muted); flex: none; }
.side-nav .badge { margin-left: auto; }
.side-nav a .ext { margin-left: auto; color: var(--muted); font-size: 12px; }
.side-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 10px 16px; scrollbar-width: thin; }
.side-sec h6 {
  margin: 14px 12px 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em;
  display: flex; align-items: center; gap: 6px;
}
.side-sec h6 .count { margin-left: auto; font-weight: 500; }
.side-sec h6.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.side-empty { margin: 6px 12px; color: var(--muted); font-size: 12.5px; }
.side-link { margin: 10px 4px 0; border: 0; background: none; color: var(--muted); font-size: 12.5px; cursor: pointer; padding: 4px 8px; }
.side-link:hover { color: var(--text); }
.side-foot { display: flex; align-items: center; gap: 8px; padding: 10px 18px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); color: var(--muted); font-size: 11.5px; }
.side-back { display: none; }

/* running now */
.live-row {
  width: 100%; display: flex; gap: 10px; align-items: flex-start; text-align: left; cursor: pointer;
  border: 0; background: none; padding: 7px 12px; border-radius: 9px;
}
.live-row:hover { background: var(--panel); }
.live-row > .dot { margin-top: 7px; background: var(--c); }
.live-row.status-running > .dot, .live-row.mac-working > .dot { animation: pulse 1.4s ease-in-out infinite; }
.live-row.mac-working > .dot { animation: pulse 1.4s ease-in-out infinite; }
.live-main { min-width: 0; display: flex; flex-direction: column; flex: 1; }
.live-title { font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.live-log { font-size: 11px; color: var(--text-2); opacity: 0.75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.live-log:empty { display: none; }
.status-asking { --c: var(--planned); }
/* "Braucht dich": first in the sidebar, each row with its one action right there */
.need-sec h6 { color: var(--planned); }
.need-row { display: flex; flex-wrap: wrap; align-items: center; border-radius: 10px; }
.need-row:not(.big) .need-main { flex: 1 1 100%; padding-bottom: 4px; }
.need-row:not(.big) .need-act { margin: 0 0 8px 30px; }
.need-row:hover { background: var(--panel); }
.need-main { flex: 1; min-width: 0; display: flex; gap: 10px; align-items: flex-start; text-align: left; cursor: pointer; border: 0; background: none; padding: 7px 4px 7px 12px; }
.need-main > .dot { margin-top: 7px; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.need-detail { font-size: 12px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; line-height: 1.4; }
.need-act {
  flex: none; min-height: 32px; padding: 5px 11px; border-radius: 9px; cursor: pointer; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text);
}
.need-act:hover { background: var(--panel-3); }
.need-act.primary { background: color-mix(in srgb, var(--c, var(--accent)) 18%, var(--panel)); border-color: color-mix(in srgb, var(--c, var(--accent)) 55%, transparent); color: var(--text); }
.need-act.armed { background: var(--done); border-color: var(--done); color: #06140d; }
.need-act:disabled { opacity: 0.5; cursor: default; }
details.side-fold > summary { list-style: none; cursor: pointer; border-radius: 8px; }
details.side-fold > summary::-webkit-details-marker { display: none; }
details.side-fold > summary h6::before { content: "▸"; font-size: 10px; transition: transform 0.12s; }
details.side-fold[open] > summary h6::before { transform: rotate(90deg); }
details.side-fold > summary:hover h6 { color: var(--text-2); }
.pinned { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.wa-badge { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; flex: none; background: rgba(37, 211, 102, 0.14); color: #25d366; }
.thread.wa .thread-name { color: var(--text); font-weight: 550; }
.thread-title.wa::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #25d366; margin-right: 8px; vertical-align: 1px; }
.via-wa { display: inline-flex; align-items: center; gap: 4px; color: #6fd99a; font-size: 11.5px; }
.via-wa .wa-ico { color: #25d366; }

/* thread list */
.thread { position: relative; display: flex; align-items: center; border-radius: 9px; }
.thread:hover, .thread.on { background: var(--panel); }
.thread.on { background: var(--panel-3); }
.thread-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 7px 12px; color: var(--text-2); font-size: 14px; }
.thread.on .thread-link, .thread-link:hover { color: var(--text); }
.thread.unread .thread-name { color: var(--text); font-weight: 600; }
.thread.unread .thread-link::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.thread-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmark { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.tmark.run { background: var(--running); animation: pulse 1.4s ease-in-out infinite; }
.tmark.need { background: var(--planned); box-shadow: 0 0 0 3px rgba(255, 122, 184, 0.15); }
.thread-act { border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 7px; padding: 2px 8px; margin-right: 4px; font-size: 12px; }
.thread-act.more { font-size: 16px; line-height: 1; opacity: 0; }
.thread:hover .thread-act.more, .thread.on .thread-act.more { opacity: 1; }
.thread-act:hover { color: var(--text); background: var(--panel-3); }
.thread-edit { width: 100%; margin: 2px 0; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--accent); background: var(--panel); outline: 0; font-size: 14px; }
.menu {
  position: fixed; z-index: 80; width: 170px; padding: 5px; border-radius: 12px; display: flex; flex-direction: column;
  background: var(--panel-2); border: 1px solid var(--border-2); box-shadow: var(--shadow);
}
.menu button { border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.menu button:hover { background: var(--panel-3); }

/* main column */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.main-head { height: 52px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid transparent; }
.main:not(.empty) .main-head { border-bottom-color: var(--border); }
.thread-title {
  border: 0; background: none; cursor: pointer; padding: 6px 10px; border-radius: 9px; font-size: 14.5px; font-weight: 550; color: var(--text);
  min-width: 0; max-width: 40%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto;
}
.thread-title:hover:not(:disabled) { background: var(--panel); }
.thread-title:disabled { cursor: default; color: var(--muted); }
.thread-title.wa:disabled { color: var(--text); }
.thread-tasks { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.thread-tasks::-webkit-scrollbar { display: none; }
.pill {
  flex: none; display: inline-flex; align-items: center; gap: 6px; max-width: 220px; padding: 4px 10px; border-radius: 999px; cursor: pointer;
  font-size: 12.5px; color: var(--text-2); background: color-mix(in srgb, var(--c, var(--muted)) 10%, var(--panel)); border: 1px solid color-mix(in srgb, var(--c, var(--muted)) 35%, transparent);
}
.pill .dot { width: 6px; height: 6px; background: var(--c); }
.pill.status-running .dot { animation: pulse 1.4s ease-in-out infinite; }
.pill-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill.quiet { cursor: default; background: none; border-color: var(--border); color: var(--muted); }
.main.empty .thread-title, .main.empty .thread-tasks { visibility: hidden; }

.conversation { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.conversation .inner { max-width: 740px; margin: 0 auto; padding: 28px 24px 16px; display: flex; flex-direction: column; gap: 22px; }
.msg { animation: rise 0.18s ease-out; min-width: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.msg .text { font-size: 15.5px; line-height: 1.65; word-wrap: break-word; color: var(--text); }
.msg.user { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.msg.user .via { padding-right: 8px; }
.msg.user.queued .text { opacity: 0.6; border: 1px dashed var(--border-2); }
.msg.user.queued::after { content: "kommt gleich dran"; font-size: 11.5px; color: var(--muted); padding-right: 8px; }
.msg.error .text { color: #ffb0b0; font-size: 14.5px; border-left: 3px solid var(--failed); padding-left: 12px; }
.msg.error .foot { opacity: 1; margin-left: 12px; }
.msg.user .text { white-space: pre-wrap; background: var(--panel-3); padding: 10px 16px; border-radius: 18px; max-width: min(560px, 85%); }
.msg .rich p { margin: 0 0 10px; }
.msg .rich p:last-child, .msg .rich ul:last-child { margin-bottom: 0; }
.msg .rich ul { margin: 0 0 10px; padding-left: 20px; }
.msg .rich li { margin-bottom: 4px; }
.msg .rich h5 { margin: 14px 0 6px; font-size: 15px; font-weight: 650; }
.msg .rich code { font: 13px var(--mono); background: var(--panel-3); border-radius: 5px; padding: 1px 5px; }
.msg .rich pre.code { background: #07090c; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font: 12.5px/1.55 var(--mono); overflow: auto; }
.msg.system .text { color: var(--text-2); font-size: 14.5px; }
.msg .ack { color: var(--muted); font-size: 13.5px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; } /* "Ich schau kurz in WhatsApp nach." */
.msg .ack::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.msg .ack:not([hidden]) + .typing { padding-left: 14px; }
.msg.attention .text { border-left: 3px solid var(--planned); padding-left: 12px; } /* call mode: needs Dennis */
.msg .tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.msg .tools .chip { font-weight: 500; background: none; color: var(--muted); border-color: var(--border); }
.msg .foot { margin-top: 6px; margin-left: -6px; color: var(--muted); font-size: 12px; display: flex; gap: 4px; align-items: center; min-height: 28px; }
.msg .foot span { padding: 0 4px; font-variant-numeric: tabular-nums; }
.act { border: 0; background: none; color: var(--muted); cursor: pointer; width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; padding: 0; }
.act:hover { color: var(--text); background: var(--panel-2); }
@media (hover: hover) {
  .msg .foot { opacity: 0; transition: opacity 0.15s; }
  .msg:hover .foot, .msg:last-child .foot { opacity: 1; }
}

/* a task inside the conversation, right under the message that started or reported it */
.tref {
  margin-top: 12px; width: 100%; max-width: 520px; display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  padding: 11px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--border-2); transition: border-color 0.15s, background 0.15s;
}
.tref:hover { border-color: #3a4456; background: var(--panel-2); }
.tref + .tref { margin-top: 8px; }
.tref-dot { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, transparent); }
.tref-dot .dot { background: var(--c); }
.tref-dot.status-running .dot { animation: pulse 1.4s ease-in-out infinite; }
.tref-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tref-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tref-sub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tref-log { font-size: 11.5px; color: var(--text-2); opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tref-log:empty { display: none; }
.tref-go { font-size: 12.5px; color: var(--accent); flex: none; }
.tref.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 40% { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); } }

.empty-state { margin: 0 auto; text-align: center; max-width: 520px; color: var(--muted); }
.empty-state .logo { margin: 0 auto 14px; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-weight: 700; font-size: 20px; background: linear-gradient(135deg, var(--accent), #b892ff); color: #0b0d12; }
.empty-state h1 { color: var(--text); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 8px; }
.empty-state p { margin: 0; font-size: 14.5px; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.suggest button { border: 1px solid var(--border-2); background: none; border-radius: 999px; padding: 7px 14px; cursor: pointer; color: var(--text-2); font-size: 13.5px; }
.suggest button:hover { color: var(--text); background: var(--panel); }
/* new chat: greeting and input sit together in the middle, like the Claude app */
.main.empty .conversation { flex: 0 0 auto; margin-top: auto; overflow: visible; }
.main.empty .conversation .inner { padding-bottom: 8px; }
.main.empty .composer-wrap { margin-bottom: auto; padding-bottom: 12vh; background: none; }
.typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.composer-wrap { padding: 8px 24px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 75%, transparent); }
.composer { max-width: 740px; margin: 0 auto; }
.live-transcript { min-height: 0; max-height: 30vh; overflow-y: auto; color: var(--text-2); font-size: 14.5px; padding: 0 6px 8px; }
.live-transcript.on { color: var(--text); }
.live-transcript .lvl { display: inline-block; width: 70px; height: 6px; border-radius: 3px; background: var(--panel-3); vertical-align: middle; margin-right: 10px; overflow: hidden; }
.live-transcript .lvl b { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.08s; }
.inputbar { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border-2); border-radius: 20px; padding: 10px 10px 8px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25); }
.inputbar:focus-within { border-color: #3d4a66; }
.inputbar textarea { resize: none; border: 0; outline: 0; background: none; padding: 6px 8px 8px; min-height: 28px; max-height: 200px; font-size: 15.5px; line-height: 1.5; }
.inputbar-row { display: flex; align-items: center; gap: 6px; }
.inputbar-row .hint { flex: 1; min-width: 0; padding-left: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 0; display: grid; place-items: center; cursor: pointer; background: none; color: var(--text-2); flex: none; transition: background 0.15s, color 0.15s; touch-action: none; }
.icon-btn:hover { color: var(--text); background: var(--panel-3); }
.icon-btn.send { background: var(--accent); color: #0b0d12; }
.icon-btn.send:disabled { background: var(--panel-3); color: var(--muted); }
.icon-btn.send .i-stop, .icon-btn.send.stop .i-send { display: none; }
.icon-btn.send.stop .i-stop { display: block; }
.icon-btn.send.stop { background: var(--text); color: var(--bg); }
.callbar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--done) 40%, transparent); background: color-mix(in srgb, var(--done) 10%, var(--panel)); border-radius: 12px; font-size: 13px; color: var(--text-2); }
.callbar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--done); flex: none; }
.callbar .txt { flex: 1; min-width: 0; }
.callbar button { border: 1px solid var(--border-2); background: var(--panel-3); color: var(--text); border-radius: 9px; padding: 6px 12px; min-height: 36px; cursor: pointer; font: inherit; }
.callbar button.end { background: var(--failed); border-color: var(--failed); color: #fff; }

/* ---------- call view: full screen on phones, over the conversation on the desktop ---------- */
.callview {
  position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; overflow-y: auto;
  background: radial-gradient(900px 520px at 50% 18%, color-mix(in srgb, var(--orb, var(--accent)) 10%, transparent), transparent 70%), var(--bg);
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); --lvl: 0; --orb: var(--accent);
}
.callview[data-state="hearing"] { --orb: #e8ebf1; }
.callview[data-state="thinking"] { --orb: var(--wonder); }
.callview[data-state="speaking"] { --orb: var(--done); }
.callview[data-state="waiting"] { --orb: var(--muted); }
.cv-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; color: var(--text-2); font-size: 14px; }
.cv-live { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.cv-live .dot { background: var(--done); animation: pulse 1.6s ease-in-out infinite; }
.cv-time { font-variant-numeric: tabular-nums; color: var(--muted); }
.cv-small { margin-left: auto; min-height: 40px; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--panel); color: var(--text); cursor: pointer; font-weight: 550; }
.cv-small:hover { background: var(--panel-2); }
.cv-small + .cv-small { margin-left: 0; }
.cv-stage { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 8px 24px 12px; gap: 6px; min-height: 0; }
.cv-orb {
  position: relative; width: 172px; height: 172px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: none; margin-bottom: 18px;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
.cv-halo, .cv-core { position: absolute; inset: 0; border-radius: 50%; transition: transform 0.09s linear, background 0.3s, box-shadow 0.3s; }
.cv-halo { background: color-mix(in srgb, var(--orb) 16%, transparent); transform: scale(calc(1 + var(--lvl) * 0.32)); }
.cv-core {
  inset: 18px; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--orb) 55%, #fff) 0%, var(--orb) 45%, color-mix(in srgb, var(--orb) 55%, #000) 100%);
  box-shadow: 0 0 60px color-mix(in srgb, var(--orb) 45%, transparent), inset 0 -10px 30px rgba(0, 0, 0, 0.25);
  transform: scale(calc(0.96 + var(--lvl) * 0.1));
}
.callview[data-state="thinking"] .cv-core { animation: think 1.6s ease-in-out infinite; }
.callview[data-state="speaking"] .cv-halo { animation: speak 1.3s ease-out infinite; }
.callview[data-state="waiting"] .cv-core { box-shadow: none; opacity: 0.55; }
@keyframes think { 50% { transform: scale(0.88); filter: brightness(1.25); } }
@keyframes speak { from { transform: scale(1); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.cv-state { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; }
.cv-hint { color: var(--muted); font-size: 15px; max-width: 460px; min-height: 22px; }
.cv-you { margin: 18px 0 0; font-size: 22px; line-height: 1.4; color: var(--text); max-width: 620px; min-height: 0; overflow-wrap: anywhere; }
.cv-you:empty, .cv-albert:empty { display: none; }
.cv-albert { margin: 10px 0 0; font-size: 17px; line-height: 1.5; color: var(--text-2); max-width: 620px; }
.cv-albert::before { content: "Albert: "; color: var(--done); font-weight: 600; }
.cv-controls {
  display: flex; justify-content: center; align-items: flex-start; gap: 18px; padding: 30px 20px 22px; margin-top: -16px;
  position: sticky; bottom: 0; background: linear-gradient(to bottom, transparent, var(--bg) 26px);
}
.cv-btn {
  width: 76px; display: flex; flex-direction: column; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer; color: var(--text-2); font-size: 12.5px; font-weight: 550;
  -webkit-tap-highlight-color: transparent; touch-action: none; -webkit-user-select: none; user-select: none;
}
.cv-btn svg { width: 64px; height: 64px; padding: 20px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--border-2); color: var(--text); box-sizing: border-box; }
.cv-btn:hover svg { background: var(--panel-3); }
.cv-btn:disabled { opacity: 0.4; cursor: default; }
.cv-btn .slash { display: none; }
.cv-btn.on svg { background: var(--text); color: var(--bg); }
.cv-btn.on .slash { display: inline; }
.cv-btn.end svg { width: 72px; height: 72px; background: var(--failed); border-color: var(--failed); color: #fff; padding: 22px; }
.cv-btn.end:hover svg { background: #ff4a4a; }
#cvHold svg { width: 72px; height: 72px; background: var(--accent); color: #0b0d12; border-color: var(--accent); padding: 22px; }
.callview[data-state="connecting"] { --orb: var(--muted); }
/* Albert Live (30.10.2026): "Live" = a speech-to-speech session listens; "Schläft" = no session, wake word only */
.callview[data-state="live"] { --orb: var(--accent); }
.callview[data-state="dormant"] { --orb: var(--muted); }
.callview[data-state="dormant"] .cv-core { box-shadow: none; opacity: 0.45; }
.callview.linking .cv-live .dot { background: var(--planned); }
/* trouble in the call: no server, mic, speech recognition reconnecting */
.cv-alert {
  display: flex; align-items: center; gap: 10px; margin: 0 auto 4px; padding: 9px 10px 9px 16px; max-width: min(560px, calc(100% - 32px)); border-radius: 16px;
  font-size: 14px; line-height: 1.35; color: var(--text); background: color-mix(in srgb, var(--failed) 14%, var(--panel)); border: 1px solid color-mix(in srgb, var(--failed) 40%, transparent);
}
.cv-alert .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--failed); animation: pulse 1.4s ease-in-out infinite; }
.cv-alert.soft { background: var(--panel); border-color: var(--border-2); color: var(--text-2); }
.cv-alert.soft .dot { background: var(--planned); animation: none; }
.cv-alert span:nth-child(2) { flex: 1; min-width: 0; }
.cv-alert button { flex: none; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 0; background: var(--text); color: var(--bg); font: inherit; font-weight: 600; cursor: pointer; }
.cv-alert[hidden] { display: none; }
body.in-call .netbar { display: none; } /* the call says it itself */
/* before and after a call (/call): one green button */
.cv-dial { display: none; flex-direction: column; align-items: center; gap: 14px; padding: 8px 20px calc(36px + env(safe-area-inset-bottom)); }
.callview[data-phase="ready"] .cv-dial { display: flex; }
.callview[data-phase="ready"] .cv-controls, .callview[data-phase="ready"] .cv-alert { display: none; }
.callview[data-phase="ready"] .cv-state { font-size: 30px; }
.cv-btn.start { width: auto; touch-action: manipulation; }
.cv-btn.start svg { width: 84px; height: 84px; padding: 26px; background: #30d158; border-color: #30d158; color: #fff; }
.cv-btn.start:hover svg { background: #3ae064; }
.cv-btn.start span { font-size: 14px; }
.cv-dial-note { margin: 0; min-height: 20px; color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
/* at the ear: dark screen, a touch only wakes it */
.cv-lock {
  position: fixed; inset: 0; z-index: 46; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px;
  padding: 0 20px calc(48px + env(safe-area-inset-bottom)); background: #000; color: #3a3a3c; font-size: 13px; touch-action: none; -webkit-user-select: none; user-select: none;
}
.cv-lock[hidden] { display: none; }
.cv-lock-state { color: #636366; font-size: 15px; font-weight: 500; }
.callview.locked { overflow: hidden; }
/* the call page: the call view is the page, on the desktop too */
.call-page .callview { position: fixed; z-index: 45; }

/* connection lost */
.netbar {
  position: fixed; z-index: 90; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); max-width: calc(100vw - 32px);
  display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: 999px; font-size: 13.5px;
  background: color-mix(in srgb, var(--failed) 16%, var(--panel-2)); border: 1px solid color-mix(in srgb, var(--failed) 50%, transparent); box-shadow: var(--shadow); animation: slide 0.2s ease-out;
}

@media (max-width: 900px) {
  .callview { position: fixed; z-index: 45; }
  .side { position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); transform: translateX(-100%); transition: transform 0.22s ease; box-shadow: 20px 0 50px rgba(0, 0, 0, 0.4); }
  .app.side-hidden .side { margin-left: 0; }
  .app.side-open .side { transform: none; }
  .app.side-open .side-back { display: block; position: fixed; inset: 0; z-index: 49; background: rgba(0, 0, 0, 0.5); animation: fade 0.15s; }
  #sideShow, .app:not(.side-hidden) #sideShow { visibility: visible; }
  .thread-act.more { opacity: 1; }
  .thread-title { max-width: none; flex: 1; text-align: left; padding: 6px 4px; }
  .thread-tasks { flex: 0 1 auto; max-width: 45%; }
  .pill { max-width: 150px; }
}
@media (min-width: 901px) { #newChatTop { visibility: hidden; } .app:not(.side-hidden) #newChatTop { display: none; } }
@media (max-width: 640px) {
  .main-head { padding: 0 6px; }
  .thread-tasks { gap: 4px; }
  .thread-tasks .pill { padding: 0; width: 26px; height: 26px; justify-content: center; }
  .thread-tasks .pill .dot { width: 8px; height: 8px; }
  .thread-tasks .pill-t, .thread-tasks .pill.quiet { display: none; }
  .conversation .inner { padding: 20px 16px 10px; gap: 18px; }
  .composer-wrap { padding: 6px 10px calc(10px + env(safe-area-inset-bottom)); }
  .inputbar-row .hint { visibility: hidden; }
  .msg .text { font-size: 15px; }
  .tref { max-width: none; }
  .empty-state h1 { font-size: 24px; }
  .main.empty .composer-wrap { padding-bottom: 6vh; }
  .cv-orb { width: 156px; height: 156px; margin-bottom: 12px; }
  .cv-state { font-size: 26px; }
  .cv-you { font-size: 20px; margin-top: 12px; }
  .cv-controls { gap: 10px; padding-bottom: 18px; flex-wrap: wrap; row-gap: 16px; }
  .cv-controls .cv-btn.end { flex-basis: 100%; }
}
@media (max-height: 700px) {
  .cv-orb { width: 120px; height: 120px; margin-bottom: 6px; }
  .cv-you { font-size: 18px; margin-top: 8px; }
}
/* touch screens: every target at least 44 px */
@media (pointer: coarse) {
  .icon-btn { width: 44px; height: 44px; border-radius: 12px; }
  .icon-btn.ghost { width: 44px; height: 44px; }
  .act { width: 40px; height: 40px; }
  .thread-act.more { min-width: 40px; min-height: 40px; font-size: 18px; }
  .thread-link, .live-row, .need-main { min-height: 44px; }
  .need-act { min-height: 40px; padding: 8px 14px; }
  .thread-tasks .pill { min-height: 32px; }
  .suggest button { min-height: 40px; }
}

/* ---------- tasks board ---------- */
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; align-items: start; }
.col { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; min-height: 140px; }
.col h3 { margin: 2px 4px 12px; font-size: 13px; font-weight: 650; display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2); }
.col h3 .count { color: var(--muted); font-weight: 500; }
.col .stack { display: flex; flex-direction: column; gap: 10px; }
.col .tcard { flex: none; width: 100%; }
.col .empty { color: var(--muted); font-size: 13px; padding: 10px 4px; }

/* ---------- task detail drawer + workflow ---------- */
.drawer-back { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 40; animation: fade 0.15s; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); z-index: 41; overflow-y: auto; display: flex; flex-direction: column;
  background: var(--bg-2); border-left: 1px solid var(--border); box-shadow: -20px 0 50px rgba(0, 0, 0, 0.4); animation: slide 0.2s ease-out;
}
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer header { position: sticky; top: 0; z-index: 2; background: rgba(14, 17, 22, 0.92); backdrop-filter: blur(10px); padding: 16px 22px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: flex-start; }
.drawer header h2 { margin: 0; font-size: 18px; letter-spacing: -0.01em; line-height: 1.3; }
.drawer header .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.drawer .close { margin-left: auto; }
.drawer .content { padding: 20px 22px 30px; flex: 1 0 auto; }
/* finished task: brief first, files, the rest folded */
.brief { --x: var(--accent); background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--x); border-radius: 12px; padding: 14px 16px; }
.brief .short { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text); }
.brief code, .md code, .facts code { font: 12.5px var(--mono); background: var(--panel-3); border-radius: 5px; padding: 1px 5px; color: var(--text); overflow-wrap: anywhere; }
.facts { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; line-height: 1.45; color: var(--text-2); }
.facts li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: baseline; }
.facts li b { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.03em; display: flex; gap: 6px; align-items: center; }
.facts li b::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.facts li.ok b { color: var(--done); }
.facts li.warn b { color: var(--review); }
.facts li.bad b { color: var(--failed); }
.facts li.muted b { color: var(--muted); }
.meta-line { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 12px; color: var(--muted); }
.meta-line .mono { font-family: var(--mono); font-size: 11.5px; }
.meta-line i { font-style: normal; opacity: 0.6; }
/* Steckbrief (model, effort, tier, session …) and Verlauf; gaps say "unbekannt" / "noch nicht" */
.chip.tier { font-weight: 600; }
.chip.tier-important { color: var(--review); border-color: color-mix(in srgb, var(--review) 45%, transparent); }
.chip.tier-critical { color: var(--failed); border-color: color-mix(in srgb, var(--failed) 45%, transparent); }
.chip.tier-unknown { color: var(--muted); font-weight: 500; border-style: dashed; }
.metabox { margin: 4px 0 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; font-size: 13px; }
.metabox > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.metabox dt { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.metabox dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.metabox .mono { font-family: var(--mono); font-size: 12px; }
.metabox a { color: var(--accent); text-decoration: none; }
.metabox .unknown dd { color: var(--review); font-style: italic; }
.metabox .pending dd { color: var(--muted); font-style: italic; }
.drawer section.meta { margin-top: 16px; }
.drawer section.meta h5 { margin: 0 0 8px; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.history { list-style: none; margin: 4px 0 14px; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.history li { display: grid; grid-template-columns: 92px auto 1fr; gap: 10px; align-items: baseline; color: var(--text-2); }
.history time { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.history b { font-weight: 600; color: var(--text); white-space: nowrap; }
.history span { overflow-wrap: anywhere; }
@media (max-width: 600px) { .metabox { grid-template-columns: 1fr; } .history li { grid-template-columns: 1fr; gap: 2px; } }
.files { margin-top: 16px; }
.files h5, .md h5 { margin: 0 0 8px; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
details.file { border: 1px solid var(--border); border-radius: 10px; background: var(--panel); margin-bottom: 6px; overflow: hidden; }
details.file > summary { list-style: none; cursor: pointer; display: flex; gap: 10px; align-items: center; padding: 8px 12px; font: 12.5px/1.4 var(--mono); }
details.file > summary::-webkit-details-marker { display: none; }
details.file > summary::before { content: "▸"; color: var(--muted); font-size: 11px; transition: transform 0.12s; }
details.file[open] > summary::before { transform: rotate(90deg); }
details.file .path { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
details.file .path .dir { color: var(--muted); }
details.file .num { display: flex; gap: 8px; color: var(--muted); flex: none; }
details.file .num .add { color: var(--done); }
details.file .num .del { color: var(--failed); }
.diff { margin: 0; border-top: 1px solid var(--border); background: #07090c; padding: 10px 0; max-height: 420px; overflow: auto; font: 12px/1.5 var(--mono); color: #c9d1dd; }
div.diff { padding: 10px 12px; }
pre.diff span { display: block; padding: 0 12px; white-space: pre-wrap; word-break: break-word; }
pre.diff .a { background: rgba(63, 209, 140, 0.12); color: #b8f0d2; }
pre.diff .d { background: rgba(255, 97, 97, 0.12); color: #ffc4c4; }
pre.diff .h { color: var(--accent); }
.md.out { border-top: 1px solid var(--border); padding: 10px 14px; max-height: 420px; overflow: auto; }
.folds { margin-top: 16px; border-top: 1px solid var(--border); }
details.fold { border-bottom: 1px solid var(--border); }
details.fold > summary { cursor: pointer; padding: 11px 2px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
details.fold > summary:hover { color: var(--text); }
details.fold[open] > summary { color: var(--text); }
details.fold > :not(summary) { margin-bottom: 14px; }
details.fold > p { margin: 0 0 8px; font-size: 14px; color: var(--text-2); }
.md { font-size: 14px; line-height: 1.55; color: var(--text-2); }
.md p { margin: 0 0 10px; }
.md ul { margin: 0 0 10px; padding-left: 18px; }
.md li { margin-bottom: 4px; }
.md h5 { margin-top: 14px; }
.md pre.code { background: #07090c; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font: 12px/1.5 var(--mono); overflow: auto; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 22px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: rgba(14, 17, 22, 0.95); backdrop-filter: blur(10px); }
.actions .pick { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.actions .pick select { background: var(--panel, #161b22); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; }
.flow { position: relative; display: flex; flex-direction: column; gap: 0; }
.step { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 14px; padding-bottom: 22px; }
.step::before { content: ""; position: absolute; left: 16px; top: 34px; bottom: 0; width: 2px; background: var(--border-2); }
.step:last-child::before { display: none; }
.step.done::before { background: color-mix(in srgb, var(--x) 70%, transparent); }
.node { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 2px solid var(--border-2); color: var(--muted); z-index: 1; }
.step.done .node { background: color-mix(in srgb, var(--x) 18%, var(--panel)); border-color: var(--x); color: var(--x); }
.step.now .node { border-color: var(--x); color: var(--x); box-shadow: 0 0 0 6px color-mix(in srgb, var(--x) 18%, transparent); animation: ring 1.6s ease-in-out infinite; }
@keyframes ring { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--x) 6%, transparent); } }
.step.bad .node { border-color: var(--failed); color: var(--failed); background: rgba(255, 97, 97, 0.1); }
.step.wait .node { border-color: var(--planned); color: var(--planned); }
.step h4 { margin: 6px 0 6px; font-size: 14px; font-weight: 650; display: flex; gap: 8px; align-items: center; }
.step h4 .when { color: var(--muted); font-weight: 450; font-size: 12px; }
.step .box { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; font-size: 14px; color: var(--text-2); }
.step .box p { margin: 0 0 8px; }
.step .box p:last-child { margin: 0; }
.prompt-text { white-space: pre-wrap; font-size: 13px; max-height: 180px; overflow: auto; color: var(--text-2); }
.logbox { background: #07090c; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; font: 12px/1.55 var(--mono); color: #c9d1dd; max-height: 340px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.logbox .l { opacity: 0.9; }
.logbox .l:last-child { color: #fff; }
.commits { list-style: none; margin: 0; padding: 0; font: 12.5px/1.6 var(--mono); }
.commits li::before { content: "● "; color: var(--x); }
pre.diffstat { margin: 10px 0 0; font: 12px/1.5 var(--mono); color: var(--muted); white-space: pre-wrap; }
details.more summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 8px; }

/* ---------- settings ---------- */
.settings-grid { display: grid; gap: 16px; }
.settings-grid > *, .settings-grid .grid > * { min-width: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
td.mono, td .mono { overflow-wrap: anywhere; }
.wa-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.agent-card { padding: 16px; border-radius: var(--radius); background: var(--panel-2); border: 1px solid var(--border); position: relative; overflow: hidden; }
.agent-card::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--x); }
.agent-card h3 { margin: 4px 0 2px; font-size: 16px; }
.agent-card .model { font: 12.5px var(--mono); color: var(--muted); }
.agent-card .checks { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; font-size: 13.5px; }
.agent-card .checks li { display: flex; gap: 8px; align-items: center; }
.ok-ico { color: var(--done); }
.no-ico { color: var(--failed); }
.agent-card .use { margin-top: 12px; color: var(--text-2); font-size: 13px; }
table.plain { width: 100%; border-collapse: collapse; font-size: 14px; }
table.plain th, table.plain td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.plain th { color: var(--muted); font-weight: 550; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; }
.metric { padding: 14px 16px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border); }
.metric .v { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.metric .k { color: var(--muted); font-size: 12.5px; }
.toggles { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; align-items: flex-start; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.toggle input { flex: none; width: 38px; height: 22px; appearance: none; background: var(--panel-3); border: 1px solid var(--border-2); border-radius: 999px; position: relative; cursor: pointer; transition: background 0.15s; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: transform 0.15s; }
.toggle input:checked { background: var(--accent); border-color: var(--accent); }
.toggle input:checked::after { transform: translateX(16px); background: #0b0d12; }

/* ---------- login + toasts ---------- */
.login { position: fixed; inset: 0; display: grid; place-items: center; z-index: 60; background: var(--bg); }
.login form { width: min(360px, 90vw); display: grid; gap: 12px; text-align: center; }
.login .logo { margin: 0 auto 6px; width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; font-size: 24px; font-weight: 700; background: linear-gradient(135deg, var(--accent), #b892ff); color: #0b0d12; }
.login input { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--panel); outline: 0; }
.login input:focus { border-color: var(--accent); }
.login .err { color: var(--failed); min-height: 20px; font-size: 13.5px; }
.toasts { position: fixed; top: calc(var(--top) + 12px); right: 16px; z-index: 70; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px)); }
.toast { background: var(--panel-2); border: 1px solid var(--border-2); border-left: 3px solid var(--c, var(--accent)); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); cursor: pointer; animation: slide 0.2s ease-out; font-size: 14px; }
.toast b { display: block; margin-bottom: 2px; }

@media (max-width: 640px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .brand .sub, .brand .name { display: none; }
  .nav { padding: 3px; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 6px 7px; font-size: 13px; flex: none; white-space: nowrap; }
  .nav a .ext { display: none; }
  .nav a .long { display: none; }
  .nav a .short { display: inline; }
  .page { padding: 16px 14px 32px; }
  .tcard { flex-basis: 240px; }
  .drawer header, .drawer .content, .actions { padding-left: 16px; padding-right: 16px; }
  .drawer header { padding-top: 12px; padding-bottom: 12px; }
  .drawer header h2 { font-size: 16px; }
  .drawer .content { padding-top: 14px; }
  .facts li { grid-template-columns: 1fr; gap: 2px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .section { padding: 16px; }
  /* tables become stacked rows: narrow columns would break words letter by letter */
  .table-wrap table.plain thead { display: none; }
  .table-wrap table.plain, .table-wrap table.plain tbody, .table-wrap table.plain tr, .table-wrap table.plain td { display: block; width: 100%; }
  .table-wrap table.plain tr { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .table-wrap table.plain td { padding: 2px 0; border: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* wake word "Albert": the one-time voice enrollment (the status line is in minimal.css) */
dialog.enroll { width: min(520px, calc(100vw - 32px)); border: 1px solid var(--border-2); border-radius: 16px; background: var(--panel); color: var(--text); padding: 22px; }
dialog.enroll::backdrop { background: rgba(0, 0, 0, 0.55); }
dialog.enroll h2 { margin: 0 0 6px; font-size: 18px; }
.enroll-why { margin: 0 0 14px; color: var(--text-2); font-size: 13.5px; line-height: 1.45; }
.enroll-steps { margin: 0 0 14px; padding-left: 22px; display: grid; gap: 8px; font-size: 15px; }
.enroll-steps li { color: var(--muted); }
.enroll-steps li.now { color: var(--text); font-weight: 600; }
.enroll-steps li.ok { color: var(--done); }
.enroll-now { display: flex; align-items: center; gap: 10px; min-height: 24px; color: var(--text-2); font-size: 13.5px; margin-bottom: 16px; }
.enroll-now .lvl { width: 80px; height: 6px; border-radius: 3px; background: var(--panel-3); overflow: hidden; flex: none; }
.enroll-now .lvl b { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.08s; }
.enroll-btns { display: flex; justify-content: flex-end; gap: 10px; }
.enroll-btns button { border: 1px solid var(--border-2); background: var(--panel-3); color: var(--text); border-radius: 10px; padding: 8px 16px; min-height: 40px; cursor: pointer; font: inherit; }
.enroll-btns button.primary { background: var(--accent); border-color: var(--accent); color: #0b0d12; }
.enroll-btns button:disabled { opacity: 0.5; cursor: default; }

/* the speech model running right now in the call view (chat.js renderModel): one line, the whole chain as its tooltip */
.cv-model { font-size: 11.5px; line-height: 1.4; color: var(--muted); text-align: center; margin: 6px auto 0; max-width: min(34em, 100%); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-model[data-active="1"] { color: var(--text-2); }
.cv-model[data-active="1"]::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--orb-em, #34d399); vertical-align: 1px; }

/* Logo: the Artillica metal flame (01.11.2026) instead of the "A" on a gradient; the letter stays for screen readers. */
.brand .logo, .empty-state .logo, .login .logo { background: #060606 url(/icons/logo-128.png) center / cover no-repeat; color: transparent; overflow: hidden; }
