/* Alfred · impression marketing — Black Edition, design system v2 (docs/design-system.md)
   True black canvas, two neutral surface levels, hairlines. Mandarine #EC7A2D only for
   actions, the current place and key numbers. No glass, no gradients, no glow – the
   cockpit is the one loud element. Fonts and icons are served locally (CSP: 'self' only). */

@font-face {
  font-family: "Google Sans Flex";
  src: url("/assets/fonts/google-sans-flex-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
  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: "Google Sans Flex";
  src: url("/assets/fonts/google-sans-flex-latin-ext.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
  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 {
  --black: #000;
  --bg: #000;
  --grey-1: #111113; /* surface: sidebar, panels */
  --grey-2: #18181b; /* raised: inputs, menus */
  --grey-3: #202024; /* controls */
  --grey-4: #2c2c31; /* hover, tracks */
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .14);
  --glass: var(--grey-1);
  --glass-strong: var(--grey-2);
  --text: #f5f5f4;
  --muted: #8e8e93;
  --faint: #636369;
  --orange: #ec7a2d;
  --orange-hi: #f58132;
  --orange-soft: #ec7a2d; /* text accents: the same crisp Mandarine, no peach */
  --orange-glow: transparent; /* v2: no glow outside the cockpit */
  --orange-tint: rgba(236, 122, 45, .1);
  --danger: #f0564a;
  --ok: #4cc38a;
  --info: #5ba8f5;
  --radius: 10px;
  --radius-sm: 6px;
  --sidebar: 272px;
  --sidebar-min: 76px;
  --blur: none;
  color-scheme: dark;
  font-family: "Google Sans Flex", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; color: var(--text); background: var(--black); }
body { background: var(--black); font-variant-numeric: tabular-nums; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--orange-soft); }
::selection { background: var(--orange-tint); }
.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 1.2em; margin: .3rem 0 0; font-size: .88rem; }
.hint {
  font-size: .82rem; padding: .55rem .7rem; border-radius: var(--radius-sm); margin: 0 0 .4rem;
  background: var(--orange-tint); border: 1px solid rgba(236, 122, 45, .3); color: var(--orange-soft);
}
.mobile-only { display: none !important; }

/* Glass */
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 50px -30px rgba(0, 0, 0, .8);
}

/* Icons (Lucide sprite) */
.icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.icon.big { width: 34px; height: 34px; stroke-width: 1.5; }
.icon.accent { color: var(--orange); filter: drop-shadow(0 0 12px var(--orange-glow)); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 1px solid var(--line-strong); background: var(--grey-3); border-radius: var(--radius-sm);
  padding: .55rem .9rem; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover:not(:disabled) { background: var(--grey-4); border-color: rgba(255, 255, 255, .18); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary {
  background: var(--orange); color: #140a03;
  border-color: transparent; font-weight: 600; box-shadow: 0 6px 22px -8px var(--orange-glow);
}
.btn.primary:hover:not(:disabled) { background: var(--orange-hi); }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.btn.small { font-size: .85rem; padding: .35rem .6rem; }
.btn.block { width: 100%; justify-content: flex-start; }
.btn.icon-only { padding: .55rem; }
.icon-btn {
  display: inline-flex; align-items: center; gap: .6rem; border: 0; background: transparent;
  color: var(--muted); padding: .45rem; border-radius: var(--radius-sm); cursor: pointer;
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.icon-btn.row { width: 100%; padding: .5rem .6rem; }

/* Inputs */
input, textarea, select {
  background: rgba(0, 0, 0, .35); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: .6rem .75rem; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-tint); }
select option { background: var(--grey-2); }

/* Login / invitation */
.gate { display: grid; place-items: center; min-height: 100%; padding: 16px; }
.card { border-radius: 20px; padding: 2rem; width: 100%; max-width: 390px; display: grid; gap: .6rem; }
.card h1 { margin: 0; font-size: 1.7rem; letter-spacing: -.02em; }
.card label { font-size: .85rem; color: var(--muted); margin-top: .3rem; }
.gate-logo { height: 40px; justify-self: start; margin-bottom: .6rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* App layout */
.app {
  display: grid; height: 100%; gap: 12px; padding: 12px;
  grid-template-columns: var(--sidebar) minmax(0, 1fr) minmax(0, .9fr);
}
.app.collapsed { grid-template-columns: var(--sidebar-min) minmax(0, 1fr) minmax(0, .9fr); }
.app:not([data-view="chat"]) { grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.app.collapsed:not([data-view="chat"]) { grid-template-columns: var(--sidebar-min) minmax(0, 1fr); }
.app [data-for] { display: none; }
.app[data-view="chat"] [data-for="chat"],
.app[data-view="approvals"] [data-for="approvals"],
.app[data-view="users"] [data-for="users"],
.app[data-view="costs"] [data-for="costs"],
.app[data-view="integrations"] [data-for="integrations"],
.app[data-view="agents"] [data-for="agents"],
.app[data-view="cockpit"] [data-for="cockpit"] { display: flex; }
.app[data-view="approvals"] .approvals { display: grid; }
.app[data-view="whatsapp"] #whatsapp-pane,
.app[data-view="customers"] #customers-pane { display: grid; }
/* The draft panel only appears when a SOP draft exists. */
.app[data-view="chat"]:not(.has-draft) { grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.app.collapsed[data-view="chat"]:not(.has-draft) { grid-template-columns: var(--sidebar-min) minmax(0, 1fr); }
.app[data-view="chat"]:not(.has-draft) .draft { display: none !important; }
.app[data-view="chat"]:not(.has-draft) .tabs { display: none !important; }
.pane { flex-direction: column; min-height: 0; min-width: 0; border-radius: var(--radius); }
.pane-head {
  display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; min-height: 56px;
  border-bottom: 1px solid var(--line);
}
.pane-head h2 { font-size: 1rem; margin: 0; flex: 1; font-weight: 600; letter-spacing: -.01em; }

/* Sidebar */
.sidebar {
  border-radius: var(--radius); display: flex; flex-direction: column; gap: .4rem; padding: .8rem;
  min-height: 0; overflow: hidden; transition: width .2s;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: .2rem .2rem .7rem; }
.logo { height: 28px; }
.nav { display: grid; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: .7rem; padding: .55rem .65rem; border-radius: var(--radius-sm);
  color: var(--muted); text-decoration: none; position: relative;
}
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.nav-item.active { color: var(--text); background: var(--orange-tint); }
.nav-item.active .icon { color: var(--orange); }
.nav-item.active::before {
  content: ""; position: absolute; left: -.8rem; top: 22%; bottom: 22%; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--orange); box-shadow: 0 0 12px var(--orange-glow);
}
.count {
  margin-left: auto; font-size: .72rem; min-width: 1.4rem; text-align: center; padding: .05rem .4rem;
  border-radius: 99px; background: var(--orange); color: #140a03;
}
.nav-label {
  font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint);
  padding: .9rem .65rem .3rem;
}
.chats { flex-direction: column; gap: .4rem; min-height: 0; flex: 1; margin-top: .4rem; }
/* The list must be allowed to shrink inside the sidebar, otherwise it never scrolls. */
#conversations { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.conversations { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.conversations a {
  display: block; padding: .5rem .65rem; border-radius: var(--radius-sm); color: var(--text);
  text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem;
}
.conversations a:hover { background: rgba(255, 255, 255, .04); }
.conversations a[aria-current="true"] { background: rgba(255, 255, 255, .07); }
.conversations small { display: block; color: var(--faint); font-size: .75rem; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: .6rem; display: grid; gap: 2px; }
.me { display: flex; align-items: center; gap: .6rem; padding: .3rem .4rem .5rem; }
.me-text { display: grid; min-width: 0; }
.me-text b { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { color: var(--muted); font-size: .76rem; }

/* Collapsed sidebar: icons only */
.app.collapsed .sidebar { padding: .8rem .55rem; align-items: center; }
.app.collapsed .sidebar span:not(.avatar),
.app.collapsed .sidebar .count,
.app.collapsed .conversations,
.app.collapsed .hint,
.app.collapsed .logo { display: none; }
.app.collapsed .sidebar-head { justify-content: center; }
.app.collapsed .nav-item, .app.collapsed .icon-btn.row, .app.collapsed .btn.block { justify-content: center; width: 46px; padding: .6rem; }
.app.collapsed .nav-label { display: none !important; }
.app.collapsed .me { justify-content: center; padding: .3rem 0 .5rem; }

/* Avatars */
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none; display: inline-grid; place-items: center;
  background: linear-gradient(145deg, var(--grey-4), var(--grey-2)); border: 1px solid var(--line-strong);
  color: var(--orange-soft); font-weight: 600; overflow: hidden; background-size: cover; background-position: center;
}
.avatar.small { width: 32px; height: 32px; font-size: .8rem; }
.avatar.large { width: 64px; height: 64px; font-size: 1.2rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Chat */
.chat { background: transparent; }
.messages { flex: 1; overflow-y: auto; padding: 1.2rem 1.2rem .6rem; display: flex; flex-direction: column; gap: .8rem; }
.empty { margin: auto; max-width: 440px; text-align: center; color: var(--muted); display: grid; justify-items: center; gap: .3rem; }
.empty h3 { color: var(--text); margin: .4rem 0 0; font-size: 1.25rem; }
.msg { max-width: 82%; padding: .7rem .95rem; border-radius: 16px; overflow-wrap: anywhere; }
.msg.in {
  align-self: flex-end; background: linear-gradient(180deg, rgba(236, 122, 45, .22), rgba(236, 122, 45, .13));
  border: 1px solid rgba(236, 122, 45, .28); border-bottom-right-radius: 6px;
}
.msg.out {
  align-self: flex-start; background: var(--glass-strong); border: 1px solid var(--line);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-bottom-left-radius: 6px;
}
.msg .meta { font-size: .74rem; color: var(--muted); margin-bottom: .25rem; }
.msg.failed { outline: 1px dashed var(--danger); }
.msg p { margin: .3rem 0; }
.msg .plain { white-space: pre-wrap; }
.typing { padding: 0 1.3rem .5rem; color: var(--muted); font-size: .88rem; display: flex; align-items: center; gap: .25rem; }
.typing .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); animation: pulse 1.2s infinite ease-in-out; }
.typing .dot:nth-child(2) { animation-delay: .15s; }
.typing .dot:nth-child(3) { animation-delay: .3s; margin-right: .35rem; }
@keyframes pulse { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
.composer { display: flex; gap: .5rem; padding: .6rem; margin: 0 .6rem .6rem; border-radius: var(--radius); align-items: flex-end; }
.composer textarea { flex: 1; resize: none; background: transparent; border: 0; max-height: 40vh; box-shadow: none; }
.composer textarea:focus { box-shadow: none; }
#chat-error { padding: 0 1.2rem .5rem; }
.tabs { display: none; gap: .2rem; }
.tabs button { background: transparent; border: 1px solid var(--line); border-radius: 99px; padding: .25rem .8rem; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--text); border-color: var(--orange); background: var(--orange-tint); }

/* Draft */
.draft { overflow: hidden; }
.draft-body { flex: 1; overflow-y: auto; padding: 1rem 1.3rem; }
.badge { font-size: .74rem; padding: .15rem .6rem; border-radius: 99px; background: var(--orange-tint); color: var(--orange-soft); border: 1px solid rgba(236, 122, 45, .25); }
.draft-progress { display: grid; gap: .3rem; padding: .7rem 1.3rem 0; }
.draft-progress progress { width: 100%; height: 5px; accent-color: var(--orange); border: 0; border-radius: 99px; overflow: hidden; background: var(--grey-3); }
.draft-progress progress::-webkit-progress-bar { background: var(--grey-3); }
.draft-progress progress::-webkit-progress-value { background: var(--orange); }
.draft-progress progress::-moz-progress-bar { background: var(--orange); }
.findings { list-style: none; margin: 0; padding: 0 1.3rem; display: grid; gap: .3rem; }
.findings li { font-size: .86rem; padding: .4rem .65rem; border-radius: 8px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.findings li.error { color: var(--danger); min-height: 0; margin: 0; }
.findings li.warning { color: var(--orange-soft); }
.draft-actions { display: flex; gap: .5rem; padding: .8rem 1.3rem; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* SOP picker */
.picker {
  position: absolute; inset: 60px 0 auto 0; z-index: 6; margin: 0 1rem; border-radius: var(--radius);
  max-height: 70vh; display: flex; flex-direction: column; background: var(--glass-strong);
}
.chat { position: relative; }
.picker-head { display: flex; gap: .4rem; padding: .6rem; border-bottom: 1px solid var(--line); }
.picker-head input { flex: 1; }
.picker-list { list-style: none; margin: 0; padding: .3rem; overflow-y: auto; }
.picker-list button { width: 100%; text-align: left; border: 0; background: transparent; padding: .55rem .65rem; border-radius: 8px; cursor: pointer; }
.picker-list button:hover { background: rgba(255, 255, 255, .05); }
.picker-list small { display: block; color: var(--muted); }

/* Admin cards in chat */
.change-card { border-left: 3px solid var(--orange) !important; }
.change-card.applied { border-left-color: var(--ok) !important; }
.change-card.rejected, .change-card.reverted { opacity: .7; border-left-color: var(--grey-4) !important; }
.change-title { font-weight: 600; margin-bottom: .2rem; }
.change-diff s { color: var(--muted); }
.change-actions { display: flex; gap: .4rem; margin-top: .55rem; flex-wrap: wrap; }
.change-actions button { border: 1px solid var(--line-strong); background: var(--grey-3); border-radius: 8px; padding: .35rem .7rem; cursor: pointer; }
.change-actions button.primary { background: var(--orange); color: #140a03; border-color: transparent; font-weight: 600; }
.key-box { margin-top: .5rem; padding: .55rem; border-radius: 8px; background: rgba(0, 0, 0, .35); display: grid; gap: .35rem; }
.key-box code { overflow-wrap: anywhere; user-select: all; color: var(--orange-soft); }

/* Approvals */
.approvals { grid-template-columns: 320px minmax(0, 1fr); gap: 12px; }
.approvals-list { border-radius: var(--radius); display: flex; flex-direction: column; min-height: 0; }
.approval-items { list-style: none; margin: 0; padding: .4rem; overflow-y: auto; }
.approval-items a { display: block; padding: .65rem; border-radius: var(--radius-sm); color: inherit; text-decoration: none; }
.approval-items a:hover { background: rgba(255, 255, 255, .04); }
.approval-items a[aria-current="true"] { background: var(--orange-tint); }
.approval-items small { display: block; color: var(--muted); }
.approval-detail { overflow-y: auto; padding: 1.2rem 1.5rem; min-width: 0; border-radius: var(--radius); background: var(--glass); border: 1px solid var(--line); }
.approval-detail h1 { font-size: 1.3rem; margin: .2rem 0 .8rem; letter-spacing: -.01em; }
.approval-detail textarea { width: 100%; min-height: 50vh; font: .9rem/1.5 ui-monospace, "SF Mono", Menlo, monospace; }
.approval-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; position: sticky; bottom: 0; padding: .7rem 0; background: linear-gradient(transparent, var(--grey-1) 30%); }
.approval-actions button { border: 1px solid var(--line-strong); background: var(--grey-3); border-radius: var(--radius-sm); padding: .5rem .9rem; cursor: pointer; }
.approval-actions button.primary { background: var(--orange); color: #140a03; border-color: transparent; font-weight: 600; }
.approval-actions button.danger { color: var(--danger); }
.approval-actions button.ghost { background: transparent; border-color: transparent; color: var(--muted); }

/* Admin: users */
.admin { gap: 12px; overflow-y: auto; }
.admin .pane-head { border-radius: var(--radius); background: var(--glass); border: 1px solid var(--line); }
.inline-form { display: flex; flex-wrap: wrap; gap: .5rem; padding: .8rem; border-radius: var(--radius); }
.inline-form input { flex: 1 1 180px; }
.link-box { padding: .9rem 1rem; border-radius: var(--radius); display: grid; gap: .5rem; }
.link-box code { overflow-wrap: anywhere; color: var(--orange-soft); user-select: all; }
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.user-card { border-radius: var(--radius); padding: 1rem; display: grid; gap: .8rem; }
.user-card.inactive { opacity: .55; }
.user-top { display: flex; gap: .8rem; align-items: center; }
.user-top .who { min-width: 0; display: grid; }
.user-top .who b { font-size: 1.02rem; }
.user-top .who small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar-btn { position: relative; border: 0; padding: 0; background: transparent; cursor: pointer; border-radius: 50%; }
.avatar-btn::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: rgba(0, 0, 0, .55) center / 20px no-repeat;
  opacity: 0; transition: opacity .15s;
}
.avatar-btn:hover::after { opacity: 1; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .25rem .8rem; font-size: .86rem; margin: 0; }
.facts dt { color: var(--faint); }
.facts dd { margin: 0; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; padding: .12rem .55rem; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--muted); }
.pill.owner { color: var(--orange-soft); border-color: rgba(236, 122, 45, .35); background: var(--orange-tint); }
.pill.ok { color: var(--ok); }
.pill.off { color: var(--danger); }
.user-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.user-actions .btn { font-size: .84rem; padding: .4rem .65rem; }

/* Admin: costs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.kpi { border-radius: var(--radius); padding: 1rem 1.1rem; display: grid; gap: .25rem; }
.kpi small { color: var(--muted); font-size: .8rem; }
.kpi b { font-size: 1.7rem; font-weight: 600; letter-spacing: -.02em; }
.kpi .bar { height: 5px; border-radius: 99px; background: var(--grey-3); overflow: hidden; margin-top: .3rem; }
.kpi .bar i { display: block; height: 100%; background: var(--orange); box-shadow: 0 0 10px var(--orange-glow); }
.kpi .bar i.warn { background: var(--danger); }
.chart-card { border-radius: var(--radius); padding: 1rem 1.1rem; }
.chart-card h3, .cost-table h3 { margin: 0 0 .7rem; font-size: .9rem; font-weight: 600; color: var(--muted); }
.chart svg { width: 100%; height: 190px; display: block; }
.chart .b { fill: var(--orange); opacity: .85; }
.chart .b:hover { opacity: 1; }
.chart .axis { fill: var(--faint); font-size: 10px; }
.chart .grid { stroke: var(--line); }
.cost-tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.cost-table { border-radius: var(--radius); padding: 1rem 1.1rem; }
.cost-table table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.cost-table td { padding: .35rem 0; border-bottom: 1px solid var(--line); }
.cost-table td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.cost-table td.runs { text-align: right; color: var(--faint); width: 4.5rem; }

/* Admin: integrations */
.stack-form { border-radius: var(--radius); padding: 1rem 1.1rem; display: grid; gap: .7rem; }
.stack-form label { display: grid; gap: .3rem; font-size: .84rem; color: var(--muted); }
.stack-form details { font-size: .85rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .7rem; }
.small-text { font-size: .86rem; margin: 0; }
.tool-list { display: grid; gap: 10px; }
.tool-row { border-radius: var(--radius); overflow: hidden; }
.tool-head { display: flex; align-items: center; gap: .9rem; padding: .85rem 1rem; cursor: pointer; }
.tool-head:hover { background: rgba(255, 255, 255, .03); }
.tool-logo {
  width: 40px; height: 40px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: #fff; overflow: hidden; color: #140a03; font-weight: 700;
}
.tool-logo img { width: 26px; height: 26px; object-fit: contain; }
.tool-logo.letter { background: var(--orange); }
.tool-name { display: grid; flex: 1; min-width: 0; }
.tool-name b { font-size: 1rem; }
.tool-name small { color: var(--muted); }
.tool-people { display: flex; }
.tool-people .avatar { margin-left: -8px; border: 2px solid var(--grey-1); }
.tool-body { border-top: 1px solid var(--line); padding: 1rem; display: grid; gap: 1rem; }
.tool-body h4 { margin: 0 0 .5rem; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.fn { display: flex; align-items: center; gap: .7rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.fn .txt { flex: 1; min-width: 0; display: grid; }
.fn .txt small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; position: absolute; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--grey-4); transition: background .15s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #d7d7da; transition: transform .15s; }
.switch input:checked + span { background: var(--orange); }
.switch input:checked + span::after { transform: translateX(16px); background: #fff; }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + span { opacity: .4; }
.people { display: flex; flex-wrap: wrap; gap: .5rem; }
.person-toggle { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .7rem .35rem .35rem; border-radius: 99px; border: 1px solid var(--line-strong); cursor: pointer; }
.person-toggle input { display: none; }
.person-toggle:has(input:checked) { border-color: var(--orange); background: var(--orange-tint); }

/* Suggestions in an empty chat */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: .8rem; }
.chip {
  display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .85rem; border-radius: 99px;
  border: 1px solid var(--line-strong); background: var(--glass); color: var(--text); cursor: pointer;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.chip:hover { border-color: var(--orange); background: var(--orange-tint); }
.chip .icon { width: 16px; height: 16px; color: var(--orange); }

/* WhatsApp (read-only) */
.wa-detail { display: flex; flex-direction: column; gap: .8rem; }
.wa-note { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--muted); padding: .55rem .75rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: rgba(0, 0, 0, .25); }
.wa-thread { display: flex; flex-direction: column; gap: .7rem; }
.wa-draft { border-top: 1px solid var(--line); padding-top: .8rem; }

select.tier { padding: .25rem .5rem; font-size: .8rem; border-radius: 99px; max-width: 12rem; }
select.tier.tier-read { color: var(--ok); }
select.tier.tier-destructive, select.tier.tier-send { color: var(--orange); }
select.tier.tier-payment { color: var(--danger); }
.fn.kill { border-bottom: 1px solid var(--line-strong); padding-bottom: .7rem; margin-bottom: .2rem; }
.capabilities { max-height: 420px; overflow-y: auto; padding: .2rem .9rem .6rem; border-radius: var(--radius-sm); background: rgba(0, 0, 0, .25); border: 1px solid var(--line); }

/* Rendered markdown */
.md h1, .md h2, .md h3 { line-height: 1.3; margin: 1rem 0 .4rem; letter-spacing: -.01em; }
.md h1 { font-size: 1.3rem; } .md h2 { font-size: 1.1rem; } .md h3 { font-size: 1rem; }
.md ul, .md ol { padding-left: 1.3rem; margin: .3rem 0; }
.md li::marker { color: var(--orange); }
.md code { background: rgba(255, 255, 255, .07); padding: 0 .3rem; border-radius: 5px; font-size: .88em; }
.md pre { background: rgba(0, 0, 0, .4); padding: .7rem; border-radius: 8px; overflow-x: auto; }
.md blockquote { margin: .4rem 0; padding-left: .8rem; border-left: 3px solid var(--orange); color: var(--muted); }
.md strong { color: #fff; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--grey-4) transparent; }

/* Tablet: draft becomes a tab */
@media (max-width: 1100px) {
  .app, .app.collapsed { grid-template-columns: var(--sidebar-min) minmax(0, 1fr) !important; }
  .app .sidebar { padding: .8rem .55rem; align-items: center; }
  .app .sidebar span:not(.avatar), .app .sidebar .count, .app .conversations, .app .hint, .app .logo { display: none; }
  .app .nav-item, .app .icon-btn.row, .app .btn.block { justify-content: center; width: 46px; padding: .6rem; }
  .app .nav-label { display: none !important; }
  #collapse { display: none; }
  .tabs { display: flex; }
  .app[data-view="chat"] .draft { display: none; }
  .app[data-view="chat"].show-draft .draft {
    display: flex; position: fixed; top: 80px; right: 12px; bottom: 12px; left: calc(var(--sidebar-min) + 24px); z-index: 5;
    background: var(--glass-strong);
  }
  .approvals { grid-template-columns: 260px minmax(0, 1fr); }
}
/* Phone: sidebar becomes a drawer */
@media (max-width: 700px) {
  .app, .app.collapsed { grid-template-columns: minmax(0, 1fr) !important; padding: 8px; gap: 8px; }
  .mobile-only { display: inline-flex !important; }
  .sidebar {
    position: fixed; inset: 8px auto 8px 8px; width: min(84vw, 300px); z-index: 10; align-items: stretch !important;
    padding: .8rem !important; transform: translateX(-110%); transition: transform .2s ease; background: var(--glass-strong);
  }
  .app.show-sidebar .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55); }
  .app.show-sidebar .sidebar span:not(.avatar), .app.show-sidebar .conversations, .app.show-sidebar .logo,
  .app.show-sidebar .hint, .app.show-sidebar .count { display: revert; }
  .app.show-sidebar .nav-item, .app.show-sidebar .icon-btn.row, .app.show-sidebar .btn.block { justify-content: flex-start; width: 100%; }
  .app.show-sidebar .nav-label { display: block !important; }
  .app[data-view="chat"].show-draft .draft { left: 8px; right: 8px; top: 72px; bottom: 8px; }
  .approvals { grid-template-columns: minmax(0, 1fr); }
  .approvals.detail-open .approvals-list { display: none; }
  .approvals:not(.detail-open) .approval-detail { display: none; }
  .messages { padding: 1rem .8rem .5rem; }
  .msg { max-width: 92%; }
  .user-grid { grid-template-columns: minmax(0, 1fr); }
}

/* OAuth callback page (ADR-035) */
body.oauth-done { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
body.oauth-done main { max-width: 440px; padding: 1.6rem; border-radius: var(--radius); }
body.oauth-done h1 { margin: 0 0 .6rem; font-size: 1.3rem; }

/* Agents (ADR-037) */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-top: .8rem; }
.agent-card { border-radius: var(--radius); padding: 1rem; display: grid; gap: .5rem; align-content: start; }
.agent-card.planned { opacity: .72; }
.agent-card header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.agent-card h3 { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: .45rem; }
.agent-card p { margin: 0; color: var(--muted); font-size: .88rem; }
.agent-card summary { cursor: pointer; font-size: .82rem; }
.agent-card ul { margin: .3rem 0 0; padding-left: 1.1rem; font-size: .84rem; }

/* Integration catalog (ADR-036) */
.catalog-wrap { margin-top: 1.4rem; display: grid; gap: .4rem; }
.catalog-wrap h3 { margin: 0; font-size: 1rem; }
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.catalog h4 { grid-column: 1 / -1; margin: .8rem 0 0; font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.catalog-card {
  display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--grey-2); color: inherit; text-align: left; cursor: pointer; font: inherit;
}
.catalog-card:hover { border-color: var(--orange); }
.catalog-card .txt { display: grid; min-width: 0; }
.catalog-card small { color: var(--muted); font-size: .74rem; }
.catalog-card.done small { color: var(--ok); }
.catalog-card:disabled { opacity: .5; cursor: progress; }
.catalog-card .tool-logo.letter { background: var(--grey-4); color: var(--text); }

/* Cockpit (ADR-038) */
.cockpit { overflow: hidden; background: radial-gradient(ellipse at 50% 55%, rgba(236, 122, 45, .10), transparent 60%), #08080a; }
.cockpit-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
.kpis { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; flex: 1; min-width: 0; }
.kpi { display: flex; align-items: baseline; gap: .35rem; }
.kpi b { font-size: 1.15rem; color: var(--orange); font-variant-numeric: tabular-nums; }
.kpi span { font-size: .76rem; color: var(--muted); }
.cockpit-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.cockpit-controls .sep { width: 1px; height: 20px; background: var(--line-strong); margin: 0 .2rem; }
.chip { font: inherit; font-size: .78rem; padding: .22rem .6rem; border-radius: 99px; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); cursor: pointer; }
.chip[aria-pressed="true"] { color: var(--text); border-color: var(--orange); background: var(--orange-tint); }
.cockpit-stage { position: relative; flex: 1; min-height: 0; }
#cockpit-canvas { display: block; touch-action: none; cursor: grab; }
.cockpit-tip { position: absolute; pointer-events: none; padding: .25rem .55rem; border-radius: 8px; font-size: .78rem; background: var(--glass-strong); border: 1px solid var(--line-strong); white-space: nowrap; }
.cockpit-help { position: absolute; left: 14px; bottom: 10px; margin: 0; font-size: .74rem; pointer-events: none; }
.cockpit-panel { position: absolute; top: 12px; right: 12px; bottom: 12px; width: min(340px, calc(100% - 24px)); overflow: auto; border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: .45rem; }
.cockpit-panel header { display: flex; align-items: center; gap: .5rem; }
.cockpit-panel h3 { margin: 0; font-size: 1.05rem; flex: 1; }
.cockpit-panel h4 { margin: .6rem 0 0; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.cockpit-panel p { margin: 0; font-size: .86rem; color: var(--muted); }
.cockpit-panel p b { color: var(--text); font-weight: 600; }
.cockpit-panel ul { margin: 0; padding-left: 1rem; font-size: .84rem; }
.linkish { background: none; border: 0; padding: 0; color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.linkish:hover { color: var(--orange); }
.kpis { align-content: flex-start; }
@media (max-width: 700px) {
  .cockpit-help { display: none; }
  .kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem .6rem; }
  .kpi { flex-direction: column; gap: 0; }
  .kpi b { font-size: 1rem; }
  .kpi span { font-size: .68rem; line-height: 1.2; }
  .cockpit-bar { padding: .6rem .7rem; gap: .5rem; }
}

.cockpit-panel { border-top: 2px solid var(--accent, var(--orange)); }
.cockpit-panel.wide { width: min(560px, calc(100% - 24px)); }
.sop-view { display: grid; gap: .7rem; margin-top: .4rem; }
.sop-view dl { display: grid; grid-template-columns: max-content 1fr; gap: .3rem .8rem; margin: 0; font-size: .84rem; }
.sop-view dt { color: var(--muted); }
.sop-view dd { margin: 0; }
.sop-gaps { border: 1px solid rgba(236, 122, 45, .35); border-radius: 10px; padding: .6rem .8rem; font-size: .82rem; }
.sop-gaps ul { margin: .3rem 0 0; padding-left: 1rem; }
.sop-md { font-size: .88rem; line-height: 1.55; }
.sop-md h2 { font-size: .95rem; margin: 1.1rem 0 .4rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.sop-md h3 { font-size: .88rem; margin: .8rem 0 .3rem; }

/* Customers (ADR-039) */
#customer-search { margin: .6rem .8rem .2rem; width: calc(100% - 1.6rem); }
.customer-detail { overflow: auto; display: flex; flex-direction: column; gap: .8rem; }
.customer-head { display: flex; align-items: center; gap: .6rem; }
.customer-head h2 { margin: 0; }
.identities { display: flex; flex-wrap: wrap; gap: .3rem; }
.signal { border: 1px solid var(--line-strong); border-left: 3px solid var(--muted); border-radius: 10px; padding: .7rem .9rem; display: grid; gap: .35rem; }
.signal.high { border-left-color: #ff6e5a; }
.signal.normal { border-left-color: var(--orange); }
.signal-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.signal p { margin: 0; color: var(--muted); font-size: .88rem; }
.note-form { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: end; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.timeline .activity { padding: .6rem 0 .6rem .9rem; border-left: 2px solid var(--line-strong); display: grid; gap: .15rem; }
.timeline .activity.inbound { border-left-color: #5BC0F8; }
.timeline .activity.outbound { border-left-color: var(--orange); }
.timeline .activity small { color: var(--muted); font-size: .74rem; }
.timeline .activity p { margin: 0; color: var(--muted); font-size: .86rem; white-space: pre-wrap; }
.timeline select { justify-self: start; margin-top: .3rem; }
.empty { color: var(--muted); }
.btn.small { padding: .3rem .7rem; font-size: .8rem; }


/* ==========================================================================================
   Design system v2 – component layer (overrides the first-generation styles above)
   ========================================================================================== */

:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }
h1, h2, h3 { letter-spacing: -.015em; }

/* Surfaces: flat, one hairline, no blur, no shadow */
.glass { background: var(--grey-1); border: 1px solid var(--line); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.icon.accent { filter: none; }

/* Shell: rail + content, separated by hairlines instead of floating cards */
.app { gap: 0; padding: 0; }
.sidebar { border-radius: 0; border: 0; border-right: 1px solid var(--line); background: var(--grey-1); padding: .9rem .7rem; }
.pane { border-radius: 0; }
.app .pane.glass, .app .approvals-list.glass, .app .chat.glass { background: transparent; border: 0; }
.app > .pane + .pane, .draft { border-left: 1px solid var(--line); }
.pane-head { min-height: 56px; padding: .75rem 1.25rem; }
.pane-head h2 { font-size: 1.05rem; font-weight: 600; }

/* Navigation: quiet rows, the current place marked by a Mandarine rule */
.nav-item { border-radius: var(--radius-sm); padding: .5rem .6rem; font-size: .93rem; }
.nav-item:hover { background: rgba(255, 255, 255, .04); }
.nav-item.active { background: rgba(255, 255, 255, .06); }
.nav-item.active::before { left: -.7rem; width: 2px; border-radius: 0; box-shadow: none; }
.nav-label { font-size: .78rem; letter-spacing: 0; text-transform: none; color: var(--faint); padding: 1rem .6rem .3rem; }
.count { border-radius: 5px; font-weight: 600; font-size: .7rem; padding: .05rem .35rem; }
.conversations a { border-radius: var(--radius-sm); font-size: .9rem; }

/* Controls */
.btn { border-radius: var(--radius-sm); padding: .5rem .85rem; font-size: .9rem; font-weight: 500; }
.btn.primary { box-shadow: none; }
.icon-btn { border-radius: var(--radius-sm); }
input, textarea, select { background: var(--grey-2); border-radius: var(--radius-sm); padding: .55rem .7rem; }
input:focus, textarea:focus, select:focus { box-shadow: 0 0 0 1px var(--orange); }
.pill { border: 0; border-radius: 5px; background: rgba(255, 255, 255, .06); padding: .12rem .45rem; font-size: .75rem; }
.pill.owner { background: var(--orange-tint); }
.pill.ok { background: rgba(76, 195, 138, .12); }
.pill.off { background: rgba(240, 86, 74, .12); }
.badge { border: 0; border-radius: 5px; }
.chip { border-radius: var(--radius-sm); background: var(--grey-2); -webkit-backdrop-filter: none; backdrop-filter: none; }
.chip:hover { background: var(--grey-3); border-color: var(--line-strong); }
.switch span { background: var(--grey-4); }
.avatar { background: var(--grey-3); color: var(--text); border-color: var(--line-strong); }

/* Section headings: sentence case, no tracking */
.tool-body h4, .catalog h4, .cockpit-panel h4 {
  text-transform: none; letter-spacing: 0; font-size: .85rem; font-weight: 600; color: var(--muted);
}

/* Login */
.card { border-radius: 12px; padding: 2.2rem 2rem; }
.gate { background: var(--black); }

/* Chat: flat bubbles */
.msg { border-radius: 12px; }
.msg.in { background: rgba(236, 122, 45, .14); border: 1px solid rgba(236, 122, 45, .22); }
.msg.out { background: var(--grey-1); -webkit-backdrop-filter: none; backdrop-filter: none; }
.composer { border-radius: var(--radius); margin: 0 1.25rem 1.1rem; background: var(--grey-1); }
.messages { padding: 1.4rem 1.25rem .8rem; }

/* Lists and detail views */
.approvals { gap: 0; }
.approvals-list { border-right: 1px solid var(--line); }
.approval-items { padding: .3rem .5rem; }
.approval-items a { border-radius: var(--radius-sm); }
.approval-items a[aria-current="true"] { background: rgba(255, 255, 255, .06); box-shadow: inset 2px 0 0 var(--orange); }
.approval-detail { border: 0; border-radius: 0; background: transparent; padding: 1.5rem 2rem; }
.approval-actions { background: var(--black); border-top: 1px solid var(--line); }

/* Admin pages: a readable column, content in quiet panels */
.admin { padding: 0 2rem 2rem; gap: 1rem; }
.admin .pane-head { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; margin: 0 -2rem; padding: .75rem 2rem; }
.admin > .muted, .admin > p { max-width: 72ch; }
.user-card, .tool-row, .stack-form, .chart-card, .cost-table, .agent-card, .link-box, .inline-form {
  border-radius: var(--radius); background: var(--grey-1); border: 1px solid var(--line);
}
.kpi .bar i { box-shadow: none; }
.tool-logo { border-radius: 8px; }
.tool-list { gap: 8px; }
.catalog-card { border-radius: var(--radius-sm); background: var(--grey-1); border-color: var(--line); }
.catalog-card:hover { border-color: var(--line-strong); background: var(--grey-2); }
.agent-card.planned { opacity: 1; }
.agent-card.planned h3 { color: var(--muted); }

/* Cockpit keeps its own stage; its chrome follows the system */
.cockpit-bar { padding: .75rem 1.25rem; }
.cockpit-panel { background: var(--grey-1); border: 1px solid var(--line); border-top: 2px solid var(--accent, var(--orange)); -webkit-backdrop-filter: none; backdrop-filter: none; }
.cockpit-tip { background: var(--grey-2); }

/* Customers */
.customer-detail { padding: 1.5rem 2rem; max-width: 900px; }
.signal { background: var(--grey-1); border-radius: var(--radius-sm); }
.timeline .activity { padding-left: 1rem; }

/* Mobile: the rail becomes a drawer, keep 16px gutters */
@media (max-width: 700px) {
  .app { padding: 0; gap: 0; }
  .sidebar { border-right: 0; }
  .admin { padding: 0 16px 1.5rem; }
  .admin .pane-head { margin: 0 -16px; padding: .7rem 16px; }
  .approval-detail, .customer-detail { padding: 1.1rem 16px; }
  .composer { margin: 0 12px 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* v2 refinements */
.note-form textarea, .customer-detail textarea { font: inherit; min-height: 0; height: auto; resize: vertical; }
.approval-items a { position: relative; padding-right: 2.6rem; }
.approval-items a .count { position: absolute; right: .6rem; top: .75rem; margin: 0; }
.sidebar .btn.primary.block { background: var(--grey-3); color: var(--text); font-weight: 500; border: 1px solid var(--line-strong); }
.sidebar .btn.primary.block:hover:not(:disabled) { background: var(--grey-4); }
.sidebar .btn.primary.block .icon { color: var(--orange); }
.tool-logo.letter { background: var(--grey-3); color: var(--text); }
.agent-card { border-top: 2px solid var(--accent, var(--line-strong)); }
.agent-card h3 .icon { color: var(--accent, var(--muted)); }
.agent-card.planned { border-top-color: var(--line-strong); }
.agent-card.planned h3 .icon { color: var(--faint); }
.agent-card details { border-top: 1px solid var(--line); padding-top: .35rem; }
.agent-card details + details { border-top: 0; padding-top: 0; }
.cockpit-bar .kpis { display: flex; flex-wrap: wrap; gap: .3rem 1.6rem; }
.cockpit-bar .kpi { padding: 0; border: 0; background: none; border-radius: 0; display: flex; }

/* Model picker (ADR-040) */
.model-pick select { padding: .3rem .55rem; font-size: .84rem; background: var(--grey-2); max-width: 220px; }
@media (max-width: 700px) { .model-pick select { max-width: 130px; } }
.catalog-card.restricted { opacity: .55; }
.catalog-card.restricted small { color: var(--faint); }


/* Process map (ADR-043) – infinite canvas, one box per standard */
.app[data-view="prozesse"] [data-for="prozesse"] { display: flex; }
.procmap { --pm-run: var(--ok); --pm-warn: #e9c14a; --pm-off: var(--faint); overflow: hidden; background: var(--grey-1); border: 1px solid var(--line); }
.procmap-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.2rem; padding: .75rem 1.1rem; border-bottom: 1px solid var(--line); }
.procmap-bar h2 { margin: 0; font-size: 1.05rem; }
.pm-counts { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .84rem; color: var(--muted); }
.pm-count { display: inline-flex; align-items: center; gap: .35rem; }
.pm-count b { color: var(--text); font-weight: 600; }
.pm-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-left: auto; }
.pm-filters select { padding: .3rem .55rem; font-size: .84rem; background: var(--grey-2); }
.pm-crumbs { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; padding: .45rem 1.1rem; font-size: .84rem; border-bottom: 1px solid var(--line); }
.pm-crumbs a { text-decoration: none; }
.pm-crumbs a[aria-current] { color: var(--text); }
.pm-crumbs .icon { width: 14px; height: 14px; color: var(--faint); }
.pm-crumbs .pm-stamp { margin-left: auto; }
.pm-stage {
  position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; cursor: grab; outline: none;
  background-color: var(--bg);
  background-image: radial-gradient(circle, var(--line-strong) 1px, transparent 1.2px);
}
.pm-stage.panning { cursor: grabbing; }
.pm-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.pm-world > * { position: absolute; }
.pm-edges { overflow: visible; pointer-events: none; }
.pm-edge { fill: none; stroke: var(--faint); stroke-width: 1.6; }
.pm-edge.wf { stroke: var(--muted); stroke-width: 1.3; }
.pm-arrowhead { fill: var(--muted); }
.pm-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--pm-off); flex: none; }
.running .pm-dot, .pm-count.running .pm-dot { background: var(--pm-run); }
.attention .pm-dot, .pm-count.attention .pm-dot { background: var(--pm-warn); }
.pm-status { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 550; color: var(--muted); white-space: nowrap; }
.pm-status.running { color: var(--pm-run); }
.pm-status.attention { color: var(--pm-warn); }
.pm-lane-head { display: grid; gap: .1rem; }
.pm-lane-head b { font-size: 1rem; }
.pm-flow-head { display: flex; align-items: center; gap: .8rem; }
.pm-measure { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); }
.pm-box, .pm-node, .pm-wfnode, .pm-runs {
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--grey-2);
  padding: .7rem .8rem; display: flex; flex-direction: column; gap: .35rem; overflow: hidden; cursor: pointer;
  box-shadow: inset 3px 0 0 var(--pm-off);
}
.pm-box.running, .pm-wfnode.running { box-shadow: inset 3px 0 0 var(--pm-run); }
.pm-box.attention { box-shadow: inset 3px 0 0 var(--pm-warn); }
.pm-box:hover, .pm-node:hover, .pm-wfnode:hover { border-color: rgba(255, 255, 255, .24); }
.pm-box:focus-visible, .pm-node:focus-visible, .pm-wfnode:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.pm-box.selected { border-color: var(--orange); }
.pm-box-top { display: flex; align-items: center; gap: .4rem; }
.pm-box-top .icon { width: 15px; height: 15px; color: var(--muted); }
.pm-code { font-size: .76rem; font-weight: 600; color: var(--orange-soft); letter-spacing: .02em; }
.pm-maturity { margin-left: auto; }
.pm-maturity.m-aktiv { color: var(--ok); }
.pm-maturity.m-pilot, .pm-maturity.m-überarbeitung { color: var(--orange-soft); border-color: rgba(236, 122, 45, .35); }
.pm-title { font-weight: 600; font-size: .95rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pm-box-status { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.pm-reason { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .76rem; }
.pm-meta { display: flex; flex-wrap: wrap; gap: .2rem .7rem; font-size: .76rem; color: var(--muted); margin-top: auto; }
.pm-world.far .pm-meta, .pm-world.far .pm-reason { visibility: hidden; }
.pm-node { cursor: default; }
.pm-node.start, .pm-wfnode.trigger { box-shadow: inset 3px 0 0 var(--orange); }
.pm-node.end, .pm-wfnode.end { box-shadow: inset 3px 0 0 var(--muted); }
.pm-node-head { display: flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .74rem; min-width: 0; }
.pm-node-head small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-node-head .icon { width: 14px; height: 14px; }
.pm-node.start .pm-node-head .icon, .pm-wfnode.trigger .pm-node-head .icon { color: var(--orange); }
.pm-node-title { font-size: .88rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pm-node-details { margin: 0; padding-left: .95rem; font-size: .76rem; color: var(--muted); }
.pm-node-details li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-chips { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: auto; }
.pm-chip { font-size: .7rem; padding: .05rem .45rem; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--text); background: var(--grey-3); }
.pm-wfnode { padding: .5rem .65rem; gap: .2rem; cursor: default; }
.pm-wfnode.disabled { opacity: .5; }
.pm-wf-head { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; padding-top: .8rem; border-top: 1px dashed var(--line-strong); }
.pm-wf-head .icon { color: var(--muted); }
.pm-wf-empty { font-size: .84rem; }
.pm-runs { cursor: default; box-shadow: none; background: var(--grey-1); font-size: .8rem; }
.pm-runs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.pm-runs li { display: flex; justify-content: space-between; gap: .5rem; }
.pm-zoom { position: absolute; left: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 2px; padding: 3px; border-radius: var(--radius-sm); background: var(--grey-2); border: 1px solid var(--line-strong); }
.pm-message { position: absolute; left: 50%; top: 24px; transform: translateX(-50%); max-width: min(520px, calc(100% - 32px)); margin: 0; padding: .7rem 1rem; border-radius: var(--radius); background: var(--grey-2); border: 1px solid var(--line-strong); font-size: .88rem; text-align: center; }
.pm-panel { position: absolute; top: 12px; right: 12px; bottom: 12px; width: min(340px, calc(100% - 24px)); overflow: auto; cursor: auto; border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: .55rem; background: var(--grey-1); border: 1px solid var(--line); border-top: 2px solid var(--orange); }
.pm-panel header { display: flex; align-items: flex-start; gap: .5rem; }
.pm-panel h3 { margin: 0; font-size: 1rem; flex: 1; }
.pm-panel h4 { margin: .5rem 0 0; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.pm-panel p { margin: 0; font-size: .85rem; }
.pm-panel-row, .pm-panel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.pm-panel-actions a { text-decoration: none; }
.pm-dl { display: grid; grid-template-columns: max-content 1fr; gap: .3rem .8rem; margin: 0; font-size: .84rem; }
.pm-dl dt { color: var(--muted); }
.pm-dl dd { margin: 0; }
.pm-wf-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; font-size: .84rem; }
.pm-wf-list li { display: flex; align-items: center; gap: .5rem; }
.pm-wf-list li span:not(.pm-status) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pm-link-form { display: flex; gap: .4rem; }
.pm-link-form select { flex: 1; min-width: 0; padding: .3rem .5rem; font-size: .84rem; background: var(--grey-2); }
@media (max-width: 700px) {
  .procmap-bar { padding: .6rem .7rem; gap: .5rem; }
  .pm-filters { margin-left: 0; width: 100%; }
  .pm-filters label { flex: 1; min-width: 0; }
  .pm-filters select { width: 100%; }
  .pm-crumbs { padding: .4rem .7rem; }
  .pm-panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 60%; }
}

/* --- Card UX pass (2026-10-19): progressive disclosure, one status line, calm hierarchy --- */
.status-line { display: inline-flex; align-items: center; gap: .4rem; font-size: 13px; line-height: 1.4; color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.status-line.ok .status-dot { background: var(--ok); }
.status-line.warn .status-dot { background: var(--orange); }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.agent-grid, .user-grid { gap: 16px; }
.agent-card, .user-card, .tool-row { padding: 16px; gap: 10px; line-height: 1.4; }
.agent-card h3, .user-top .who b { font-size: 15px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-card p, .user-top .who small { font-size: 13px; }
.agent-card, .agent-card.planned { border-top-width: 1px; }
.card-more > summary { cursor: pointer; font-size: 13px; color: var(--muted); min-height: 32px; display: flex; align-items: center; list-style: none; }
.card-more > summary::-webkit-details-marker { display: none; }
.card-more > summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); margin-right: .55rem; transition: transform .15s; }
.card-more[open] > summary::before { transform: rotate(45deg); }
.card-more > summary:hover { color: var(--text); }
.agent-card .card-more details { border-top: 0; padding: 0 0 0 .9rem; }
.agent-card .card-more summary { font-size: 13px; }
.card-more .facts { margin-top: .3rem; font-size: 13px; }
.user-actions { align-items: center; }
.card-menu { position: relative; margin-left: auto; }
.card-menu > summary { list-style: none; min-width: 44px; min-height: 44px; display: grid; place-items: center; cursor: pointer; border-radius: var(--radius-sm); }
.card-menu > summary::-webkit-details-marker { display: none; }
.card-menu-list { position: absolute; right: 0; bottom: calc(100% + 4px); z-index: 20; min-width: 200px; padding: 4px; display: grid; gap: 2px; border-radius: var(--radius-sm); background: var(--grey-2); border: 1px solid var(--line-strong); box-shadow: 0 12px 32px rgba(0, 0, 0, .45); }
.card-menu-list .btn { min-height: 40px; }
.icon-btn, .btn.icon-only { min-width: 44px; min-height: 44px; justify-content: center; }
.tool-head { cursor: pointer; }
.tool-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.tool-people .avatar.small { width: 28px; height: 28px; }
:where(button, summary, a, [tabindex], input, select, textarea):focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* Process map: bigger, calmer overview boxes */
.pm-box { padding: 14px 16px; gap: 8px; justify-content: flex-start; }
.pm-code { font-size: 13px; }
.pm-title { font-size: 16px; line-height: 1.4; }
.pm-box .pm-status, .pm-status { font-size: 13px; }
.pm-maturity { font-size: 12px; }
.pm-node-title { font-size: 15px; line-height: 1.4; }
.pm-node-head, .pm-node-details, .pm-chip { font-size: 12px; }
.pm-chip.more { color: var(--muted); }
.pm-lane-head b { font-size: 16px; }
.pm-lane-head small, .pm-measure { font-size: 12px; }

@media (max-width: 480px) {
  html, body { overflow-x: hidden; }
  .agent-grid, .user-grid { grid-template-columns: minmax(0, 1fr); }
  .tool-head { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Process map clusters (2026-10-19): area bands, one framed cluster per measure. */
.pm-area-head { position: absolute; display: flex; align-items: baseline; gap: .75rem; }
.pm-area-head b { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.pm-area-head small { font-size: 13px; }
.pm-cluster { position: absolute; border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); background: rgba(255, 255, 255, .02); pointer-events: none; }
.pm-cluster-head { position: absolute; left: 20px; top: 14px; right: 20px; display: flex; align-items: baseline; gap: .5rem; }
.pm-cluster-head b { font-size: 14px; font-weight: 600; color: var(--text, inherit); }
.pm-cluster-head small { font-size: 12px; }
.pm-edge-far { opacity: .35; stroke-dasharray: 4 5; }

/* Flow view: nodes can be dragged like in n8n. */
#pm-world .pm-node, #pm-world .pm-wfnode { cursor: grab; touch-action: none; }
#pm-world .pm-node.dragging, #pm-world .pm-wfnode.dragging { cursor: grabbing; z-index: 5; box-shadow: 0 10px 28px rgba(0, 0, 0, .45); border-color: var(--orange); }
.pm-edges { overflow: visible; }
.pm-reset { margin-left: auto; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; pointer-events: auto; }
.pm-reset:hover { color: var(--text, #fff); border-color: var(--line-strong); }

/* --- Prozesse: swimlanes, KI-Spur, Durchlauf, SOP-Leser (2026-10-19) --- */
.pm-lane-label { display: flex; align-items: center; gap: .55rem; padding-bottom: .35rem; border-bottom: 1px dashed var(--line-strong); font-size: .84rem; }
.pm-lane-label > .icon { width: 15px; height: 15px; color: var(--muted); }
.pm-lane-label b { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.pm-agent { display: inline-flex; align-items: center; gap: .35rem; color: var(--text); font-size: .84rem; }
.pm-agent .icon { width: 15px; height: 15px; color: var(--orange); }
.pm-planned { font-size: .7rem; color: var(--muted); }
.pm-node.ai { box-shadow: inset 3px 0 0 var(--orange); background: var(--grey-2); }
.pm-node.ai .pm-node-head .icon { color: var(--orange); }
.pm-node.ai.manual { box-shadow: none; background: transparent; border-style: dashed; border-color: var(--line); opacity: .6; }
.pm-node.ai.manual .pm-node-title { font-weight: 500; color: var(--muted); }
.pm-node.ai.manual .pm-node-head .icon { color: var(--faint); }
.pm-chip.ai-skill { border-color: rgba(236, 122, 45, .45); color: var(--orange-soft); background: var(--orange-tint); }
.pm-chip.ai-automation { color: var(--muted); }
.pm-node.prompt { box-shadow: inset 3px 0 0 var(--muted); }
.pm-node.prompt .pm-prompt-go { margin-top: auto; align-self: flex-start; text-decoration: none; }
.pm-edge.ai { stroke: var(--orange); stroke-width: 1.3; stroke-dasharray: 4 4; opacity: .55; }
.pm-flow-head { flex-wrap: wrap; }
.pm-sim-ctrl { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--grey-2); }
.pm-sim-btn { display: inline-flex; align-items: center; gap: .35rem; min-height: 30px; padding: .2rem .55rem; border: 0; border-radius: 4px; background: transparent; color: var(--text); font: inherit; font-size: .82rem; cursor: pointer; }
.pm-sim-btn .icon { width: 15px; height: 15px; }
.pm-sim-btn:hover { background: var(--grey-3); }
.pm-sim-btn:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
.pm-sim-btn.play { color: var(--orange-soft); font-weight: 600; }
.pm-sim-btn.stopb { display: none; }
.simulating .pm-sim-btn.stopb { display: inline-flex; }
.pm-node.sim-active { border-color: var(--orange); outline: 2px solid var(--orange); outline-offset: 2px; box-shadow: inset 3px 0 0 var(--orange), 0 0 0 6px rgba(236, 122, 45, .14), 0 0 28px rgba(236, 122, 45, .28); opacity: 1; }
.pm-node.sim-done { border-color: rgba(236, 122, 45, .35); }
.pm-node { transition: box-shadow .25s ease, border-color .25s ease, outline-color .25s ease; }
.pm-edge.sim-flow { stroke: var(--orange); stroke-width: 2.4; stroke-dasharray: 8 6; opacity: 1; animation: pm-flow .8s linear infinite; }
@keyframes pm-flow { to { stroke-dashoffset: -28; } }
.pm-world.pm-glide { transition: transform .45s ease; }
.pm-caption { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(760px, calc(100% - 140px)); display: flex; align-items: center; gap: .8rem; padding: .6rem .9rem; border-radius: var(--radius); background: var(--grey-2); border: 1px solid var(--line-strong); border-left: 3px solid var(--orange); font-size: .9rem; cursor: auto; z-index: 3; }
.pm-caption[hidden] { display: none; }
.pm-cap-pos { font-weight: 600; color: var(--orange-soft); font-variant-numeric: tabular-nums; flex: none; }
.pm-cap-text { flex: 1; min-width: 0; line-height: 1.4; }
.pm-caption small { flex: none; }
.pm-reader { position: absolute; top: 12px; right: 12px; bottom: 12px; width: min(620px, 46vw); z-index: 5; display: flex; flex-direction: column; background: var(--grey-1); border: 1px solid var(--line-strong); border-top: 2px solid var(--orange); border-radius: var(--radius); cursor: auto; overflow: hidden; }
.pm-reader[hidden] { display: none; }
.pm-reader-head { display: flex; align-items: flex-start; gap: .8rem; padding: 1rem 1.1rem .8rem; border-bottom: 1px solid var(--line); background: var(--grey-1); position: relative; z-index: 1; transition: box-shadow .2s ease; }
.pm-reader.scrolled .pm-reader-head { box-shadow: 0 8px 18px rgba(0, 0, 0, .45); }
.pm-reader-title { flex: 1; min-width: 0; display: grid; gap: .25rem; }
.pm-reader-title h3 { margin: 0; font-size: 1.1rem; line-height: 1.3; }
.pm-reader-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .2rem; }
.pm-reader-meta a { text-decoration: none; }
.pm-reader-nav { display: flex; gap: 2px; flex: none; }
.pm-reader-nav button:disabled { opacity: .35; cursor: default; }
.pm-reader-body { flex: 1; min-height: 0; overflow: auto; padding: 1rem 1.3rem 1.4rem; outline: none; overscroll-behavior: contain; }
.pm-reader-body:focus-visible { box-shadow: inset 0 0 0 2px var(--orange); }
.pm-reader-foot { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .9rem; padding: .6rem 1.1rem; border-top: 1px solid var(--line); }
.pm-reader-reset { margin-left: auto; }
.pm-md { font-size: .93rem; line-height: 1.6; color: var(--text); }
.pm-md > :first-child { margin-top: 0; }
.pm-md h2, .pm-md h3, .pm-md h4, .pm-md h5, .pm-md h6 { margin: 1.4em 0 .4em; line-height: 1.3; }
.pm-md h2 { font-size: 1.15rem; padding-bottom: .3rem; border-bottom: 1px solid var(--line); }
.pm-md h3 { font-size: 1.02rem; }
.pm-md h4, .pm-md h5, .pm-md h6 { font-size: .92rem; color: var(--muted); }
.pm-md p { margin: .5em 0; }
.pm-md a { color: var(--orange-soft); }
.pm-md code { font-size: .85em; padding: .05em .35em; border-radius: 4px; background: var(--grey-3); }
.pm-md pre { padding: .7rem .9rem; border-radius: var(--radius-sm); background: var(--grey-2); overflow: auto; }
.pm-md pre code { padding: 0; background: none; }
.pm-md ul, .pm-md ol { margin: .4em 0; padding-left: 1.4rem; }
.pm-md li { margin: .2em 0; }
.pm-md li > ul, .pm-md li > ol { margin: .15em 0; color: var(--muted); }
.pm-md ol > li::marker { color: var(--orange-soft); font-weight: 600; }
.pm-md ul.pm-md-checks { list-style: none; padding-left: .2rem; }
.pm-md-check label { display: flex; align-items: flex-start; gap: .55rem; cursor: pointer; }
.pm-md-check input { margin-top: .3em; width: 16px; height: 16px; accent-color: var(--orange); flex: none; }
.pm-md-check.done span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.pm-md blockquote { margin: .8em 0; padding: .4rem .9rem; border-left: 3px solid var(--orange); background: var(--orange-tint); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.pm-md blockquote p { margin: .3em 0; }
.pm-md hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
.pm-md-table { overflow-x: auto; margin: .7em 0; }
.pm-md table { border-collapse: collapse; width: 100%; font-size: .86rem; }
.pm-md th, .pm-md td { border: 1px solid var(--line-strong); padding: .35rem .55rem; text-align: left; vertical-align: top; }
.pm-md th { background: var(--grey-2); font-weight: 600; }
.pm-md-launch { display: inline-flex; align-items: center; gap: .45rem; margin: 1em 0 .5em; text-decoration: none; }
@media (max-width: 720px) {
  .pm-reader { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 82%; border-radius: var(--radius) var(--radius) 0 0; border-bottom: 0; }
  .pm-caption { width: calc(100% - 24px); left: 12px; transform: none; top: 12px; bottom: auto; flex-wrap: wrap; gap: .3rem .6rem; font-size: .85rem; }
  .pm-caption small { display: none; }
  .pm-sim-btn span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pm-edge.sim-flow { animation: none; stroke-dasharray: none; }
  .pm-world.pm-glide, .pm-node, .pm-reader-head { transition: none; }
}

/* --- Clients (ADR-044, 2026-10-19): central dashboard + client dashboard --- */
.app[data-view="clients"] [data-for="clients"] { display: flex; }
.clients { --cl-warn: #f2a33a; position: relative; }
.cl-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.cl-root { display: grid; gap: 16px; min-width: 0; }
.warn-text { color: var(--cl-warn); }
.accent-text { color: var(--orange); }
.cl-stand { font-size: 12px; }
.cl-banner { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; padding: 12px 14px; border: 1px solid rgba(242, 163, 58, .3); background: rgba(242, 163, 58, .06); border-radius: var(--radius); font-size: 14px; }
.cl-banner > .icon { color: var(--cl-warn); flex: none; }
.cl-banner-text { flex: 1; min-width: 12rem; }
.cl-banner-text p { margin: 0; }
.cl-bar { height: 6px; border-radius: 99px; background: var(--grey-4); overflow: hidden; min-width: 48px; }
.cl-bar i { display: block; height: 100%; background: var(--orange); border-radius: inherit; }
.cl-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.cl-tile { display: grid; gap: .3rem; align-content: start; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--grey-1); min-width: 0; }
.cl-tile small { color: var(--muted); font-size: 13px; }
.cl-tile b { font-size: 1.6rem; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cl-tile > span { font-size: 12px; }
.cl-tile.warn b { color: var(--cl-warn); }
.cl-tile.accent b { color: var(--orange); }
.cl-toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.cl-search { position: relative; flex: 1 1 14rem; min-width: 0; display: flex; }
.cl-search .icon { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.cl-search input { width: 100%; padding-left: 2.2rem; min-height: 40px; }
.cl-sort { display: flex; align-items: center; gap: .45rem; font-size: 13px; }
.cl-sort select { min-height: 40px; }
.cl-seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 2px; }
.cl-seg .btn { min-height: 36px; }
.cl-seg .btn[aria-pressed="true"] { background: var(--grey-3); color: var(--text); }
.cl-empty { padding: 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); display: grid; gap: .5rem; justify-items: start; }
.cl-empty p { margin: 0; }
.cl-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.cl-card { position: relative; display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--grey-1); min-width: 0; line-height: 1.4; }
.cl-card:hover { border-color: var(--line-strong); }
.cl-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; min-width: 0; }
.cl-card-name { font-size: 15px; font-weight: 600; color: var(--text); text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 24px; }
.cl-card-name:hover { color: var(--orange); }
.cl-card .status-line.warn .status-dot, .cl-meta .status-line.warn .status-dot { background: var(--cl-warn); }
.cl-card-step { margin: 0; font-size: 14px; color: var(--muted); }
.cl-card-progress { display: grid; grid-template-columns: 1fr auto; gap: .6rem; align-items: center; font-size: 12px; }
.cl-card-facts { display: grid; gap: .35rem; font-size: 13px; padding-top: .2rem; }
.cl-card-facts p { margin: 0; }
.cl-hint { font-size: 12px; }
.cl-metrics { display: flex; flex-wrap: wrap; gap: .3rem .9rem; }
.cl-metric { white-space: nowrap; font-size: 13px; }
.cl-metric b { font-variant-numeric: tabular-nums; }
.cl-trend { font-size: 12px; font-variant-numeric: tabular-nums; }
.cl-trend.up { color: var(--ok); }
.cl-trend.down { color: var(--cl-warn); }
.cl-trend.flat { color: var(--muted); }
.cl-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); max-width: 100%; }
.cl-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cl-table th, .cl-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cl-table tbody tr:last-child > * { border-bottom: 0; }
.cl-table thead th { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; background: var(--grey-1); }
.cl-table tbody th a { color: var(--text); font-weight: 600; text-decoration: none; }
.cl-table tbody th a:hover { color: var(--orange); }
.cl-table tbody tr:hover { background: rgba(255, 255, 255, .02); }
.cl-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.cl-table.compact th, .cl-table.compact td { padding: 7px 10px; font-size: 13px; }
.cl-td-step { max-width: 16rem; color: var(--muted); }
.cl-td-progress { display: grid; grid-template-columns: minmax(60px, 1fr) auto; gap: .5rem; align-items: center; min-width: 110px; font-size: 13px; }
.cl-th-sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: .25rem; min-height: 28px; }
.cl-th-sort .icon { width: 13px; height: 13px; color: var(--orange); }
.cl-th-sort:hover { color: var(--text); }
.cl-th-sort:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 4px; }
.cl-q { max-width: 18rem; overflow-wrap: anywhere; }

/* client dashboard */
.cl-detail-head { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.cl-meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; font-size: 13px; }
.cl-site { display: inline-flex; align-items: center; gap: .3rem; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.cl-site .icon { width: 13px; height: 13px; color: var(--muted); }
.cl-site:hover { color: var(--orange); }
.cl-hints ul { margin: .3rem 0 0; padding-left: 1.2rem; font-size: 13px; display: grid; gap: .2rem; }
.cl-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.cl-tab { all: unset; cursor: pointer; display: inline-flex; gap: .45rem; align-items: center; padding: 10px 12px; min-height: 24px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: 14px; }
.cl-tab:hover { color: var(--text); }
.cl-tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--orange); font-weight: 600; }
.cl-tab:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; border-radius: 4px; }
.cl-panel { display: grid; gap: 14px; min-width: 0; }
.cl-panel:focus-visible { outline: none; }
.cl-plan-sum { display: grid; grid-template-columns: minmax(80px, 260px) auto; gap: .8rem; align-items: center; font-size: 13px; }
.cl-steps { list-style: none; margin: 0; padding: 0; display: grid; }
.cl-step { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; position: relative; }
.cl-step-rail { position: relative; display: flex; justify-content: center; }
.cl-step-rail::before { content: ""; position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-strong); }
.cl-step:first-child .cl-step-rail::before { top: 22px; }
.cl-step:last-child .cl-step-rail::before { bottom: calc(100% - 22px); }
.cl-step-dot { position: relative; margin-top: 15px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--faint); background: var(--bg); display: grid; place-items: center; }
.cl-step-dot .icon { width: 10px; height: 10px; color: #140a03; stroke-width: 3; }
.cl-step.st-in_arbeit .cl-step-dot { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-tint); }
.cl-step.st-erledigt .cl-step-dot { border-color: var(--ok); background: var(--ok); }
.cl-step.st-blockiert .cl-step-dot { border-color: var(--cl-warn); background: rgba(242, 163, 58, .2); }
.cl-step-body { min-width: 0; padding: 6px 0 14px; display: grid; gap: 4px; }
.cl-step-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.cl-grip { cursor: grab; touch-action: none; min-width: 32px; min-height: 40px; justify-content: center; color: var(--faint); }
.cl-grip:hover { color: var(--text); }
.cl-step.dragging { opacity: .85; }
.cl-step.dragging .cl-step-body { background: var(--grey-2); border-radius: var(--radius-sm); outline: 1px solid var(--orange); }
.cl-step.dragging .cl-grip { cursor: grabbing; }
.cl-step-label { background: transparent; border-color: transparent; font-weight: 600; font-size: 15px; padding: .45rem .5rem; min-width: 0; width: 100%; }
.cl-step-label:hover { border-color: var(--line); }
.cl-step.st-erledigt .cl-step-label { color: var(--muted); }
.cl-step.off .cl-step-label, .cl-step.off .cl-step-line { opacity: .55; }
.cl-status-select { min-height: 36px; padding: .35rem .6rem; font-size: 13px; max-width: 9.5rem; }
.cl-status-select.st-in_arbeit { border-color: rgba(236, 122, 45, .5); color: var(--orange); }
.cl-status-select.st-erledigt { color: var(--ok); }
.cl-status-select.st-blockiert { border-color: rgba(242, 163, 58, .5); color: var(--cl-warn); }
.cl-step-line { display: flex; flex-wrap: wrap; gap: .2rem .8rem; padding-left: 44px; font-size: 13px; }
.cl-code { color: var(--orange); text-decoration: none; font-variant-numeric: tabular-nums; }
.cl-code:hover { text-decoration: underline; }
.cl-step-more { padding-left: 44px; }
.cl-step-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; padding: 6px 0 4px; }
.cl-field { display: grid; gap: .3rem; font-size: 13px; color: var(--muted); min-width: 0; }
.cl-field input, .cl-field select, .cl-field textarea { color: var(--text); font: inherit; font-size: 14px; min-height: 40px; width: 100%; min-width: 0; }
.cl-field textarea { resize: vertical; }
.cl-field-wide { grid-column: 1 / -1; }
.cl-check { display: inline-flex; align-items: center; gap: .5rem; font-size: 14px; min-height: 40px; cursor: pointer; }
.cl-check input { width: 18px; height: 18px; accent-color: var(--orange); }
.cl-step-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding-top: 4px; }
.cl-updated { margin-right: auto; font-size: 12px; }
.cl-del:hover { color: var(--cl-warn); }
.cl-err { margin: 0; font-size: 13px; color: var(--cl-warn); }
.cl-step .cl-err { padding-left: 44px; }
.cl-add > summary { gap: .4rem; }
.cl-add > summary .icon { width: 15px; height: 15px; }
.cl-add-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; align-items: end; padding-top: 6px; }
.cl-add-form .btn { min-height: 40px; justify-self: start; }
.cl-add-form .cl-err { grid-column: 1 / -1; }
.cl-block-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.cl-block-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.cl-note { margin: 0; font-size: 13px; }
.cl-task-group { display: grid; gap: 6px; }
.cl-task-group h4 { margin: 0; display: flex; gap: .5rem; align-items: baseline; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cl-tasks { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.cl-task { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem 1rem; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.cl-task:last-child { border-bottom: 0; }
.cl-task.overdue { box-shadow: inset 2px 0 0 var(--cl-warn); }
.cl-task-name { color: var(--text); text-decoration: none; display: inline-flex; gap: .35rem; align-items: center; min-width: 0; overflow-wrap: anywhere; }
a.cl-task-name:hover { color: var(--orange); }
.cl-task-name .icon { width: 13px; height: 13px; color: var(--faint); flex: none; }
.cl-task-meta { display: flex; gap: .8rem; font-size: 13px; }
.cl-analytics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; }
.cl-block { display: grid; gap: 12px; align-content: start; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--grey-1); min-width: 0; }
.cl-block h4 { margin: .2rem 0 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.cl-progress-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.cl-donut { width: 96px; height: 96px; flex: none; }
.cl-donut .track { fill: none; stroke: var(--grey-4); stroke-width: 9; }
.cl-donut .arc { fill: none; stroke: var(--orange); stroke-width: 9; stroke-linecap: round; }
.cl-donut .lbl { fill: var(--text); font-size: 16px; font-weight: 600; font-family: inherit; }
.cl-facts { display: grid; grid-template-columns: auto auto; gap: .25rem 1rem; margin: 0; font-size: 13px; }
.cl-facts dt { color: var(--muted); }
.cl-facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.cl-next { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; font-size: 13px; }
.cl-next li { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.cl-mini-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.cl-mini { display: grid; gap: .15rem; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--grey-2); min-width: 0; }
.cl-mini small { font-size: 12px; }
.cl-mini b { font-size: 1.2rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.cl-figure { margin: 0; display: grid; gap: 6px; }
.cl-chart { width: 100%; height: 180px; display: block; overflow: visible; }
.cl-chart .grid { stroke: var(--line); stroke-width: 1; }
.cl-chart .axis { fill: var(--muted); font-size: 11px; font-family: inherit; }
.cl-chart .bar.tone-a, .sw.tone-a { fill: var(--orange); background: var(--orange); }
.cl-chart .bar.tone-b, .sw.tone-b { fill: #c9c9cc; background: #c9c9cc; }
.cl-chart .bar.tone-c, .sw.tone-c { fill: #6b6b72; background: #6b6b72; }
.cl-chart .line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.cl-chart .line.tone-b { stroke: #c9c9cc; }
.cl-chart .pt.tone-b { fill: #c9c9cc; }
.cl-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: 12px; color: var(--muted); }
.cl-legend > * { display: inline-flex; align-items: center; gap: .4rem; }
.cl-legend b { color: var(--text); font-variant-numeric: tabular-nums; }
.sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; flex: none; }
.cl-stack { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--grey-4); gap: 2px; }
.cl-stack i { display: block; min-width: 4px; }
.tone-0 { background: var(--ok); }
.tone-1 { background: #c9c9cc; }
.tone-2 { background: #6b6b72; }
.tone-3 { background: var(--orange); }
.tone-4 { background: var(--grey-3); outline: 1px solid var(--line-strong); }
.cl-drawer { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .55); display: flex; justify-content: flex-end; }
.cl-drawer[hidden] { display: none; }
.cl-drawer-card { width: min(440px, 100%); height: 100%; overflow-y: auto; background: var(--grey-1); border-left: 1px solid var(--line-strong); padding: 16px 20px 24px; display: grid; align-content: start; gap: 14px; }
.cl-drawer-head { display: flex; align-items: center; justify-content: space-between; }
.cl-drawer-head h3 { margin: 0; font-size: 16px; }
.cl-drawer-form { display: grid; gap: 14px; }
.cl-drawer-form .cl-field small { font-size: 12px; }
.cl-drawer-status { display: grid; gap: .3rem; }
.cl-drawer-foot { display: flex; gap: .6rem; justify-content: space-between; flex-wrap: wrap; padding-top: 6px; }
@media (max-width: 640px) {
  .clients.admin { padding: 0 16px 24px; }
  .clients.admin .pane-head { margin: 0 -16px; padding: .6rem 16px; flex-wrap: wrap; }
  .cl-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cl-tile b { font-size: 1.3rem; }
  .cl-step-line, .cl-step-more, .cl-step .cl-err { padding-left: 0; }
  .cl-step-row { grid-template-columns: auto minmax(0, 1fr); }
  .cl-status-select { grid-column: 2; justify-self: start; }
  .cl-seg .btn span { display: none; }
}
.cl-table td .cl-metric { display: inline-block; margin-right: .7rem; }
.cl-panel[hidden], .cl-err[hidden] { display: none; }
.clients > .pane-head, .clients > .cl-root { flex: none; }
@media (max-width: 640px) { .clients .pane-head h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cl-step-row .cl-status-select { margin-left: 0; } }
@media (max-width: 640px) { .cl-actions .btn > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } .cl-actions .btn { min-width: 44px; min-height: 40px; } }
.cl-root, .cl-panel { grid-template-columns: minmax(0, 1fr); } .clients { overflow-x: hidden; }

/* Finanzen (ADR-045) – builds on the client overview classes (cl-*) */
.app[data-view="finance"] [data-for="finance"] { display: flex; }
.fi-h { margin: .4rem 0 0; font-size: 15px; font-weight: 600; }
.fi-lead { margin: 0; font-size: 13px; max-width: 70ch; }
.fi-who { display: grid; gap: 2px; min-width: 0; max-width: 22rem; }
.fi-who small { overflow-wrap: anywhere; }
.fi-who a { color: var(--text); overflow-wrap: anywhere; }
.fi-who a:hover { color: var(--orange); }
.fi-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fi-sugg { max-width: 22rem; }
.fi-sugg span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-pick { min-height: 32px; max-width: 16rem; font-size: 13px; }
.fi-in { color: var(--ok); }
.fi-warn { color: var(--cl-warn); }
.cl-table tr.fi-late td:nth-child(5) { color: var(--cl-warn); font-weight: 600; }
.fi-mail { min-height: 32px; font-size: 13px; width: 13rem; max-width: 100%; }
.fi-letter { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid rgba(236, 122, 45, .3); border-radius: var(--radius); background: var(--grey-1); }
.fi-letter-head { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: baseline; justify-content: space-between; font-size: 14px; }
.fi-subject, .fi-body { font: inherit; font-size: 14px; color: var(--text); width: 100%; min-width: 0; }
.fi-body { resize: vertical; line-height: 1.5; }
.fi-form { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.fi-form summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.fi-form[open] summary { margin-bottom: 8px; }
.fi-acts a.btn { text-decoration: none; color: var(--text); }

/* --- Automationen (ADR-046, 2026-11-02): status of all n8n flows --- */
.app[data-view="automations"] [data-for="automations"] { display: flex; }
#automations-pane { --pm-run: var(--ok); --pm-warn: #e9c14a; --pm-off: var(--faint); }
.au-filter { justify-self: start; }
.au-list { list-style: none; margin: 0; padding: 0; display: grid; border: 1px solid var(--line); border-radius: var(--radius); background: var(--grey-1); }
.au-flow { display: grid; gap: 8px; padding: 14px 16px; border-top: 1px solid var(--line); min-width: 0; }
.au-flow:first-child { border-top: 0; }
.au-flow.attention { box-shadow: inset 3px 0 0 var(--pm-warn); }
.au-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-width: 0; }
.au-name { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; min-width: 0; font-weight: 600; }
.au-name a { color: var(--text); text-decoration: none; }
.au-name a:hover { text-decoration: underline; }
.au-name .pm-dot { margin-top: 1px; }
.au-code { font-size: 12px; font-weight: 500; color: var(--muted) !important; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 0 6px; }
.au-meta { display: flex; flex-wrap: wrap; gap: .35rem 1.5rem; font-size: 13px; }
.au-trigger, .au-last { min-width: 0; }
.au-history { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.au-runs { list-style: none; margin: 0; padding: 0; display: flex; gap: 3px; }
.au-run { width: 14px; height: 14px; border-radius: 3px; background: var(--grey-4); cursor: default; }
.au-run.r-success { background: var(--ok); }
.au-run.r-error, .au-run.r-crashed { background: var(--danger); }
.au-run.r-waiting, .au-run.r-running, .au-run.r-new { background: transparent; box-shadow: inset 0 0 0 2px var(--pm-warn); }
.au-run.r-canceled { background: var(--faint); }
.au-run-none { font-size: 12px; }
.au-quote { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); }
.au-quote.bad { color: var(--pm-warn); }
.au-reason { margin: 0; font-size: 13px; color: var(--pm-warn); }
.au-error { display: flex; align-items: flex-start; gap: .6rem; padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(240, 86, 74, .08); border: 1px solid rgba(240, 86, 74, .25); font-size: 13px; }
.au-error > .icon { color: var(--danger); flex: none; margin-top: 2px; }
.au-error p { margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.au-error.past { background: transparent; border-color: var(--line-strong); }
.au-error.past > .icon { color: var(--muted); }
.au-link { display: inline-flex; align-items: center; gap: .3rem; color: var(--orange); text-decoration: none; white-space: nowrap; }
.au-link .icon { width: 14px; height: 14px; }
@media (max-width: 700px) {
  .au-flow { padding: 12px; }
  .au-meta { flex-direction: column; }
}

/* --- Übersicht (ADR-047, 2026-11-02): start page --- */
.app[data-view="overview"] [data-for="overview"] { display: flex; }
.ov-date { font-size: 13px; }
.ov-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: start; }
.ov-panel { grid-column: span 4; display: grid; gap: 12px; align-content: start; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--grey-1); min-width: 0; }
.ov-clients { grid-column: span 7; }
.ov-tasks { grid-column: span 5; }
.no-finance .ov-calendar, .no-finance .ov-automations { grid-column: span 6; }
.ov-panel-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.ov-panel-head h3 { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: 15px; font-weight: 600; }
.ov-panel-head h3 .icon { width: 18px; height: 18px; color: var(--muted); }
.ov-more { display: inline-flex; align-items: center; gap: .15rem; font-size: 13px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.ov-more:hover { color: var(--text); }
.ov-more .icon { width: 15px; height: 15px; }
.ov-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.ov-stat { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--grey-2); min-width: 0; }
.ov-stat b { font-size: 1.35rem; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-stat small { color: var(--muted); font-size: 12px; }
.ov-stat.warn b { color: var(--cl-warn); }
.ov-stat.accent b { color: var(--orange); }
.ov-list { list-style: none; margin: 0; padding: 0; display: grid; }
.ov-list > li { display: grid; gap: 4px; padding: 9px 0; border-top: 1px solid var(--line); min-width: 0; }
.ov-list > li:first-child { border-top: 0; padding-top: 0; }
.ov-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; min-width: 0; }
.ov-name { color: var(--text); text-decoration: none; font-weight: 550; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.ov-name:hover { text-decoration: underline; }
.ov-meeting .ov-row-top { justify-content: flex-start; }
.ov-when { color: var(--orange); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13px; font-weight: 550; }
.ov-sub { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.ov-sub a { color: inherit; }
.ov-ok { color: var(--ok); }
.ov-due { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ov-due.warn, .ov-flag.warn { color: var(--cl-warn); }
.ov-flag { font-size: 12px; white-space: nowrap; }
.ov-phase { display: grid; grid-template-columns: minmax(0, 1fr) 110px auto; align-items: center; gap: .75rem; font-size: 13px; }
.ov-phase-label { display: flex; align-items: center; gap: .45rem; min-width: 0; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ov-code { font-size: 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 0 5px; color: var(--muted); flex: none; }
.ov-st { font-size: 12px; flex: none; }
.ov-st.st-in_arbeit { color: var(--orange); }
.ov-st.st-blockiert { color: var(--danger); }
.ov-pct { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ov-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ov-chip { display: inline-flex; align-items: center; font-size: 13px; padding: 3px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); color: var(--text); text-decoration: none; justify-self: start; }
.ov-chip:hover { background: var(--grey-3); }
.ov-chip.warn { color: var(--cl-warn); }
.ov-chip.accent { color: var(--orange); border-color: rgba(236, 122, 45, .4); }
.ov-empty { padding: 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); display: grid; gap: .35rem; }
.ov-empty p { margin: 0; font-weight: 550; }
.ov-hint { margin: 0; font-size: 12px; }
.ov-foot { font-size: 13px; color: var(--muted); }
@media (max-width: 1100px) {
  .ov-clients, .ov-tasks { grid-column: span 12; }
  .ov-calendar, .ov-finance, .ov-automations, .no-finance .ov-calendar, .no-finance .ov-automations { grid-column: span 6; }
}
@media (max-width: 700px) {
  .ov-grid { gap: 12px; }
  .ov-panel, .ov-clients, .ov-tasks, .ov-calendar, .ov-finance, .ov-automations,
  .no-finance .ov-calendar, .no-finance .ov-automations { grid-column: span 12; }
  .ov-phase { grid-template-columns: minmax(0, 1fr) 80px auto; }
}
