/* SwissHuman – Ops-Dashboard (v2). Ergänzt /shared.css; ausschliesslich Tokens, keine Hex-Farben.
   Leitfaden: docs/DESIGN.md */

/* ---------- Grundgerüst ---------- */
body { overflow-x: clip; }
body.no-scroll { overflow: hidden; }
.content { max-width: 1280px; }
.view { display: flex; flex-direction: column; gap: 16px; }
.view > .page-header { margin-bottom: 4px; }
.page-header h1 { letter-spacing: -0.02em; }
.page-header .sub { max-width: 72ch; }
.page-header > .btn { flex: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--info); cursor: pointer; font: inherit; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 2px; }
.icon-slot { color: inherit; }

/* ---------- Anmeldung ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 16px; padding: 24px 16px; }
.login-card { width: min(400px, 100%); padding: 28px 28px 24px; box-shadow: var(--shadow-lg); }
.login-brand { margin-bottom: 22px; }
.login-title { font-size: var(--fs-xl); margin: 0 0 6px; }
.login-intro { margin: 0 0 20px; }
.login-alt { text-align: center; margin: 16px 0 0; font-size: var(--fs-sm); }
.login-foot { margin: 0; text-align: center; }
.form-error {
  margin: 0 0 14px; padding: 9px 12px; border-radius: var(--radius-sm); font-size: var(--fs-sm);
  background: var(--danger-soft); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
}
.pw-rules { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-xs); color: var(--text-faint); }
.pw-rules li { display: inline-flex; align-items: center; gap: 5px; }
.pw-rules li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; }
.pw-rules li.ok { color: var(--ok); }
.pw-rules li.ok::before { background: currentColor; }

/* ---------- Sidebar ---------- */
.sidebar { gap: 2px; }
.ops-nav { display: flex; flex-direction: column; gap: 2px; }
.ops-nav .nav-section { margin-top: 16px; }
.nav-item .icon-slot { width: 18px; }
.nav-item .nav-ext { margin-left: auto; color: var(--text-faint); width: 14px; }
.nav-item .count.warn { background: var(--warn-soft); color: var(--warn); }
.sidebar-footer { display: flex; flex-direction: column; gap: 8px; }
.live-row { display: flex; align-items: center; gap: 8px; padding: 4px 10px; font-size: var(--fs-xs); color: var(--text-muted); }
.live-row.is-on { color: var(--ok); }
.user-row {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.user-row:hover { background: var(--surface-2); }
.user-row-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; flex: 1; }
.user-row-name { font-size: var(--fs-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row-role { font-size: var(--fs-xs); color: var(--text-faint); }
.user-row .icon { color: var(--text-faint); }
.footer-row { display: flex; align-items: center; gap: 8px; padding: 0 2px; }
.theme-switch button { display: grid; place-items: center; padding: 5px 9px; }

/* ---------- Mobile Kopfzeile ---------- */
.mobile-topbar { display: none; padding: 0 12px; gap: 6px; }
.mobile-topbar .brand img { width: 26px; height: 26px; }
.avatar-btn { border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; }
.avatar-btn .avatar { width: 30px; height: 30px; font-size: 11.5px; }

/* ---------- Kennzahlen ---------- */
.stats { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.stat { display: flex; flex-direction: column; text-align: left; font: inherit; color: inherit; cursor: pointer; min-width: 0; transition: border-color 0.12s, box-shadow 0.12s; }
.stat:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.stat:focus-visible { outline: none; box-shadow: var(--ring); }
.stat .stat-label .icon { color: var(--text-faint); }
.stat .stat-value .sep { color: var(--text-faint); font-weight: 500; margin: 0 2px; }
.stat .stat-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat.tone-warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.stat.tone-warn .stat-value, .stat.tone-warn .stat-meta, .stat.tone-warn .stat-label .icon { color: var(--warn); }
.stat.tone-danger { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.stat.tone-danger .stat-value, .stat.tone-danger .stat-meta, .stat.tone-danger .stat-label .icon { color: var(--danger); }
.stat.tone-ok .stat-meta { color: var(--ok); }
.stat.skeleton-stat { cursor: default; }
.stat.skeleton-stat .skeleton { height: 12px; }

/* ---------- Übersicht ---------- */
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.card-header .card-icon { color: var(--text-faint); }
.card-header h2 { font-size: var(--fs-md); }
.att-list { list-style: none; margin: 0; padding: 4px 0; }
.att-item { display: flex; align-items: center; gap: 12px; padding: 10px 18px; cursor: pointer; }
.att-item:hover, .att-item:focus-visible { background: var(--surface-2); outline: none; }
.att-item-main { flex: 1; min-width: 0; }
.att-item-title { font-weight: 600; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-item-reason { font-size: var(--fs-xs); color: var(--warn); display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.att-item.is-danger .att-item-reason { color: var(--danger); }

/* ---------- Karten-Werkzeugleisten, Suche, Chips ---------- */
.card-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.card-toolbar + .card-toolbar { padding-top: 0; }
.card-toolbar:has(+ .card-toolbar) { border-bottom: 0; }
.card-toolbar .select { width: auto; flex: 0 1 auto; max-width: min(240px, 100%); padding-top: 7px; padding-bottom: 7px; }
.search-field { position: relative; flex: 1 1 240px; min-width: 0; display: block; }
.search-field > .icon-slot { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.search-field .input { padding: 7px 36px 7px 34px; }
.search-field .kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search-field .input:focus ~ .kbd, .search-field .input:not(:placeholder-shown) ~ .kbd { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip { padding: 5px 11px; font-size: var(--fs-sm); }
.chip .icon { color: var(--text-faint); }
.chip.active .icon, .chip[aria-pressed="true"] .icon { color: inherit; }
.chip .count { font-size: 11.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.chip.active .count, .chip[aria-pressed="true"] .count { color: inherit; opacity: 0.75; }
.chip.chip-warn:not(.active) { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); color: var(--warn); }
.chip.chip-warn:not(.active) .icon { color: var(--warn); }
.chip-static { cursor: default; padding: 2px 8px; font-size: var(--fs-xs); background: var(--surface-2); border-color: transparent; max-width: 180px; }
.chip-static:hover { background: var(--surface-2); border-color: transparent; }
.chip-static .icon { color: var(--text-muted); }
.chip-static .chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-all { background: var(--violet-soft); color: var(--violet); }
.chip-all:hover { background: var(--violet-soft); }
.chip-all .icon { color: var(--violet); }

/* ---------- Tabellen ---------- */
.table-wrap { position: relative; -webkit-overflow-scrolling: touch; }
.table th { background: var(--surface-2); }
.table-tasks { min-width: 920px; }
.table-helpers { min-width: 1000px; }
.table-partners { min-width: 780px; }
.table-orgs { min-width: 900px; }
.table.table-orgs th.th-narrow { min-width: 0; width: 1%; }
.table-orgs td:first-child { min-width: 230px; }
.cell-actions { text-align: right; }
.org-admin-inline { display: none; align-items: center; gap: 5px; margin-top: 6px; font-weight: 600; white-space: nowrap; }
@media (max-width: 640px) {
  .org-admin-inline { display: inline-flex; }
  .table-orgs th:last-child, .table-orgs td.cell-actions { display: none; }
  .table-orgs { min-width: 700px; }
}
.table-users { min-width: 940px; }
.table tbody tr.clickable:focus-visible { outline: none; background: var(--surface-2); }
.table tbody tr.clickable:focus-visible td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.table tr.att-warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.table tr.att-danger td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.table tr.is-inactive td { color: var(--text-muted); }
.table tr.is-inactive .avatar { opacity: 0.6; }
.table tr.revoked td { opacity: 0.55; }
.table th.th-wrap { white-space: normal; min-width: 90px; }
.cell-title { max-width: 300px; }
.title-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.title-text { min-width: 0; }
.title-text .strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub { font-size: var(--fs-xs); color: var(--text-faint); display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cell-sub .icon { flex: none; }
.att-line { font-size: var(--fs-xs); font-weight: 600; color: var(--warn); display: flex; align-items: center; gap: 5px; margin-top: 3px; }
.att-danger .att-line { color: var(--danger); }
.cell-people { max-width: 190px; }
.cell-people > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phase { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 4px; }
.phase-warn { color: var(--warn); font-weight: 600; }
.phase-info { color: var(--info); font-weight: 600; }
.phase-danger { color: var(--danger); font-weight: 600; }
.overdue { color: var(--danger); font-weight: 600; }
.hot { color: var(--warn); font-weight: 650; }
.hot.hot-danger { color: var(--danger); }
.zero { color: var(--text-faint); }
.skills { display: flex; flex-wrap: wrap; gap: 4px; min-width: 180px; max-width: 250px; }
.rating { display: inline-flex; align-items: center; gap: 4px; }
.rating .icon { color: var(--warn); }
.row-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.stars-row { display: inline-flex; gap: 2px; color: var(--border-strong); vertical-align: -2px; }
.stars-row .on { color: var(--warn); }
.stars-row .on .icon { fill: currentColor; }
.empty-li { list-style: none; }
.switch.small { font-size: var(--fs-xs); color: var(--text-muted); gap: 8px; font-weight: 500; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.loading-rows { padding: 10px 18px 14px; }
.cell-switch { white-space: nowrap; font-size: var(--fs-sm); }

/* ---------- Live-Feed ---------- */
.live-badge { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-muted); padding: 0 6px; }
.live-badge.is-on { color: var(--ok); }
.feed-list { list-style: none; margin: 0; padding: 0; }
.feed-list > .empty { list-style: none; }
.feed-item { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.feed-item:last-child { border-bottom: 0; }
.feed-item[data-task] { cursor: pointer; }
.feed-item[data-task]:hover, .feed-item[data-task]:focus-visible { background: var(--surface-2); outline: none; }
.feed-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.feed-item.tone-danger .feed-icon { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.feed-item.tone-warn .feed-icon { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.feed-item.tone-ok .feed-icon { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.feed-title { font-weight: 600; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.feed-text { color: var(--text-muted); overflow-wrap: anywhere; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.feed-meta { font-size: var(--fs-xs); color: var(--text-faint); margin-top: 3px; }
.feed-item.is-internal .feed-title { font-weight: 500; color: var(--text-muted); }
.feed-item.is-new { animation: feedin 0.8s var(--ease); }
.feed-list.compact .feed-item { padding: 10px 18px; }
.feed-list.compact .feed-text { -webkit-line-clamp: 1; }
@keyframes feedin { from { background: color-mix(in srgb, var(--accent) 8%, transparent); } }

/* ---------- Auftrags-Drawer ---------- */
.drawer.drawer-wide { width: min(720px, 100vw); }
.drawer:focus { outline: none; }
.drawer-head { min-height: 68px; gap: 12px; }
.d-titles { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.d-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.d-title { font-size: var(--fs-md); font-weight: 650; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-body { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px 40px; }
.d-card { box-shadow: var(--shadow-xs); }
.d-card > .card-header { padding: 11px 16px; }
.d-card > .card-header h3 { font-size: var(--fs-sm); font-weight: 650; }
.d-card > .card-header .icon-slot, .d-card > .card-header > .icon { color: var(--text-faint); }
.d-card > .card-body { padding: 14px 16px; }
.d-card .kv { font-size: var(--fs-sm); }
.actions-card { display: flex; flex-direction: column; gap: 12px; }
.assign-row { display: flex; gap: 8px; flex-wrap: wrap; }
.assign-row .select { flex: 1 1 260px; min-width: 0; }
.action-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.mono-ids { display: flex; flex-direction: column; gap: 2px; font-family: var(--mono); font-size: 12px; color: var(--text-muted); }
.mini-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.mini-table td { padding: 6px 0; border-bottom: 1px dashed var(--border); vertical-align: middle; }
.mini-table td.num { text-align: right; white-space: nowrap; padding-left: 12px; }
.mini-table tr.total td { border-bottom: 0; border-top: 1px solid var(--border-strong); font-weight: 650; padding-top: 9px; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.split > div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 9px 12px; display: flex; flex-direction: column; }
.split strong { font-variant-numeric: tabular-nums; }
.loc-list, .checklist, .question-list, .plain-list { list-style: none; margin: 0; padding: 0; }
.loc { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.loc:first-child { padding-top: 0; }
.loc:last-child { border-bottom: 0; padding-bottom: 0; }
.loc > .icon-slot, .loc > .icon { color: var(--text-faint); margin-top: 2px; }
.loc > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; font-size: var(--fs-sm); }
.checklist .check-box {
  flex: none; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border-strong);
  display: grid; place-items: center; margin-top: 1px;
}
.checklist li.done .check-box { background: var(--ok); border-color: var(--ok); color: var(--accent-ink); }
.checklist li.done .step { color: var(--text-muted); }
.checklist .step { flex: 1; }
.question-list li { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warn-soft); margin-bottom: 8px; }
.question-list li:last-child { margin-bottom: 0; }
.question-list .q { font-weight: 600; overflow-wrap: anywhere; }
.plain-list li { padding: 4px 0; font-size: var(--fs-sm); }
.result-box { background: var(--ok-soft); border-radius: var(--radius-sm); padding: 12px 14px; }
.contract-list { margin: 0; padding-left: 18px; }
.contract-list.is-issue { color: var(--danger); }
.contract-list li + li { margin-top: 2px; }
.attention-callout { align-items: flex-start; }
.attention-callout ul { margin: 4px 0 0; padding-left: 18px; }
.attention-callout.warn { color: var(--warn); }
.attention-callout.danger { color: var(--danger); }
details.more > summary { cursor: pointer; color: var(--text-muted); font-size: var(--fs-sm); font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary .icon { transition: transform 0.15s var(--ease); }
details.more[open] > summary .icon { transform: rotate(90deg); }
details.more[open] > summary { margin-bottom: 10px; }

/* Timeline mit Icons statt Punkten */
.timeline.with-icons li { padding: 0 0 18px 40px; }
.timeline.with-icons li::before { display: none; }
.timeline.with-icons li::after { left: 13px; top: 30px; }
.t-icon {
  position: absolute; left: 0; top: 0; width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-muted);
}
.timeline li.tone-ok .t-icon { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.timeline li.tone-warn .t-icon { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.timeline li.tone-danger .t-icon { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.timeline li.tone-info .t-icon { background: var(--info-soft); color: var(--info); border-color: transparent; }
.timeline li.tone-violet .t-icon { background: var(--violet-soft); color: var(--violet); border-color: transparent; }
.timeline .t-title { font-size: var(--fs-sm); font-weight: 600; }
.timeline .t-meta { margin: 0 0 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.timeline li.t-internal { opacity: 1; }
.timeline li.t-internal .t-title { font-weight: 500; color: var(--text-muted); }
.timeline li.t-internal .t-body { color: var(--text-muted); font-size: var(--fs-xs); }
.timeline li.t-internal .t-icon { border: 1px dashed var(--border-strong); background: var(--surface); }
.timeline .t-extra { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 3px; overflow-wrap: anywhere; }

/* Anhänge */
.attachment-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.attachment {
  display: flex; flex-direction: column; min-width: 0; padding: 0; overflow: hidden; text-align: left; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: inherit; font: inherit;
}
.attachment:hover { border-color: var(--border-strong); }
.attachment img, .attachment .att-icon { display: grid; place-items: center; width: 100%; height: 96px; object-fit: cover; background: var(--surface-2); color: var(--text-faint); }
.attachment .att-name { padding: 7px 9px 0; font-size: var(--fs-xs); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment .att-meta { padding: 0 9px 7px; font-size: 11px; color: var(--text-faint); }

/* ---------- Dialoge ---------- */
.modal .field:last-of-type { margin-bottom: 0; }
.modal > p.small, .modal form > p.small { margin-top: 4px; }
.once-warning { margin: 12px 0 16px; }
.secret-box { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; margin-bottom: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.secret-box code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; user-select: all; }
.check-row { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-sm); margin-top: 12px; cursor: pointer; }
.check-row input { margin-top: 2px; }
.field-hint { margin: 5px 0 0; }
.sheet-nav { display: flex; flex-direction: column; gap: 2px; margin: 8px -8px 0; }
.sheet-section { margin: 12px 2px 4px; }
.modal .footer-row { flex-wrap: wrap; row-gap: 10px; }

/* ---------- Partner & Integration ---------- */
.integration { padding: 20px; }
.integration h2 { font-size: var(--fs-md); margin: 0 0 4px; }
.code-wrap { position: relative; margin: 10px 0 0; }
.code-block {
  margin: 0; padding: 12px 14px; padding-right: 96px; overflow-x: auto; white-space: pre;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: 12px; line-height: 1.6; color: var(--text);
}
.code-wrap .copy-btn { position: absolute; top: 7px; right: 7px; }
.integration-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* ---------- Einstellungen ---------- */
.settings-card { padding: 0; }
.settings-card > .card-header { align-items: flex-start; }
.settings-card > .card-header .card-icon { margin-top: 2px; }
.settings-section { padding: 18px 20px; }
.settings-grid { display: grid; grid-template-columns: minmax(160px, 220px) minmax(0, 1fr); gap: 16px 20px; align-items: start; margin-top: 16px; }
.settings-grid > .label { margin: 9px 0 0; }
.key-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); min-height: 38px; }
.key-status code { font-family: var(--mono); font-size: 12.5px; }
.key-status > .icon { color: var(--text-faint); }
.key-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.key-form .input { flex: 1 1 240px; font-family: var(--mono); font-size: 12.5px; }
.test-result { margin-top: 8px; font-size: var(--fs-sm); padding: 8px 10px; border-radius: var(--radius-sm); display: flex; align-items: center; gap: 8px; }
.test-result.ok { background: var(--ok-soft); color: var(--ok); }
.test-result.fail { background: var(--danger-soft); color: var(--danger); }
.settings-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.source-note { font-size: var(--fs-xs); color: var(--text-faint); margin-top: 5px; }
.integration-block { padding: 18px 20px; border-top: 1px solid var(--border); }
.integration-head { display: flex; align-items: center; gap: 12px; }
.integration-head h3 { margin: 0; font-size: var(--fs-md); }
.integration-intro { margin: 10px 0 0; }
.url-box { margin-bottom: 0; }
.note-warn { margin-top: 8px; }
.setup-steps { margin-top: 16px; }
.setup-steps ol { margin: 0; padding-left: 20px; font-size: var(--fs-sm); }
.setup-steps li + li { margin-top: 8px; }
.setup-steps code.mono { overflow-wrap: anywhere; }

/* Externe Humans (Poke) */
.provider-toggle { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin-top: 14px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.provider-toggle .switch { font-weight: 600; }
.provider-status { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; font-size: var(--fs-sm); }
.provider-status > .icon { flex: none; margin-top: 2px; color: var(--violet); }
.provider-status.muted > .icon { color: var(--text-faint); }
.provider-error { margin-top: 8px; }
.cmd-box { margin: 8px 0 0; background: var(--surface); }
.once-label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.once-hint { margin: -2px 0 6px; }
.provider-error > div { min-width: 0; overflow-wrap: anywhere; }
.poke-overflow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.poke-overflow .input { width: 92px; }
.skill-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.skill-option { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: var(--fs-sm); cursor: pointer; min-width: 0; }
.skill-option:hover { border-color: var(--border-strong); }
.skill-option:has(input:checked) { border-color: var(--violet); background: var(--violet-soft); }
.skill-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.skill-option input { flex: none; margin: 0; accent-color: var(--violet); }
.skill-option-icon { display: inline-flex; flex: none; color: var(--text-muted); }
.skill-option-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.skill-option.is-disabled { cursor: not-allowed; background: var(--surface-2); color: var(--text-faint); }
.skill-option.is-disabled:hover { border-color: var(--border); }
.skill-option.is-disabled .skill-option-icon { color: var(--text-faint); }
.poke-handoff { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding-top: 12px; border-top: 1px dashed var(--border); }
.poke-handoff-text { flex: 1 1 260px; min-width: 0; }
.poke-handoff-text .label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.avatar.avatar-provider { background: var(--violet-soft); color: var(--violet); }
.pill-provider { font-size: 11px; line-height: 16px; padding: 0 7px; vertical-align: 1px; }
.t-meta .pill-provider { margin-left: 2px; }
.perm { display: inline-block; margin: 2px 0; padding: 0 5px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); }

/* ---------- Wissen ---------- */
.knowledge-list { display: grid; gap: 12px; padding: 16px; }
.knowledge-card { padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.knowledge-head { display: flex; align-items: flex-start; gap: 10px; }
.knowledge-head h3 { margin: 0; font-size: var(--fs); font-weight: 650; overflow-wrap: anywhere; }
.knowledge-content { margin: 8px 0 12px; font-size: var(--fs-sm); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.knowledge-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.knowledge-meta { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.knowledge-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ---------- Responsiv ---------- */
@media (max-width: 1100px) {
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .mobile-topbar { display: flex; }
  .content { padding-top: 16px; }
  .page-header { align-items: flex-start; gap: 10px; }
  .page-header > div:first-child { flex: 1 1 100%; }
  .page-header .spacer { display: none; }
  .bottom-nav .nav-item { position: relative; }
  .bottom-nav .count { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; }
  .bottom-nav .nav-item.active .icon, .bottom-nav .nav-item[aria-current="page"] .icon { color: var(--accent); }
}
@media (max-width: 640px) {
  .page-header h1 { font-size: var(--fs-lg); }
  .page-header > .btn { flex: 1 1 auto; }
  /* Kennzahlen als wischbare Leiste */
  .stats { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(150px, 46%); overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 4px; scrollbar-width: none; }
  .stats::-webkit-scrollbar { display: none; }
  .stat { scroll-snap-align: start; }
  .stat .stat-value { font-size: 22px; }
  .card-toolbar { padding: 10px 12px; }
  /* Filter-Chips als wischbare Zeile statt sechs Zeilen Umbruch */
  .card-toolbar > .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px; min-width: 0; flex: 1 1 100%; }
  .card-toolbar > .chips::-webkit-scrollbar { display: none; }
  .card-toolbar > .chips .chip { flex: none; }
  .card-toolbar .select { flex: 1 1 140px; max-width: none; }
  .search-field .kbd { display: none; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .settings-grid > .label { margin-top: 12px; }
  .settings-section, .integration-block, .integration { padding: 16px; }
  .drawer-body { padding: 12px 12px 32px; }
  .knowledge-list { padding: 12px; }
  .feed-item { padding: 11px 14px; }
}
