/* Kompass — UI-Layer für MediaparkBrain (Soll v8). Ersetzt style.css im Layout. */
:root {
  --bg: #e8e8ed; --surface: #fff; --surface-2: #f5f5f7; --line: #e5e5ea; --line-soft: #f0f0f2;
  --ink: #1d1d1f; --ink-2: #3a3a3c; --muted: #6e6e73; --muted-2: #8e8e93; --disabled: #c7c7cc;
  --accent: #0071e3; --accent-hover: #0058b0;
  --ok: #34c759; --warn: #ff9f0a; --bad: #ff3b30;
  --r-sm: 7px; --r: 9px; --r-lg: 12px; --r-xl: 14px;
  --shadow-card: 0 1px 2px rgba(0,0,0,.06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
/* hidden schlaegt jede Layout-Regel: sonst gewinnt z.B. .kp-sections{display:flex}
   gegen das [hidden] des Browsers und der Wrapper waere sichtbar. */
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; } a:hover { color: var(--accent-hover); }
h1 { font-size: 26px; margin: 0; letter-spacing: -.02em; font-weight: 600; }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 9px 12px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* Shell */
.kp-app { display: flex; min-height: 100vh; background: var(--surface); }
.kp-side { width: 208px; flex-shrink: 0; background: var(--surface-2); padding: 22px 12px; display: flex; flex-direction: column; gap: 2px; }
.kp-app.is-collapsed .kp-side { width: 64px; align-items: center; }
.kp-app.is-collapsed .kp-side .kp-label { display: none; }
.kp-brand { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; margin-bottom: 22px; }
.kp-brand a { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 600; font-size: 15px; }
.kp-logo { width: 24px; height: 24px; border-radius: 7px; background: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.kp-logo::before { content: ""; width: 10px; height: 10px; background: #fff; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.kp-collapse { border: 0; background: none; color: var(--muted-2); cursor: pointer; font-size: 13px; }
.kp-nav a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); font-size: 14px; }
.kp-nav a.is-active { background: #fff; font-weight: 600; box-shadow: var(--shadow-card); }
.kp-side-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.kp-side-bottom .kp-secondary { padding: 7px 10px; border-radius: 8px; color: var(--muted); font-size: 13px; }
.kp-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink); }
.kp-user.is-active { background: #fff; box-shadow: var(--shadow-card); }
.kp-user .kp-gear { margin-left: auto; color: var(--muted-2); }
.kp-avatar { width: 28px; height: 28px; border-radius: 50%; background: #636366; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.kp-main { flex: 1; min-width: 0; padding: 26px 36px 30px; display: flex; flex-direction: column; gap: 22px; }
.kp-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-width: 0; }
.kp-head-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; flex: 1 1 auto; overflow: hidden; }
.kp-head-title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.kp-head > form { flex: 0 1 clamp(240px, 38%, 640px); min-width: 0; }
.kp-crumb { font-size: 13px; color: var(--muted); white-space: nowrap; flex: 0 0 auto; }
.kp-tag { font-size: 12px; color: var(--muted); background: var(--surface-2); border-radius: 6px; padding: 2px 8px; white-space: nowrap; flex: 0 0 auto; }
/* Suche: waechst mit dem Fenster, faellt aber nie unter 320px und draengt
   Titel/Breadcrumb nicht in den Umbruch. */
.kp-search { width: 100%; min-width: 0; height: 34px; background: var(--surface-2); border-radius: var(--r); border: 0; padding: 0 12px; font-size: 13.5px; color: var(--ink); }
@media (max-width: 1100px) { .kp-head > form { flex-basis: 240px; } }
.kp-search::placeholder { color: var(--muted-2); }
.kp-footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.kp-hint { font-size: 12.5px; color: var(--muted-2); }

/* Buttons */
.kp-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: var(--r); border: 0; font: inherit; font-size: 14px; cursor: pointer; background: var(--surface-2); color: var(--ink); }
.kp-btn-primary { background: var(--accent); color: #fff; font-weight: 600; }
.kp-btn-primary:hover { background: var(--accent-hover); color: #fff; }
.kp-btn[disabled] { color: var(--disabled); cursor: default; }
.kp-icon-btn { width: 28px; height: 28px; border-radius: var(--r-sm); background: var(--surface-2); border: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); cursor: pointer; }

/* KPIs + Benefit-Chips */
.kp-kpis { display: flex; gap: 28px; padding: 0 4px; }
.kp-kpi b { display: block; font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.kp-kpi.is-muted b { color: var(--muted); }
.kp-kpi span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.kp-kpi.is-right { margin-left: auto; text-align: right; }
.kp-chips { display: flex; gap: 8px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.kp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); }
.kp-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; }
.kp-dot.is-ink { background: var(--ink); } .kp-dot.is-ok { background: var(--ok); }

/* Tabelle */
.kp-table { display: flex; flex-direction: column; }
.kp-tr { display: grid; gap: 12px; padding: 13px 12px; border-bottom: 1px solid var(--line-soft); align-items: center; font-size: 14px; }
.kp-tr.is-dim { opacity: .6; }
.kp-th { padding: 0 12px 8px; font-size: 11.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
.kp-th span { display: flex; align-items: center; gap: 4px; }
.kp-th .kp-sort, .kp-th .kp-filter { color: var(--disabled); cursor: pointer; }
.kp-th .kp-sort.is-active { color: var(--ink); }
.kp-tr .kp-name { font-weight: 600; color: var(--ink); }
.kp-tr .kp-sub { font-size: 12px; color: var(--muted); }
.kp-tr .kp-more { padding: 10px 12px; font-size: 12.5px; color: var(--muted-2); }
.kp-cols-dashboard { grid-template-columns: 1.9fr 2fr .9fr 1.6fr .55fr 1.8fr .8fr .8fr .7fr; }
.kp-cols-knowledge { grid-template-columns: 2.6fr 1fr .8fr 1fr .9fr 1fr; }
.kp-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* Fortschritt / Score */
.kp-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.kp-bar > i { display: block; height: 100%; background: var(--ok); }
.kp-bar.is-warn > i { background: var(--warn); } .kp-bar.is-bad > i { background: var(--bad); }
.kp-roles { display: flex; gap: 5px; }
.kp-role { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.kp-role small { font-size: 9px; color: var(--muted-2); letter-spacing: .03em; }
.kp-score { width: 26px; height: 24px; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: #fff; background: var(--surface-2); }
.kp-score.is-ok { background: var(--ok); } .kp-score.is-warn { background: var(--warn); } .kp-score.is-bad { background: var(--bad); }
.kp-score.is-none { color: var(--muted-2); } .kp-score.is-running { color: var(--accent); }
.kp-score.is-lg { width: 30px; height: 30px; border-radius: var(--r); font-size: 13px; }
.kp-total { font-weight: 600; } .kp-total.is-ok { color: var(--ok); } .kp-total.is-warn { color: var(--warn); } .kp-total.is-none { color: var(--muted-2); }

/* Sektionen (Antragsdetail) */
.kp-layout-detail { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 28px; align-items: start; }
.kp-sections { display: flex; flex-direction: column; gap: 28px; }
.kp-section { display: flex; flex-direction: column; gap: 12px; }
.kp-section-title { font-size: 12px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .05em; display: flex; justify-content: space-between; align-items: baseline; }
.kp-section-title em { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--muted); }
.kp-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kp-fact { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; }
.kp-fact small { display: block; font-size: 11.5px; color: var(--muted); } .kp-fact b { display: block; font-size: 15px; margin-top: 2px; }
.kp-text { font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.kp-steps { display: flex; align-items: center; }
.kp-step { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; background: var(--line); color: var(--muted-2); flex-shrink: 0; }
.kp-step.is-done { background: var(--ok); color: #fff; } .kp-step.is-current { background: var(--accent); color: #fff; }
.kp-step-line { flex: 1; height: 3px; background: var(--line); } .kp-step-line.is-done { background: var(--ok); }
.kp-step-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); } .kp-step-labels b { color: var(--ink); }
.kp-missing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kp-missing input { border-color: var(--warn); }
.kp-role-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kp-role-card { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; border: 0; font: inherit; cursor: pointer; text-align: left; width: 100%; }
.kp-role-card.is-open { background: var(--ink); color: #fff; }
.kp-role-card b { font-size: 14px; } .kp-role-card b i { font-style: normal; color: var(--muted-2); font-weight: 400; font-size: 12px; margin-left: 4px; }
.kp-role-detail { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 28px; }
.kp-role-detail[hidden] { display: none; }
.kp-kv small { display: block; font-size: 12px; color: var(--muted-2); margin-bottom: 6px; } .kp-kv div { font-size: 14px; line-height: 1.5; }
.kp-kv.is-wide { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.kp-accordion { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.kp-accordion > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: var(--surface-2); cursor: pointer; }
.kp-accordion[open] > summary { background: var(--ink); color: #fff; } .kp-accordion[open] > summary small { color: #a1a1a6; }
.kp-accordion > summary::-webkit-details-marker { display: none; }
.kp-accordion .kp-role-detail { border: 0; border-radius: 0; }
.kp-dialog { display: flex; flex-direction: column; gap: 8px; }
.kp-msg { display: flex; gap: 12px; align-items: flex-start; }
.kp-bubble { background: var(--surface-2); border-radius: var(--r-lg); padding: 10px 14px; font-size: 14px; line-height: 1.5; max-width: 560px; }
.kp-bubble.is-escalation { background: #fff7e6; } .kp-bubble.is-internal { background: none; border: 1px dashed #d1d1d6; color: var(--muted); }
.kp-bubble .kp-meta { font-size: 11.5px; color: var(--muted-2); margin-top: 4px; display: flex; justify-content: space-between; gap: 12px; }
.kp-compose { display: flex; gap: 8px; } .kp-compose input { flex: 1; }
.kp-docs a { display: flex; justify-content: space-between; padding: 10px 12px; background: var(--surface-2); border-radius: var(--r); color: var(--ink); margin-bottom: 6px; }
.kp-versions div { display: flex; gap: 12px; font-size: 13.5px; margin-bottom: 6px; } .kp-versions span { color: var(--muted-2); font-variant-numeric: tabular-nums; }
.kp-decision { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.kp-toc { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; border-left: 1px solid var(--line); }
.kp-toc a { padding: 6px 12px; color: var(--muted); } .kp-toc a.is-active { color: var(--ink); font-weight: 600; border-left: 2px solid var(--ink); margin-left: -1px; }
.kp-toc .kp-flag { color: var(--warn); }

/* Wissen */
.kp-graph-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
.kp-graph { position: relative; height: 420px; background: var(--surface-2); border-radius: var(--r-xl); overflow: hidden; }
/* Kein viewBox: die Linien rechnen in Prozent des Containers, genau wie die
   Knoten (left/top in % + translate(-50%,-50%)) - deshalb treffen sie die
   Kreismittelpunkte exakt, unabhaengig von der Containerbreite. */
.kp-graph svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.kp-graph line { transition: stroke .15s, stroke-width .15s, opacity .15s; }
.kp-graph line.is-hot { stroke: var(--accent); stroke-width: 2; }
.kp-graph.is-focus line:not(.is-hot) { opacity: .25; }
.kp-node { position: absolute; z-index: 1; transform: translate(-50%, -50%); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; transition: opacity .15s, box-shadow .15s; }
.kp-node.is-project { background: var(--ink); color: #fff; width: 64px; height: 64px; text-align: center; line-height: 1.2; }
.kp-node.is-dept { background: var(--accent); color: #fff; width: 48px; height: 48px; text-align: center; line-height: 1.1; padding: 0 4px; overflow: hidden; }
.kp-node.is-dept-outline { background: #fff; border: 2px solid var(--accent); color: var(--accent); width: 34px; height: 34px; font-size: 10px; overflow: hidden; }
.kp-node.is-doc { border-radius: 999px; background: #fff; padding: 4px 9px; font-weight: 400; color: var(--ink); box-shadow: var(--shadow-card); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; line-height: 18px; }
.kp-node.is-more { background: var(--line); color: var(--ink-2); font-weight: 600; box-shadow: none; }
.kp-node.is-locked { opacity: .45; }
.kp-node:hover { z-index: 2; box-shadow: 0 0 0 2px var(--accent); }
.kp-graph.is-focus .kp-node:not(.is-hot):not(:hover) { opacity: .3; }
.kp-graph.is-focus .kp-node.is-locked:not(.is-hot):not(:hover) { opacity: .18; }
.kp-legend { position: absolute; left: 14px; bottom: 10px; z-index: 3; display: flex; gap: 12px; font-size: 11.5px; color: var(--muted); background: rgba(245,245,247,.92); border-radius: 6px; padding: 4px 8px; }
.kp-cloud { background: var(--surface-2); border-radius: var(--r-xl); padding: 18px 20px; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 6px 14px; line-height: 1; }
.kp-cloud span { color: var(--muted); } .kp-cloud .w1 { font-size: 13px; color: var(--muted-2); } .kp-cloud .w2 { font-size: 15px; } .kp-cloud .w3 { font-size: 18px; color: var(--ink); } .kp-cloud .w4 { font-size: 22px; color: var(--accent); } .kp-cloud .w5 { font-size: 26px; color: var(--ink); } .kp-cloud .w6 { font-size: 30px; font-weight: 600; color: var(--ink); letter-spacing: -.02em; }
.kp-stale { font-size: 11px; color: var(--warn); font-weight: 600; margin-left: 6px; }

/* Hochladen */
.kp-drop-row { display: grid; grid-template-columns: 1.15fr 1.5fr .62fr; gap: 10px; max-width: 760px; width: 100%; align-self: center; }
.kp-drop { height: 88px; border-radius: var(--r-lg); background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 14px; font-weight: 600; cursor: pointer; }
.kp-drop.is-files { background: none; border: 1.5px dashed var(--disabled); } .kp-drop.is-over { border-color: var(--accent); background: #eef5fd; }
.kp-drop small { font-size: 11.5px; color: var(--muted-2); font-weight: 400; } .kp-drop .kp-mic { width: 28px; height: 28px; border-radius: 50%; background: var(--bad); }
/* Link/Text: kein prompt() mehr, sondern ein Feld, das immer offen dasteht. */
.kp-paste { min-height: 88px; align-self: start; border-radius: var(--r-lg); background: var(--surface-2); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.kp-paste > span { font-size: 11.5px; color: var(--muted-2); }
.kp-paste-row { display: flex; align-items: flex-end; gap: 8px; flex: 1; }
.kp-paste textarea { flex: 1; min-height: 38px; max-height: 76px; height: 38px; resize: none; overflow-y: auto; line-height: 18px; padding: 9px 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.kp-paste button { width: 34px; height: 38px; flex-shrink: 0; border: 0; border-radius: var(--r); background: var(--accent); color: #fff; font-size: 15px; cursor: pointer; }
.kp-paste button[disabled] { background: var(--line); color: var(--muted-2); cursor: default; }

/* Drei Schritte ueber dem Drop-In */
.kp-flow-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12.5px; color: var(--muted-2); max-width: 760px; width: 100%; align-self: center; }
.kp-flow-steps b { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; }
.kp-flow-steps b i { font-style: normal; width: 18px; height: 18px; border-radius: 50%; background: var(--line); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 600; }
.kp-flow-steps b.is-current { color: var(--ink); font-weight: 600; }
.kp-flow-steps b.is-current i { background: var(--accent); color: #fff; }
.kp-flow-steps b.is-done i { background: var(--ok); color: #fff; }
.kp-flow-sep { color: var(--disabled); }
.kp-manual { max-width: 760px; width: 100%; align-self: center; font-size: 12.5px; }
.kp-manual a { color: var(--muted); text-decoration: underline; }
.kp-manual a:hover { color: var(--accent); }
.kp-segment { display: flex; gap: 4px; font-size: 13px; background: var(--surface-2); border-radius: 8px; padding: 3px; }
.kp-segment a { padding: 4px 10px; border-radius: 6px; color: var(--muted); } .kp-segment a.is-active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: var(--shadow-card); }
.kp-fill[hidden] { display: none; }
.kp-fill { display: flex; flex-direction: column; gap: 14px; max-width: 760px; width: 100%; align-self: center; }
.kp-fill-status { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.kp-fill-status .kp-dot.is-pulse { animation: kp-pulse 1s ease-in-out infinite; } .kp-fill-status.is-done { color: var(--ok); }
.kp-fill-status.is-error { color: var(--bad); } .kp-dot.is-bad { background: var(--bad); }
.kp-fill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kp-field small { display: block; font-size: 12px; color: var(--muted-2); margin-bottom: 4px; }
.kp-field .kp-value { height: 40px; border-radius: var(--r); background: var(--surface-2); display: flex; align-items: center; padding: 0 12px; font-size: 14px; position: relative; overflow: hidden; }
.kp-field .kp-value.is-filled span { animation: kp-in .4s ease-out both; }
.kp-field .kp-value.is-active::after { content: ""; position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, rgba(0,113,227,.10), rgba(0,113,227,.25)); animation: kp-fill .9s linear both; }
.kp-field .kp-value.is-empty::before { content: ""; width: 90px; height: 10px; border-radius: 5px; background: var(--line); }
.kp-field .kp-value > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kp-field .kp-value.is-filled { cursor: pointer; }
.kp-field .kp-value.is-none { color: var(--muted-2); font-size: 12.5px; }
.kp-caret { display: inline-block; width: 1px; height: 16px; background: var(--ink); margin-left: 2px; flex-shrink: 0; animation: kp-pulse .7s steps(2) infinite; }
.kp-reveal { animation: kp-reveal .45s ease-out both; }
@keyframes kp-reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.kp-field input { width: 100%; height: 40px; background: var(--surface-2); border: 0; }
@keyframes kp-fill { from { width: 0; } to { width: 100%; } }
@keyframes kp-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes kp-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.kp-burst { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.kp-burst i { position: absolute; width: 6px; height: 6px; border-radius: 50%; animation: kp-burst 1.4s ease-out forwards; opacity: 0; }
@keyframes kp-burst { from { transform: translate(0,0) scale(.6); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(1); opacity: 0; } }

/* Grundsätze / Einstellungen */
.kp-flow { display: grid; grid-template-columns: 1fr 40px 1fr 40px 1fr; align-items: center; }
.kp-flow .kp-arrow { text-align: center; color: var(--disabled); font-size: 20px; }
.kp-card { background: var(--surface-2); border-radius: var(--r-xl); padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.kp-card h3 { margin: 0; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.kp-card p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.kp-card .kp-num { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: auto; } .kp-card .kp-num small { font-size: 12.5px; color: var(--muted-2); font-weight: 400; }
.kp-card .kp-glyph { width: 36px; height: 36px; border-radius: 10px; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.kp-loop { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); padding: 0 4px; } .kp-loop::before, .kp-loop::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.kp-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.kp-roles-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 640px; }
.kp-roles-pick button { padding: 12px; border-radius: 10px; background: var(--surface-2); border: 0; font: inherit; font-size: 13.5px; cursor: pointer; } .kp-roles-pick button.is-active { background: var(--ink); color: #fff; font-weight: 600; }
.kp-setting { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; max-width: 640px; }
.kp-toggle { width: 40px; height: 24px; border-radius: 12px; background: var(--line); position: relative; border: 0; cursor: pointer; } .kp-toggle::after { content: ""; position: absolute; left: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .15s; }
.kp-toggle.is-on { background: var(--ok); } .kp-toggle.is-on::after { left: 18px; }

/* Gerenderte Beschreibung im Antrag */
.kp-markdown h2, .kp-markdown h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 6px; }
.kp-markdown p, .kp-markdown li { font-size: 14px; line-height: 1.55; }
.kp-markdown table { border-collapse: collapse; font-size: 13px; }
.kp-markdown th, .kp-markdown td { border: 1px solid var(--line); padding: 5px 9px; text-align: left; }

/* --- Antwort mit Quellenzitat (Paket 10 in der Kompass-Suche) -------------
   Der Beleg steht ueber der Aussage und ist typografisch abgesetzt: was im
   Dokument steht, soll nicht wie das aussehen, was das Modell daraus macht.
   Alles bleibt in einer Zeile, der Kasten waechst nur so weit wie noetig. */
.kp-fakt { display: flex; flex-direction: column; gap: 6px; padding: 0 0 14px; }
.kp-fakt + .kp-fakt { border-top: 1px solid var(--line-soft); padding-top: 14px; }

.kp-zitat {
  width: fit-content; max-width: 100%;
  margin: 0; padding: 7px 12px;
  border-left: 3px solid var(--warn);
  background: #fff8e6;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 14px; line-height: 1.5; color: var(--ink);
}
.kp-zitat-label {
  font-family: var(--font); font-size: 10.5px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
  color: #a6690a; margin-right: 8px;
}
/* Anfuehrungszeichen haengen am Text, nicht am Block - sonst landet das
   schliessende Zeichen auf einer eigenen Zeile. */
.kp-zitat-text::before { content: "„"; }
.kp-zitat-text::after  { content: "“"; }

.kp-zitat-quelle {
  font-family: var(--font); font-size: 12px; font-style: normal;
  color: var(--muted); margin-left: 8px; white-space: nowrap;
}
.kp-zitat-quelle::before { content: "— "; }

.kp-fakt-aussage { margin: 0; font-size: 14px; line-height: 1.55; }

/* Ohne Beleg: sichtbar machen, nicht verstecken. */
.kp-zitat-fehlt {
  width: fit-content; max-width: 100%;
  margin: 0; padding: 7px 12px;
  border-left: 3px solid var(--bad);
  background: #ffefee;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 12.5px; color: var(--muted);
}
.kp-fakt.is-unbelegt .kp-fakt-aussage { color: var(--muted); }

/* ---------------------------------------------------------------------------
   Responsive
   Die Shell ist fuer breite Fenster gebaut: feste Seitenleiste von 208px und
   Tabellen mit bis zu neun Spalten. Zwei Stufen darunter.
   --------------------------------------------------------------------------- */

/* Tablet und schmales Fenster: mehrspaltige Raster halbieren bzw. stapeln,
   breite Tabellen scrollen in sich statt die Seite zu sprengen. */
@media (max-width: 1000px) {
  .kp-main { padding: 22px 20px 26px; gap: 18px; }

  /* Neun Spalten passen hier nicht. Statt sie zu quetschen, scrollt die
     Tabelle waagerecht - der Seitenkoerper bleibt unverschoben. */
  .kp-table { overflow-x: auto; }
  .kp-tr { min-width: 880px; }
  .kp-markdown table { display: block; overflow-x: auto; max-width: 100%; }

  .kp-layout-detail,
  .kp-graph-wrap,
  .kp-role-detail { grid-template-columns: minmax(0, 1fr); }
  .kp-facts,
  .kp-role-cards,
  .kp-roles-pick,
  .kp-grid-3,
  .kp-missing { grid-template-columns: repeat(2, 1fr); }
  .kp-kpis { flex-wrap: wrap; gap: 18px 24px; }
}

/* Telefon: Seitenleiste wird zur Kopfleiste. Bewusst nicht die eingeklappte
   Variante - die blendet nur die Beschriftungen aus, und da es keine Icons
   gibt, waere die Navigation dann leer. */
@media (max-width: 760px) {
  .kp-app, .kp-app.is-collapsed { flex-direction: column; }
  .kp-side,
  .kp-app.is-collapsed .kp-side {
    width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center;
    gap: 6px 12px; padding: 10px 14px; border-bottom: 1px solid var(--line);
  }
  /* Ein gespeichertes kp_collapsed darf die Beschriftungen hier nicht
     verstecken, sonst bleiben leere Schaltflaechen stehen. */
  .kp-app.is-collapsed .kp-side .kp-label { display: inline; }
  .kp-collapse { display: none; }
  .kp-brand { margin-bottom: 0; padding: 0; flex: 0 0 auto; }
  .kp-nav { display: flex; flex-wrap: wrap; gap: 2px; margin-left: auto; }
  .kp-side-bottom { margin-top: 0; flex-direction: row; align-items: center;
                    gap: 10px; flex: 1 1 100%; }
  .kp-side-bottom .kp-user { margin-left: auto; padding: 4px 8px; }
  .kp-side-bottom .kp-secondary { padding: 4px 8px; }

  .kp-main { padding: 18px 14px 22px; gap: 16px; }
  h1 { font-size: 21px; }
  /* Titel und Suche untereinander: nebeneinander bleibt fuer beides zu wenig. */
  .kp-head { flex-wrap: wrap; align-items: flex-start; gap: 10px; }
  .kp-head > form { flex: 1 1 100%; }

  .kp-facts,
  .kp-role-cards,
  .kp-roles-pick,
  .kp-grid-3,
  .kp-missing,
  .kp-fill-grid,
  .kp-drop-row,
  .kp-flow { grid-template-columns: minmax(0, 1fr); }
  /* Die Pfeile zwischen den Schritten ergeben senkrecht keinen Sinn. */
  .kp-flow .kp-arrow { display: none; }

  .kp-kpis { gap: 14px 20px; }
  .kp-kpi.is-right { margin-left: 0; text-align: left; }
  .kp-kpi b { font-size: 24px; }
  .kp-setting { gap: 12px; }
  .kp-footer { flex-direction: column; align-items: flex-start; gap: 8px; }
}
