:root {
  --bg: #f6f7fa;
  --panel: #ffffff;
  --panel-light: #f1f3f5;
  --border: #e2e5ea;
  --text: #1a1d24;
  --text-dim: #6b7280;
  --accent: #2563eb;
  --accent-dim: #93c5fd;
  --ok: #16a34a;
  --warn: #d97706;
  --err: #dc2626;
  --skeptic: #dc2626;
  --cfo: #16a34a;
  --market: #2563eb;
  --forecaster: #9333ea;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--text); font-family: BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; font-size: 14px; line-height: 1.5; }

#app { height: 100vh; display: flex; flex-direction: column; }

/* Header */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.app-header h1 { font-size: 18px; letter-spacing: -0.3px; color: var(--text); }
.app-header h1 small { font-weight: 400; color: var(--text-dim); margin-left: 8px; font-size: 12px; }
.app-header .actions { display: flex; gap: 8px; align-items: center; }
.run-status {
  font-size: 12px; color: var(--text-dim); padding: 4px 10px; border-radius: 12px; background: var(--panel-light);
}
.run-status.running { color: var(--warn); }
.run-status.done { color: var(--ok); }
.run-status.failed { color: var(--err); }
.btn {
  background: var(--accent); color: #fff; border: 0; padding: 8px 16px;
  border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600;
}
.btn:hover { background: #1d4ed8; }
.btn:disabled { background: var(--accent-dim); cursor: wait; }
.btn-secondary { background: var(--panel-light); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }

/* Query Bar */
.query-bar {
  padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.qb-row { display: flex; gap: 10px; align-items: center; }
.qb-row-end { justify-content: space-between; }
.qb-select {
  flex: 1; padding: 8px 10px; background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px; font: inherit;
}
.qb-textarea {
  width: 100%; padding: 8px 10px; background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px; font: inherit;
  resize: vertical; min-height: 50px;
}
.qb-textarea:focus, .qb-select:focus { outline: 2px solid var(--accent); outline-offset: -2px; border-color: transparent; }
.qb-hint { color: var(--text-dim); font-size: 12px; }
.qb-hint a { color: var(--accent); text-decoration: none; }
.qb-hint a:hover { text-decoration: underline; }

/* Phase Stepper – compact strip */
.stepper {
  display: flex; padding: 6px 12px; gap: 4px;
  background: var(--panel); border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.step {
  flex: 1; min-width: 92px; padding: 5px 8px; border-radius: 6px;
  background: var(--panel-light); border: 1px solid var(--border);
  transition: all 0.3s ease; font-size: 11px;
}
.step .step-meta { display: none; }
.step.active .step-meta { display: block; font-size: 10px; margin-top: 2px; }
.step .progress-bar { margin-top: 4px; }
.step-num { width: 18px; height: 18px; line-height: 18px; font-size: 10px; margin-right: 5px; }
.step-name { font-size: 11px; }
.step.active { border-color: var(--accent); background: #dbeafe; }
.step.done { border-color: var(--ok); background: #dcfce7; }
.step.failed { border-color: var(--err); background: #fee2e2; }
.step-num {
  display: inline-block; width: 22px; height: 22px; border-radius: 50%;
  background: var(--border); text-align: center; line-height: 22px; font-size: 11px; font-weight: 700; color: var(--text-dim);
  margin-right: 8px;
}
.step.active .step-num { background: var(--accent); color: #fff; }
.step.done .step-num { background: var(--ok); color: #fff; }
.step-name { display: inline-block; font-size: 12px; font-weight: 600; vertical-align: middle; color: var(--text); }
.step-meta { display: block; font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.step .progress-bar { height: 3px; background: var(--border); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.step .progress-bar > div { height: 100%; background: var(--accent); transition: width 0.3s ease; }
.step.done .progress-bar > div { background: var(--ok); }

/* Layout: graph as smaller side rail, tabs as main canvas */
.workspace {
  flex: 1; display: grid; grid-template-columns: minmax(260px, 28%) 1fr; gap: 1px;
  background: var(--border); min-height: 0; overflow: hidden;
}
.left-pane, .right-pane { background: var(--bg); overflow: hidden; display: flex; flex-direction: column; }
.right-pane { display: flex; flex-direction: column; }

/* Tab bar in the right pane */
.tab-bar {
  display: flex; gap: 0; background: var(--panel-light);
  border-bottom: 1px solid var(--border); padding: 0 4px;
  overflow-x: auto; flex-shrink: 0;
}
.tab {
  background: transparent; border: 0; border-bottom: 3px solid transparent;
  padding: 10px 16px; cursor: pointer; font-size: 13px; font-weight: 600;
  color: var(--text-dim); display: inline-flex; align-items: center; gap: 6px;
  transition: color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.tab:hover:not(.disabled) { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); background: var(--panel); }
.tab.disabled { opacity: 0.4; cursor: not-allowed; }
.tab-count {
  background: var(--border); color: var(--text); font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 8px; min-width: 16px; text-align: center;
}
.tab.active .tab-count { background: var(--accent); color: #fff; }

.tab-content {
  flex: 1; overflow: hidden; display: flex; flex-direction: column;
  background: var(--panel);
}
.tab-content > * { flex: 1; overflow-y: auto; max-height: none !important; border-bottom: 0 !important; }

/* Panels */
.panel { padding: 14px 18px; background: var(--panel); }
.panel h3 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-dim);
  margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between;
}
.panel h3 .count {
  background: var(--panel-light); padding: 2px 8px; border-radius: 10px;
  font-size: 10px; color: var(--text); letter-spacing: 0.5px; border: 1px solid var(--border);
}
.panel.scrollable { overflow-y: auto; }

/* Graph */
.graph-panel { flex: 1; display: flex; flex-direction: column; background: var(--panel); }
.graph-panel .graph-wrap { flex: 1; overflow: hidden; background: #fbfbfd; position: relative; border-top: 1px solid var(--border); }
.graph-panel svg { display: block; width: 100%; height: 100%; }
.graph-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 13px; pointer-events: none;
}
.node circle { stroke: var(--panel); stroke-width: 2.5; cursor: pointer; }
.node text {
  fill: var(--text); font-size: 12px; font-weight: 500;
  pointer-events: none;
  paint-order: stroke; stroke: rgba(255,255,255,0.85); stroke-width: 3px;
}
.node.entity-Firma circle, .node.entity-Unternehmen circle { fill: var(--accent); }
.node.entity-Marktsegment circle { fill: var(--ok); }
.node.entity-Regulator circle, .node.entity-RegulatorischeAnforderung circle, .node.entity-Regulatorik circle { fill: var(--err); }
.node.entity-Konkurrent circle, .node.entity-Wettbewerber circle { fill: var(--warn); }
.node.entity-Personalkapazitaet circle, .node.entity-Personal circle { fill: #c084fc; }
.node.entity-Investitionsoption circle, .node.entity-Kapitalverwendung circle { fill: #0891b2; }
.node.entity-Risiko circle { fill: #ef4444; }
.node.entity-Wachstumsstrategie circle { fill: #14b8a6; }
.node.entity-Technologie circle { fill: #6366f1; }
.node.entity-default circle { fill: var(--text-dim); }
.node circle.pulse { stroke: var(--accent); }
.node.entity-Firma circle.pulse, .node.entity-Unternehmen circle.pulse { stroke: var(--accent); }
.node.entity-Marktsegment circle.pulse { stroke: var(--ok); }
.node.entity-Regulator circle.pulse, .node.entity-RegulatorischeAnforderung circle.pulse { stroke: var(--err); }
.node.entity-Konkurrent circle.pulse { stroke: var(--warn); }
.node.entity-Personalkapazitaet circle.pulse { stroke: #c084fc; }
.edge { stroke: #4b5563; stroke-width: 2; opacity: 0.7; }
.edge-label { fill: var(--text-dim); font-size: 10px; }

.graph-wrap { cursor: grab; }
.graph-wrap:active { cursor: grabbing; }
.graph-hint {
  position: absolute; left: 12px; bottom: 8px;
  font-size: 11px; color: var(--text-dim); opacity: 0.7;
  pointer-events: none;
}
.graph-fit-btn {
  background: var(--panel); color: var(--text); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 4px; font-size: 11px; cursor: pointer;
  margin-left: 6px;
}
.graph-fit-btn:hover { background: var(--panel-light); }

/* Quant */
.quant-panel .quant-result {
  background: var(--panel-light); padding: 10px 12px; border-radius: 6px;
  margin-bottom: 8px; border-left: 3px solid var(--accent);
}
.quant-panel .quant-decision { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.quant-panel .quant-options { display: flex; gap: 12px; }
.quant-panel .quant-option { flex: 1; }
.quant-panel .quant-option-name { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.quant-panel .quant-range { font-family: monospace; font-size: 12px; margin-top: 2px; color: var(--text); }
.quant-panel .quant-bar {
  height: 14px; background: linear-gradient(to right, #fecaca 0%, #fde68a 30%, #bbf7d0 50%, #86efac 100%);
  border-radius: 3px; margin-top: 4px; position: relative;
}
.quant-panel .quant-bar .p50-marker {
  position: absolute; top: -2px; bottom: -2px; width: 3px; background: var(--text);
}
.quant-panel .sensitivity { margin-top: 8px; font-size: 11px; color: var(--text-dim); }
.quant-panel .sensitivity strong { color: var(--text); }

/* Adjust UI */
.quant-panel .adjust-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
  font-size: 11px; line-height: 1; padding: 1px 6px; border-radius: 4px;
  cursor: pointer; margin-left: 6px;
}
.quant-panel .adjust-btn:hover { background: var(--panel); color: var(--accent); border-color: var(--accent); }
.quant-panel .quant-adjusted {
  margin-top: 6px; padding: 6px 8px; background: #fef3c7; border-radius: 4px;
  border-left: 3px solid var(--warn);
}
.quant-panel .adj-tag {
  font-size: 9px; text-transform: uppercase; letter-spacing: 1px; color: var(--warn); font-weight: 700;
}
.quant-panel .adj-delta {
  font-size: 11px; color: var(--text); margin-top: 2px; font-family: monospace;
}
.quant-panel .adjust-panel {
  background: var(--panel); border: 1px dashed var(--border); border-radius: 6px;
  padding: 10px 12px; margin-top: 8px;
}
.quant-panel .adjust-head { margin-bottom: 8px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.quant-panel .adjust-hint { font-size: 11px; color: var(--text-dim); }
.quant-panel .adjust-vars { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.quant-panel .adjust-var { background: var(--panel-light); padding: 6px 8px; border-radius: 4px; }
.quant-panel .adjust-var-head { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 4px; }
.quant-panel .adjust-var-name { color: var(--text); font-weight: 600; font-family: monospace; }
.quant-panel .adjust-var-kind { color: var(--text-dim); font-size: 10px; text-transform: uppercase; }
.quant-panel .adjust-var-fields { display: flex; flex-wrap: wrap; gap: 4px; }
.quant-panel .adjust-field { display: flex; flex-direction: column; flex: 1; min-width: 64px; }
.quant-panel .adjust-field > span { font-size: 10px; color: var(--text-dim); }
.quant-panel .adjust-field > input {
  width: 100%; padding: 3px 5px; font: inherit; font-size: 11px;
  border: 1px solid var(--border); border-radius: 3px; background: var(--panel);
}
.quant-panel .adjust-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.quant-panel .adjust-error { color: var(--err); font-size: 11px; }
.quant-panel .adjust-result {
  margin-top: 12px; padding: 10px 12px; background: #fef3c7; border-radius: 6px;
  border-left: 4px solid var(--warn);
}
.quant-panel .adj-compare { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 6px; }
.quant-panel .adj-col { background: var(--panel); padding: 8px 10px; border-radius: 4px; }
.quant-panel .adj-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim);
  margin-bottom: 4px; font-weight: 700;
}
.quant-panel .adj-row { font-size: 12px; font-family: monospace; padding: 1px 0; color: var(--text); }
.quant-panel .adj-row strong { color: var(--text); }
.quant-panel .adj-delta-big { font-size: 16px; color: var(--warn); }

/* Debate */
.debate-panel { }
.debate-turn {
  display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border);
}
.debate-turn:last-child { border-bottom: 0; }
.debate-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.debate-avatar.skeptic { background: var(--skeptic); }
.debate-avatar.cfo { background: var(--cfo); }
.debate-avatar.market_analyst { background: var(--market); }
.debate-avatar.superforecaster { background: var(--forecaster); }
.debate-avatar.default { background: var(--text-dim); }
.debate-body { flex: 1; }
.debate-role { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.debate-statement { font-size: 13px; margin-top: 2px; color: var(--text); }

/* Report */
.report-panel { }
.report-section { padding: 8px 0; border-bottom: 1px solid var(--border); }
.report-section:last-child { border-bottom: 0; }
.report-section h4 { font-size: 13px; margin-bottom: 4px; color: var(--text); }
.report-section .md { font-size: 12px; color: var(--text); }

/* Node Drilldown Panel */
@keyframes nodePanelIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
.node-panel {
  position: fixed; width: 360px; max-height: 60vh;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
  z-index: 50;
  animation: nodePanelIn 0.18s ease-out;
  transform-origin: top left;
  padding: 14px 16px; overflow-y: auto; z-index: 10;
}
.node-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.np-type { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.np-label { font-size: 14px; font-weight: 600; margin-top: 2px; }
.np-close {
  background: transparent; border: 0; cursor: pointer; font-size: 22px;
  color: var(--text-dim); line-height: 1; padding: 0 4px;
}
.np-close:hover { color: var(--text); }
.np-rationale { font-size: 12px; color: var(--text); margin-top: 8px; line-height: 1.45; }
.np-source {
  display: inline-block; margin-top: 8px; font-size: 12px;
  color: var(--accent); text-decoration: none;
}
.np-source:hover { text-decoration: underline; }
.np-edges { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.np-edges-head { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.np-edge {
  display: grid; grid-template-columns: 1fr auto; gap: 4px; align-items: center;
  font-size: 11px; padding: 4px 0; border-bottom: 1px dotted var(--border);
}
.np-edge:last-child { border-bottom: 0; }
.np-rel { font-family: monospace; color: var(--accent); font-size: 10px; grid-column: 2; }
.np-other { color: var(--text); font-weight: 500; grid-column: 1; }
.np-other-type { color: var(--text-dim); font-size: 10px; grid-column: 1 / -1; }

/* Followup Panel */
.followup-panel { background: var(--panel-light); display: flex; flex-direction: column; }
.followup-list { flex: 1; overflow-y: auto; padding: 4px 0; }
.followup-turn { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.followup-turn:last-child { border-bottom: 0; }
.followup-turn.user .ft-content { color: var(--text); font-weight: 500; }
.followup-turn.assistant .ft-content { color: var(--text); }
.ft-role { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.ft-time { color: #9ca3af; margin-left: 6px; text-transform: none; letter-spacing: normal; }
.ft-content { font-size: 13px; }
.ft-content.md p { margin: 4px 0; }
.ft-content.md ul { margin: 4px 0 4px 18px; }
.followup-form { display: flex; gap: 8px; margin-top: 8px; align-items: flex-end; }
.followup-form textarea {
  flex: 1; padding: 8px 10px; background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px; font: inherit; resize: vertical;
  min-height: 44px;
}
.followup-form textarea:focus { outline: 2px solid var(--accent); outline-offset: -2px; border-color: transparent; }
.followup-error { color: var(--err); font-size: 12px; margin-top: 6px; }

/* Activity log */
.activity {
  padding: 8px 18px; background: var(--panel-light); border-top: 1px solid var(--border);
  max-height: 100px; overflow-y: auto; font-family: monospace; font-size: 11px;
  color: var(--text-dim);
}
.activity .line { padding: 2px 0; }
.activity .ev-phase_start, .activity .ev-phase_end { color: var(--accent); }
.activity .ev-graph_node, .activity .ev-graph_edge { color: var(--ok); }
.activity .ev-quant_result { color: var(--warn); }
.activity .ev-debate_turn { color: var(--skeptic); }
.activity .ev-run_done { color: var(--ok); font-weight: 700; }
.activity .ev-run_failed { color: var(--err); font-weight: 700; }
.activity .timestamp { color: #9ca3af; margin-right: 8px; }

.placeholder { color: var(--text-dim); font-style: italic; font-size: 12px; }

/* ============ Auth-Pages (Login / Register / Verify / Reset) ============ */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 24px;
}
.auth-card {
  width: 100%; max-width: 420px; background: var(--panel); border-radius: 14px;
  padding: 36px 32px; box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
}
.auth-brand {
  font-size: 26px; font-weight: 700; letter-spacing: -0.5px;
  margin: 0 0 4px; color: var(--text);
}
.auth-sub { font-size: 14px; color: var(--text-dim); margin: 0 0 24px; }
.auth-hint { font-size: 13px; color: var(--text-dim); margin: 0 0 16px; line-height: 1.5; }
.auth-field { display: block; margin-bottom: 14px; }
.auth-field > span {
  display: block; font-size: 12px; font-weight: 600; color: var(--text);
  margin-bottom: 5px;
}
.auth-field .req { color: var(--err); margin-left: 2px; }
.auth-field input {
  width: 100%; padding: 9px 12px; font: inherit; font-size: 14px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--panel);
  color: var(--text);
}
/* ============ Quant Klartext + Tooltips ============ */
.quant-intro {
  font-size: 13px; color: var(--text-dim); line-height: 1.5;
  margin: 6px 0 14px; padding: 10px 12px; background: rgba(0,0,0,0.025);
  border-left: 3px solid var(--accent); border-radius: 4px;
}
.quant-range { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; margin-top: 4px; }
.quant-range span[title] { cursor: help; border-bottom: 1px dotted rgba(0,0,0,0.25); }
.quant-range .sep { color: var(--text-dim); cursor: default; border: none; }
.quant-explain {
  font-size: 12.5px; line-height: 1.5; color: var(--text);
  margin-top: 8px; padding: 8px 10px; background: #f8fafc; border-radius: 4px;
}
.sensitivity-explain { font-size: 12px; color: var(--text-dim); margin-top: 4px; line-height: 1.5; }

/* ============ Datenverankerung (grounding / provenance) ============ */
.quant-grounding {
  margin: 4px 0 14px; padding: 9px 11px; border-radius: 4px;
  border-left: 3px solid var(--text-dim); background: rgba(0,0,0,0.025);
}
.quant-grounding.ground-good { border-left-color: var(--ok); background: rgba(22,163,74,0.06); }
.quant-grounding.ground-mid  { border-left-color: var(--warn); background: rgba(217,119,6,0.06); }
.quant-grounding.ground-low  { border-left-color: var(--err); background: rgba(220,38,38,0.06); }
.quant-grounding .qg-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.quant-grounding .qg-badge {
  font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 10px;
  color: #fff; background: var(--text-dim);
}
.ground-good .qg-badge { background: var(--ok); }
.ground-mid  .qg-badge { background: var(--warn); }
.ground-low  .qg-badge { background: var(--err); }
.quant-grounding .qg-metric { display: inline-flex; gap: 6px; align-items: center; padding-right: 4px; }
.quant-grounding .qg-metric + .qg-metric { border-left: 1px solid var(--border); padding-left: 12px; }
.quant-grounding .qg-badge.ground-good { background: var(--ok); }
.quant-grounding .qg-badge.ground-mid  { background: var(--warn); }
.quant-grounding .qg-badge.ground-low  { background: var(--err); }
.quant-grounding .qg-label { font-size: 12.5px; font-weight: 600; color: var(--text); }
.quant-grounding .qg-crit { font-size: 11.5px; color: var(--err); font-weight: 600; cursor: help; }
.quant-grounding .qg-text { font-size: 12px; color: var(--text-dim); line-height: 1.5; margin-top: 5px; }

.quant-opt-grounding { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; font-size: 11.5px; }
.qog-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); flex: none; }
.qog-dot.ground-good { background: var(--ok); }
.qog-dot.ground-mid  { background: var(--warn); }
.qog-dot.ground-low  { background: var(--err); }
.qog-text { color: var(--text-dim); }
.qog-crit { color: var(--err); cursor: help; font-weight: 600; }

.prov-badge {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700;
  padding: 1px 6px; border-radius: 8px; cursor: help; color: #fff;
}
.prov-badge.prov-measured { background: var(--ok); }
.prov-badge.prov-derived  { background: var(--accent); }
.prov-badge.prov-user     { background: var(--forecaster); }
.prov-badge.prov-estimate { background: var(--warn); }
.prov-widened {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700;
  padding: 1px 6px; border-radius: 8px; cursor: help;
  background: rgba(220,38,38,0.12); color: var(--err);
}
.prov-anchor {
  font-size: 10.5px; color: var(--text-dim); margin: 2px 0 0; padding-left: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}

/* ============ Graph Subtitle + Live-Indicator ============ */
.graph-subtitle {
  font-size: 12.5px; color: var(--text-dim); line-height: 1.5;
  padding: 4px 0 2px; transition: color 0.3s;
}
.graph-subtitle.live { color: var(--text); }
.graph-stats { transition: color 0.3s; }
.graph-stats.active { color: var(--accent); font-weight: 600; }
.thinking-dots { display: inline-block; animation: thinking 1.4s infinite; letter-spacing: 2px; }
@keyframes thinking {
  0%, 80%, 100% { opacity: 0.3; }
  40% { opacity: 1; }
}

/* ============ Stepper Pulse + Active Highlight ============ */
.step.active { background: linear-gradient(90deg, rgba(56, 132, 255, 0.06), transparent); border-left: 3px solid var(--accent); padding-left: 9px; }
.step-pulse {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-left: 8px; vertical-align: middle;
  animation: stepPulse 1.4s infinite;
}
@keyframes stepPulse {
  0% { box-shadow: 0 0 0 0 rgba(56, 132, 255, 0.5); opacity: 1; }
  70% { box-shadow: 0 0 0 8px rgba(56, 132, 255, 0); opacity: 0.6; }
  100% { box-shadow: 0 0 0 0 rgba(56, 132, 255, 0); opacity: 1; }
}
.step-msg { font-style: italic; }
.step.active .step-msg { color: var(--text); }
.step-dur { color: var(--text-dim); font-style: normal; }
.step-meta-pending { color: var(--text-dim); opacity: 0.6; }

.run-history { padding: 0 24px 12px; }
.rh-head { font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.rh-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.rh-item {
  position: relative; flex: 0 0 240px; min-width: 240px; max-width: 240px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
}
.rh-item:hover { border-color: var(--accent); background: rgba(0,0,0,0.02); }
.rh-item.active { border-color: var(--accent); background: rgba(0,0,0,0.04); }
.rh-main {
  display: block; width: 100%; text-align: left; padding: 8px 28px 8px 10px;
  background: none; border: none; cursor: pointer; font: inherit;
}
.rh-main:disabled { opacity: 0.5; cursor: not-allowed; }
.rh-del {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px;
  background: none; border: none; border-radius: 4px; cursor: pointer;
  color: var(--text-dim); font-size: 16px; line-height: 1;
}
.rh-del:hover:not(:disabled) { color: var(--err); background: #fee2e2; }
.rh-del:disabled { opacity: 0.3; cursor: not-allowed; }
.rh-row1 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; font-size: 11px; }
.rh-status { padding: 1px 6px; border-radius: 4px; font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: 0.3px; }
.rh-status.ok { background: #dcfce7; color: #166534; }
.rh-status.err { background: #fee2e2; color: #991b1b; }
.rh-status.pending { background: #fef3c7; color: #92400e; }
.rh-time { color: var(--text-dim); font-size: 11px; }
.rh-q { font-size: 12px; line-height: 1.35; color: var(--text); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ============ Klartext Quant-Updates (Diff-Block) ============ */
/* ============ Klartext „Agent denkt"-Theater ============ */
.klartext-thinking {
  padding: 28px 24px; border-radius: 10px;
  background: linear-gradient(135deg, #f0f9ff, #ecfeff);
  border: 1px solid #bae6fd; text-align: center; animation: ktSlide 0.3s ease-out;
}
@keyframes ktSlide {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.kt-spinner {
  width: 38px; height: 38px; margin: 0 auto 14px;
  border: 3px solid #bae6fd; border-top-color: #06b6d4;
  border-radius: 50%; animation: ktSpin 0.9s linear infinite;
}
@keyframes ktSpin { to { transform: rotate(360deg); } }
.kt-title { font-weight: 700; font-size: 16px; color: #0e7490; margin-bottom: 14px; }
.kt-steps { text-align: left; max-width: 460px; margin: 0 auto 16px; display: flex; flex-direction: column; gap: 6px; }
.kt-step {
  font-size: 13px; padding: 8px 10px; border-radius: 5px; transition: all 0.4s;
  color: var(--text-dim); background: rgba(255,255,255,0.4);
}
.kt-step.active {
  color: #0e7490; background: white; font-weight: 600;
  box-shadow: 0 1px 3px rgba(6,182,212,0.2);
  animation: ktStepPulse 1.4s ease-in-out infinite;
}
.kt-step.done { color: #047857; opacity: 0.7; }
.kt-step.done::before { content: '✓ '; font-weight: 700; }
@keyframes ktStepPulse {
  0%, 100% { background: white; }
  50% { background: #ecfeff; }
}
.kt-foot { font-size: 12px; color: var(--text-dim); font-style: italic; max-width: 460px; margin: 0 auto; line-height: 1.5; }

.header-thinking {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; background: #ecfeff; border: 1px solid #67e8f9;
  color: #0e7490; font-size: 12px; font-weight: 600; border-radius: 999px;
  animation: ktSlide 0.25s ease-out;
}

/* Live-reload overlay on other tabs while a Klartext update is running */
.panel.live-reload { position: relative; }
.panel.live-reload > h3,
.panel.live-reload > .placeholder,
.panel.live-reload > div:not(.reload-badge) {
  opacity: 0.45; transition: opacity 0.3s; pointer-events: none;
}
.reload-badge {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 5; padding: 6px 14px; background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: white; font-size: 12.5px; font-weight: 600; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.35);
  animation: badgePulse 1.6s ease-in-out infinite;
  white-space: nowrap;
}
@keyframes badgePulse {
  0%, 100% { transform: translateX(-50%) scale(1); box-shadow: 0 4px 12px rgba(6, 182, 212, 0.35); }
  50% { transform: translateX(-50%) scale(1.05); box-shadow: 0 6px 18px rgba(6, 182, 212, 0.55); }
}

/* Tab-bar: active tab pulses softly during reload */
.tab.active.during-reload { animation: tabPulse 1.6s ease-in-out infinite; }
@keyframes tabPulse {
  0%, 100% { background: rgba(6, 182, 212, 0.05); }
  50% { background: rgba(6, 182, 212, 0.18); }
}

/* ============ Sources-Panel (Quellen pro Firma) ============ */
.src-badge {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  background: var(--accent); color: white; font-size: 10px; font-weight: 600;
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  vertical-align: middle;
}
.modal-card.sources-modal {
  width: 95vw; height: 95vh;
  max-width: 1600px; max-height: 1200px;
  overflow-y: auto; padding: 0;
}
.sources-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 12px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel); z-index: 1;
}
.sources-modal-head h2 { margin: 0; font-size: 18px; }
.sources-modal-close {
  background: none; border: none; font-size: 24px; line-height: 1; cursor: pointer;
  color: var(--text-dim); width: 32px; height: 32px; border-radius: 4px;
}
.sources-modal-close:hover { color: var(--err); background: #fee2e2; }

.sources-panel { padding: 20px 24px 28px; }
.sources-head h3 { margin: 0 0 4px; font-size: 16px; }
.sources-sub { margin: 0 0 18px; font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.sources-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; }
@media (max-width: 800px) { .sources-grid { grid-template-columns: 1fr; } }

.sources-drop {
  border: 2px dashed var(--border); border-radius: 8px; padding: 12px 16px;
  text-align: center; transition: all 0.2s; background: #fafafa;
  min-height: 90px;
  display: flex; flex-direction: row; align-items: center; justify-content: center;
  gap: 14px; flex-wrap: wrap;
}
.sources-drop.active {
  border-color: var(--accent); background: rgba(56, 132, 255, 0.08);
  border-style: solid;
}
.sd-icon { font-size: 24px; line-height: 1; color: var(--accent); }
.sd-main { font-weight: 600; font-size: 13px; }
.sd-sub { font-size: 11px; color: var(--text-dim); line-height: 1.3; flex-basis: 100%; margin: 0; }
.sd-btn {
  display: inline-block; padding: 5px 12px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 4px; cursor: pointer; font-size: 12px; font-weight: 500;
}
.sd-btn:hover { border-color: var(--accent); color: var(--accent); }

.sources-pending {
  margin-top: 14px; padding: 14px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px;
}
.sp-head { font-size: 13px; font-weight: 600; margin-bottom: 10px; color: #92400e; }
.sp-warn { color: var(--err); font-weight: 600; margin-left: 6px; }
.sp-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: white;
  border: 1px solid #fde68a; border-radius: 5px; margin-bottom: 6px; font-size: 12.5px;
}
.sp-item.error { background: #fef2f2; border-color: #fecaca; }
.sp-item.done { background: #ecfdf5; border-color: #a7f3d0; }
.sp-name { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-size { color: var(--text-dim); font-size: 11px; }
.sp-error { color: var(--err); font-size: 12px; font-weight: 500; }
.sp-ok { color: #047857; font-weight: 600; }
.sp-x {
  background: none; border: none; cursor: pointer; color: var(--text-dim);
  width: 22px; height: 22px; border-radius: 4px; font-size: 16px; line-height: 1;
}
.sp-x:hover:not(:disabled) { color: var(--err); background: #fee2e2; }
.sp-actions {
  display: flex; gap: 8px; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid #fde68a;
}
.sp-actions .btn { flex: 1; }
.sp-actions .btn-secondary { flex: 0; padding-left: 16px; padding-right: 16px; }

.sources-note-form { margin-top: 20px; padding: 14px; background: #f8fafc; border-radius: 8px; }
.snf-head { font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.snf-input, .snf-textarea {
  width: 100%; padding: 7px 10px; font: inherit; font-size: 13px;
  border: 1px solid var(--border); border-radius: 5px; margin-bottom: 8px;
  background: var(--panel);
}
.snf-textarea { resize: vertical; min-height: 60px; }
.snf-input:focus, .snf-textarea:focus { outline: 2px solid var(--accent); outline-offset: -2px; border-color: transparent; }

.sources-list-head {
  font-size: 12px; font-weight: 600; color: var(--text-dim); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 10px;
}
.source-card {
  padding: 10px 12px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 6px; margin-bottom: 8px; transition: border-color 0.15s;
}
.source-card:hover { border-color: var(--accent); }
.source-card.expanded { border-color: var(--accent); background: #f8fafc; }
.sc-row1 { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.sc-icon { font-size: 18px; }
.sc-name { flex: 1; font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-chevron { color: var(--text-dim); font-size: 10px; margin-right: 4px; }
.sc-del {
  background: none; border: none; font-size: 18px; line-height: 1; cursor: pointer;
  color: var(--text-dim); padding: 2px 8px; border-radius: 4px;
}
.sc-del:hover { color: var(--err); background: #fee2e2; }
.sc-meta { font-size: 11px; color: var(--text-dim); display: flex; gap: 6px; flex-wrap: wrap; }
.sc-detail {
  margin-top: 10px; padding: 10px 12px; background: white; border: 1px solid var(--border);
  border-radius: 5px; max-height: 320px; overflow: auto;
}
.sc-detail-loading { font-size: 12px; color: var(--text-dim); font-style: italic; }
.sc-detail-text {
  font-size: 12px; line-height: 1.55; white-space: pre-wrap; word-wrap: break-word;
  color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.sc-detail-url { font-size: 13px; }
.sc-detail-empty { font-size: 12px; color: var(--text-dim); font-style: italic; }

/* SourcesPanel v2: Profil-Card + Filter + Edit */
.profile-card {
  margin: 8px 0 18px 0; padding: 14px 16px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 8px; border-left: 3px solid var(--accent);
}
.profile-card.stale { border-left-color: #f59e0b; background: #fffbeb; }
.pc-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pc-title { font-weight: 700; font-size: 14px; }
.pc-meta { flex: 1; font-size: 11px; color: var(--text-dim); }
.pc-when { }
.pc-stale { color: #b45309; font-weight: 600; }
.pc-regen { font-size: 12px; padding: 5px 10px; }
.pc-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px 16px; margin-bottom: 10px;
}
.pc-field { min-width: 0; }
.pc-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); margin-bottom: 2px; }
.pc-value { font-size: 13px; font-weight: 500; word-wrap: break-word; }
.pc-block { margin-top: 10px; }
.pc-text { font-size: 13px; line-height: 1.5; }
.pc-list { font-size: 13px; margin: 4px 0 0 18px; padding: 0; line-height: 1.5; }
.pc-edit-hint {
  background: rgba(6, 182, 212, 0.08); color: #0e7490; font-size: 12px;
  padding: 8px 12px; border-radius: 5px; margin-bottom: 12px; line-height: 1.45;
}
.pc-edit-actions { display: flex; gap: 10px; margin-top: 14px; justify-content: flex-end; }

.sources-filter { display: flex; gap: 4px; margin-bottom: 10px; }
.filter-tab {
  background: none; border: 1px solid var(--border); border-radius: 4px;
  padding: 5px 10px; font-size: 11px; color: var(--text-dim); cursor: pointer;
  font-weight: 500;
}
.filter-tab:hover { border-color: var(--accent); color: var(--text); }
.filter-tab.active { background: var(--accent); border-color: var(--accent); color: white; }

.source-card.auto { background: #fafbfc; }
.sc-badge {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 2px 6px; border-radius: 3px; font-weight: 600;
}
.sc-badge.auto { background: rgba(6, 182, 212, 0.12); color: #0e7490; }
.sc-badge.manual { background: rgba(5, 150, 105, 0.12); color: #047857; }

.sc-edit { display: flex; flex-direction: column; gap: 4px; }
.sc-edit-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); margin-top: 4px; }
.sc-edit-actions { display: flex; gap: 8px; margin-top: 10px; }
.sc-detail-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.btn-sm { padding: 4px 10px; font-size: 11px; }

/* Header: company-settings dropdown */
.hdr-settings-wrap { position: relative; }
.hdr-caret { font-size: 10px; opacity: 0.7; margin-left: 4px; }
.hdr-settings-menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 280px;
  background: white; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.16); padding: 6px; z-index: 1100;
}
.hdr-settings-item {
  display: flex; gap: 12px; align-items: flex-start;
  width: 100%; background: none; border: none; text-align: left;
  padding: 10px 12px; border-radius: 6px; cursor: pointer; font: inherit;
  color: var(--text);
}
.hdr-settings-item:hover:not(:disabled) { background: rgba(6, 182, 212, 0.08); }
.hdr-settings-item:disabled { opacity: 0.4; cursor: not-allowed; }
.hdr-settings-item.danger { color: var(--err); }
.hdr-settings-item.danger:hover:not(:disabled) { background: #fee2e2; }
.hsi-icon { font-size: 18px; flex-shrink: 0; width: 24px; text-align: center; }
.hsi-sub { font-size: 11px; color: var(--text-dim); font-weight: 400; margin-top: 1px; }
.hdr-settings-sep { height: 1px; background: var(--border); margin: 4px 6px; }

/* Delete modal */
.delete-warning {
  background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px;
  padding: 12px 14px; font-size: 13px; line-height: 1.5; color: #7f1d1d;
}
.delete-warning ul { margin: 6px 0 8px 20px; padding: 0; }
.delete-warning code, .delete-warning strong { font-weight: 700; }
.btn-danger {
  background: var(--err); color: white; border: 1px solid var(--err);
}
.btn-danger:hover:not(:disabled) { background: #b91c1c; border-color: #b91c1c; }
.btn-danger:disabled { background: #f3a8a8; border-color: #f3a8a8; cursor: not-allowed; }

/* Onboarding-Wizard */
.onboarding-card { max-width: 640px; }
.onboarding-head { margin-bottom: 18px; }
.onboarding-steps {
  display: flex; gap: 16px; font-size: 11px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.5px; margin-top: 8px;
}
.onboarding-steps span { opacity: 0.45; }
.onboarding-steps span.active { color: var(--accent); opacity: 1; font-weight: 700; }
.onboarding-steps span.done { color: #047857; opacity: 1; }
.onboarding-step { display: flex; flex-direction: column; gap: 14px; }
.onboarding-bot {
  background: rgba(6, 182, 212, 0.07); border-left: 3px solid var(--accent);
  border-radius: 6px; padding: 14px 16px; font-size: 14px; line-height: 1.55;
}
.onboarding-bot em { color: var(--accent); font-style: normal; font-weight: 600; }
.onboarding-tavily-hint {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(6, 182, 212, 0.25);
  color: var(--text-dim);
}
.onboarding-input { font-size: 15px; padding: 10px 12px; }
.onboarding-candidates { display: flex; flex-direction: column; gap: 8px; }
.onb-candidate {
  background: white; border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; text-align: left; cursor: pointer; font: inherit; color: var(--text);
  transition: all 0.12s;
}
.onb-candidate:hover { border-color: var(--accent); background: #f0fdfa; }
.onb-cand-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.onb-cand-name { font-weight: 600; font-size: 14px; }
.onb-cand-kind {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  background: rgba(6, 182, 212, 0.12); color: #0e7490;
  padding: 2px 7px; border-radius: 3px; font-weight: 600;
}
.onb-cand-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.onb-cand-hint { font-size: 12px; color: var(--text); margin-top: 6px; line-height: 1.45; }
.onb-none { border-style: dashed; background: #fafafa; }
.onb-none:hover { border-color: var(--text-dim); background: #f5f5f5; }
.onb-loading-icon { font-size: 36px; text-align: center; margin-bottom: 10px; animation: spin 2.5s linear infinite; display: inline-block; }
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Adjust-Variable Einheits-Suffix + Kind-Tooltip */
.adjust-var-head { display: flex; align-items: baseline; gap: 8px; }
.adjust-var-unit {
  font-size: 11px; color: var(--text-dim); font-weight: 500;
  padding: 1px 6px; background: rgba(0,0,0,0.04); border-radius: 3px;
}
.adjust-var-kind { cursor: help; border-bottom: 1px dotted rgba(0,0,0,0.25); }
.adjust-field { cursor: help; }
.adjust-field-unit {
  font-weight: 400; font-size: 10px; color: var(--text-dim); margin-left: 3px;
}
.adjust-hint strong { color: var(--accent); }

.kd-quant {
  margin-top: 10px; padding: 8px 10px; background: rgba(6, 182, 212, 0.08); border-radius: 6px;
}
.kd-quant-head { font-size: 12px; font-weight: 600; color: #0e7490; margin-bottom: 6px; }
.kd-quant-row { padding: 4px 0; border-bottom: 1px dashed rgba(6, 182, 212, 0.2); }
.kd-quant-row:last-of-type { border-bottom: none; }
.kd-quant-name { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.kd-quant-deltas { display: flex; gap: 18px; font-size: 12px; flex-wrap: wrap; }
.kd-old { color: var(--text-dim); text-decoration: line-through; }
.kd-arrow { margin: 0 4px; color: #0e7490; }
.kd-new { color: #047857; font-weight: 700; }
.kd-quant-foot { margin-top: 6px; font-size: 11px; color: var(--text-dim); font-style: italic; }

/* Quant-Option flash when auto-requant landed */
.quant-option-flashed {
  animation: optionFlash 1.5s ease-out 3;
  border-radius: 6px;
}
@keyframes optionFlash {
  0%, 100% { background: transparent; }
  50% { background: rgba(6, 182, 212, 0.15); }
}
.quant-flash-badge {
  display: inline-block; margin-left: 8px; padding: 1px 6px;
  background: #06b6d4; color: white; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.3px; border-radius: 3px;
  vertical-align: middle;
}

.klartext-diff {
  background: linear-gradient(135deg, #ecfeff, #f0f9ff); border-left: 3px solid #06b6d4;
  border-radius: 6px; padding: 12px 14px; margin: 0 0 16px; font-size: 13px; line-height: 1.55;
  animation: diffSlideIn 0.4s ease-out;
}
@keyframes diffSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.kd-head { font-size: 11px; font-weight: 600; color: #0e7490; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.kd-row { margin: 4px 0; }
.kd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.kd-chips-label { font-size: 11px; color: var(--text-dim); margin-right: 4px; }
.kd-chip { display: inline-block; padding: 2px 8px; background: #cffafe; color: #155e75; border-radius: 999px; font-size: 11px; font-weight: 500; }

.klartext-chat {
  margin-top: 20px; padding: 14px; background: #f8fafc; border-radius: 8px; border: 1px dashed var(--border);
}
.klartext-chat-label { display: block; font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.klartext-chat-input {
  width: 100%; padding: 8px 10px; font: inherit; font-size: 13px; line-height: 1.5;
  border: 1px solid var(--border); border-radius: 6px; background: var(--panel); resize: vertical;
}
.klartext-chat-input:focus { outline: 2px solid var(--accent); outline-offset: -2px; border-color: transparent; }
.klartext-chat-actions { display: flex; justify-content: flex-end; margin-top: 8px; }

/* Klartext-Markdown fade-in when key changes (after update) */
.klartext-md { animation: klartextFade 0.5s ease-out; }
@keyframes klartextFade {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

/* Graph node flash when an insight references it */
g.node.insight-flash circle.main-circle {
  stroke: #06b6d4 !important; stroke-width: 4 !important;
  filter: drop-shadow(0 0 6px rgba(6, 182, 212, 0.7));
  animation: nodeFlash 1.2s ease-in-out 4;
}
@keyframes nodeFlash {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(6, 182, 212, 0.5)); }
  50% { filter: drop-shadow(0 0 14px rgba(6, 182, 212, 1)); }
}

.klartext-missing {
  padding: 18px; background: #fef3c7; border-radius: 8px; border-left: 3px solid #f59e0b;
}
.klartext-missing p { margin: 0 0 12px; font-size: 13px; line-height: 1.5; }

.klartext-panel { padding: 24px 28px; }
.klartext-panel h3 { margin: 0 0 14px; font-size: 16px; font-weight: 700; }
.klartext-md { font-size: 15px; line-height: 1.65; }
.klartext-md p { margin: 0 0 12px; }
.klartext-md strong { color: var(--accent); display: inline-block; margin-top: 6px; }
.klartext-md ol { padding-left: 22px; margin: 4px 0 12px; }
.klartext-md ol li { margin-bottom: 6px; }

.auth-field input:focus { outline: 2px solid var(--accent); outline-offset: -2px; border-color: transparent; }
.auth-field .pwd-wrap { position: relative; }
.auth-field .pwd-wrap input { padding-right: 40px; }
.auth-field .pwd-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: none; padding: 7px; cursor: pointer; border-radius: 4px;
  color: var(--text-dim); display: flex; align-items: center; justify-content: center;
}
.auth-field .pwd-toggle:hover { color: var(--text); background: rgba(0,0,0,0.04); }
.auth-field .pwd-toggle:disabled { opacity: 0.4; cursor: not-allowed; }
.auth-btn { width: 100%; margin-top: 8px; padding: 11px; font-size: 14px; }
.auth-error {
  color: var(--err); font-size: 13px; margin-top: 12px;
  padding: 8px 12px; background: #fee2e2; border-radius: 6px; border-left: 3px solid var(--err);
}
.auth-success {
  color: var(--text); font-size: 14px; line-height: 1.55;
  padding: 14px; background: #dcfce7; border-radius: 6px; border-left: 3px solid var(--ok);
  margin-bottom: 16px;
}
.auth-success p { margin: 0 0 8px; }
.auth-success p:last-child { margin-bottom: 0; }
.auth-links {
  display: flex; flex-direction: column; gap: 8px; margin-top: 18px;
  padding-top: 18px; border-top: 1px solid var(--border);
}
.auth-links a { font-size: 13px; color: var(--accent); text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

/* ============ Header user-chip ============ */
.app-header .actions { gap: 10px; }
.user-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-dim);
  padding: 4px 10px 4px 12px; background: var(--panel-light); border-radius: 14px;
  border: 1px solid var(--border);
}
.user-logout {
  background: transparent; border: 0; cursor: pointer; color: var(--text-dim);
  font-size: 14px; padding: 0; line-height: 1; margin-left: 2px;
}
.user-logout:hover { color: var(--err); }

/* ============ CompanyCreateModal ============ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,20,28,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 24px;
}
.modal-card {
  background: var(--panel); border-radius: 14px; padding: 28px;
  width: 100%; max-width: 480px; box-shadow: 0 20px 50px rgba(0,0,0,0.20);
}
.modal-card h2 { margin: 0 0 8px; font-size: 18px; color: var(--text); }
.modal-hint { font-size: 13px; color: var(--text-dim); margin: 0 0 18px; line-height: 1.5; }
.modal-field { display: block; margin-bottom: 14px; }
.modal-field > span {
  display: block; font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 5px;
}
.modal-field .req { color: var(--err); margin-left: 2px; }
.modal-field input {
  width: 100%; padding: 9px 12px; font: inherit; font-size: 14px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--panel);
}
.modal-field input:focus { outline: 2px solid var(--accent); outline-offset: -2px; border-color: transparent; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.modal-error {
  color: var(--err); font-size: 13px; margin-top: 10px;
  padding: 8px 12px; background: #fee2e2; border-radius: 6px;
}

/* "No company yet" hint banner */
.query-bar-empty {
  padding: 24px; text-align: center; color: var(--text-dim);
  background: var(--panel); border-bottom: 1px solid var(--border);
}
.query-bar-empty p { margin: 0 0 12px; font-size: 14px; }

/* ============ QualitativePanel: SWOT, Stakeholder-Map, Risiko-Heatmap ============ */
.qual-panel { padding: 18px 20px; }
.qual-panel h3 { margin: 0 0 12px; }
.qual-panel h4 { font-size: 14px; margin: 18px 0 10px; color: var(--text); letter-spacing: 0.2px; }
.qual-summary {
  background: linear-gradient(135deg, #fef3c7, #fef9c3);
  border-left: 3px solid #f59e0b; border-radius: 8px;
  padding: 12px 14px; margin-bottom: 12px;
}
.qual-summary-head { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #92400e; letter-spacing: 0.5px; margin-bottom: 4px; }
.qual-summary-body { font-size: 14px; color: var(--text); line-height: 1.5; }
.qual-block { margin-bottom: 22px; }

/* SWOT-Matrix */
.swot-option { margin-bottom: 16px; }
.swot-name { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 8px; padding: 4px 10px; background: var(--panel-light); border-radius: 6px; display: inline-block; }
.swot-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.swot-cell {
  border-radius: 8px; padding: 10px 12px; min-height: 90px;
  border: 1px solid; font-size: 12.5px; line-height: 1.45;
}
.swot-cell ul { margin: 6px 0 0; padding-left: 18px; }
.swot-cell li { margin-bottom: 3px; }
.swot-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.swot-empty { color: var(--text-dim); font-style: italic; font-size: 12px; }
.swot-s { background: #dcfce7; border-color: #86efac; }
.swot-s .swot-label { color: #166534; }
.swot-w { background: #fef3c7; border-color: #fcd34d; }
.swot-w .swot-label { color: #92400e; }
.swot-o { background: #dbeafe; border-color: #93c5fd; }
.swot-o .swot-label { color: #1e40af; }
.swot-t { background: #fee2e2; border-color: #fca5a5; }
.swot-t .swot-label { color: #991b1b; }

/* Stakeholder-Map: 2D-Diagramm Macht (Y) x Interesse (X) */
.stk-legend { display: flex; gap: 14px; align-items: center; font-size: 11px; color: var(--text-dim); margin-bottom: 6px; flex-wrap: wrap; }
.stk-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.stk-legend-spacer { flex: 1; min-width: 8px; }
.stk-legend-axes { font-style: italic; }
.stk-dot {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.15);
}
.stk-board {
  position: relative; width: 100%; height: 460px; min-height: 320px;
  background:
    linear-gradient(to right, transparent 49.5%, rgba(0,0,0,0.08) 49.5%, rgba(0,0,0,0.08) 50.5%, transparent 50.5%),
    linear-gradient(to bottom, transparent 49.5%, rgba(0,0,0,0.08) 49.5%, rgba(0,0,0,0.08) 50.5%, transparent 50.5%),
    linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-radius: 10px; border: 1px solid var(--border); overflow: hidden;
}
.stk-quad-labels { position: absolute; inset: 0; pointer-events: none; }
.stk-qlabel {
  position: absolute; font-size: 10.5px; color: var(--text-dim); font-weight: 600;
  text-align: center; line-height: 1.3;
}
.stk-qlabel span { font-weight: 400; font-style: italic; font-size: 10px; }
.stk-qtl { top: 8px; left: 8px; text-align: left; }
.stk-qtr { top: 8px; right: 8px; text-align: right; }
.stk-qbl { bottom: 8px; left: 8px; text-align: left; }
.stk-qbr { bottom: 8px; right: 8px; text-align: right; }
.stk-axis-x {
  position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%);
  font-size: 11px; color: var(--text-dim); font-weight: 600;
}
.stk-axis-y {
  position: absolute; top: 50%; left: -28px; transform: translateY(-50%) rotate(-90deg);
  font-size: 11px; color: var(--text-dim); font-weight: 600;
}
.stk-bubble {
  position: absolute; border-radius: 50%; cursor: default;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white; text-align: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
  border: 2px solid rgba(255,255,255,0.9);
  animation: stkPop 0.5s ease-out;
  transition: transform 0.2s;
}
.stk-bubble:hover { transform: scale(1.15); z-index: 10; }
@keyframes stkPop {
  from { opacity: 0; transform: scale(0); }
  to { opacity: 1; transform: scale(1); }
}
.stk-init { line-height: 1; }
.stk-name {
  position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--text); background: white;
  padding: 1px 6px; border-radius: 3px; white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15); font-weight: 600;
}
.stk-pos-ally { background: linear-gradient(135deg, #22c55e, #16a34a); }
.stk-pos-neutral { background: linear-gradient(135deg, #94a3b8, #64748b); }
.stk-pos-blocker { background: linear-gradient(135deg, #ef4444, #dc2626); }

/* Cluster spread: bubbles on identical (macht,interesse) bloom out, lines back to origin */
.stk-cluster-lines {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1;
}
.stk-cluster-lines line {
  stroke: rgba(15, 23, 42, 0.35); stroke-dasharray: 3 2;
  transition: stroke 0.2s, stroke-width 0.2s;
}
.stk-cluster-lines line.active { stroke: var(--accent); }
.stk-cluster-center {
  position: absolute; width: 9px; height: 9px; border-radius: 50%;
  background: rgba(15, 23, 42, 0.55); border: 2px solid white;
  pointer-events: none; transform: translate(-50%, -50%);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  z-index: 2;
}
.stk-bubble { transition: left 0.28s ease, top 0.28s ease, transform 0.2s; }
.stk-bubble.clustered:hover ~ .stk-bubble.clustered,
.stk-bubble.clustered:hover { z-index: 12; }

/* Risk-Heatmap: 5x5 Grid */
.heat-axes { position: relative; padding: 0 0 28px 28px; margin-bottom: 14px; }
.heat-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(5, 1fr);
  gap: 3px; width: 100%; height: 360px; min-height: 240px;
}
.heat-cell {
  border-radius: 6px; padding: 4px 5px; display: flex; flex-direction: column; gap: 2px;
  border: 1px solid; min-height: 36px;
}
.heat-none { background: #f8fafc; border-color: #e2e8f0; }
.heat-low { background: #ecfdf5; border-color: #a7f3d0; }
.heat-med { background: #fef9c3; border-color: #fde047; }
.heat-high { background: #fed7aa; border-color: #fb923c; }
.heat-crit { background: #fecaca; border-color: #ef4444; }
.heat-risk {
  background: rgba(255,255,255,0.85); border-radius: 4px;
  padding: 2px 5px; font-size: 10.5px; line-height: 1.25;
  color: var(--text); cursor: default;
  overflow: hidden; text-overflow: ellipsis;
  border-left: 2px solid currentColor;
}
.heat-axis-x {
  position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  font-size: 11px; color: var(--text-dim); font-weight: 600;
}
.heat-axis-y {
  position: absolute; top: 50%; left: 0; transform: translateY(-50%) rotate(-90deg); transform-origin: center;
  font-size: 11px; color: var(--text-dim); font-weight: 600;
  width: 28px; text-align: center;
}
.risk-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.risk-line {
  padding: 8px 12px; border-radius: 6px; font-size: 12.5px;
  background: var(--panel-light); border-left: 3px solid;
}
.risk-line.risk-low { border-left-color: #22c55e; background: #f0fdf4; }
.risk-line.risk-med { border-left-color: #eab308; background: #fefce8; }
.risk-line.risk-high { border-left-color: #f97316; background: #fff7ed; }
.risk-line.risk-crit { border-left-color: #ef4444; background: #fef2f2; }
.risk-name { font-weight: 700; color: var(--text); }
.risk-meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.risk-fix { font-size: 12px; color: var(--text); margin-top: 4px; font-style: italic; }

/* Tab flash: brief glow when the pipeline jumps to this tab */
.tab.flash {
  animation: tabFlash 1.8s ease-out;
  position: relative;
}
.tab.flash::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(135deg, rgba(6,182,212,0.55), rgba(56,132,255,0.4));
  animation: tabFlashGlow 1.8s ease-out forwards; pointer-events: none;
}
@keyframes tabFlash {
  0% { transform: scale(1); }
  20% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
@keyframes tabFlashGlow {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* Reinforced stepper animation for the active step */
.step.active {
  background: linear-gradient(90deg, rgba(56, 132, 255, 0.12), rgba(56, 132, 255, 0.02), transparent);
  border-left: 4px solid var(--accent);
  padding-left: 10px;
  animation: stepActiveSweep 2.6s ease-in-out infinite;
}
@keyframes stepActiveSweep {
  0%, 100% { background: linear-gradient(90deg, rgba(56, 132, 255, 0.12), rgba(56, 132, 255, 0.02), transparent); }
  50% { background: linear-gradient(90deg, rgba(56, 132, 255, 0.22), rgba(56, 132, 255, 0.08), rgba(56, 132, 255, 0.02)); }
}
.step.active .step-num {
  background: var(--accent); color: white;
  border-radius: 50%; padding: 3px 8px; font-weight: 700;
  display: inline-block; min-width: 22px; text-align: center;
  animation: stepNumPulse 1.8s ease-in-out infinite;
}
@keyframes stepNumPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(56,132,255,0.5); }
  50% { box-shadow: 0 0 0 6px rgba(56,132,255,0); }
}
.step.active .step-name { font-weight: 700; color: var(--accent); }
.step.done .step-num { color: var(--ok); font-weight: 700; }
.step.done .step-num::after { content: ' ✓'; color: var(--ok); }

/* ============ Compact topbar with inline company selector + history dropdown ============ */
.app-header {
  position: relative;
  flex-wrap: wrap; padding: 8px 14px; gap: 10px; row-gap: 6px;
}
.hdr-left { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; }
.hdr-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hdr-company {
  flex: 0 1 240px; min-width: 140px;
  padding: 6px 10px; font: inherit; font-size: 13px; font-weight: 600;
  background: var(--panel-light); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
}
.hdr-company:focus { outline: 2px solid var(--accent); outline-offset: -2px; border-color: transparent; }
.hdr-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 10px; font-size: 12px; line-height: 1.2;
}
.hdr-btn .count {
  background: var(--accent); color: white; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 8px; min-width: 16px; text-align: center;
}

/* History dropdown popover - anchored to .app-header */
.hdr-dropdown {
  position: absolute; z-index: 90;
  top: 100%; right: 14px; margin-top: 4px;
  width: min(560px, calc(100vw - 28px));
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
  max-height: 70vh; overflow: hidden; display: flex; flex-direction: column;
  animation: ddIn 0.16s ease-out;
}
@keyframes ddIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.hdr-dropdown-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; font-size: 13px; font-weight: 700; color: var(--text);
  border-bottom: 1px solid var(--border); background: var(--panel-light);
}
.hdr-dropdown-close {
  background: transparent; border: 0; cursor: pointer; font-size: 18px;
  color: var(--text-dim); padding: 0 4px; line-height: 1;
}
.hdr-dropdown-close:hover { color: var(--err); }
.hdr-dropdown-body { padding: 6px 8px; overflow-y: auto; }

/* Run history list in dropdown: vertical, not horizontal scroll */
.hdr-dropdown-body .run-history { padding: 0; }
.hdr-dropdown-body .rh-head { display: none; }
.hdr-dropdown-body .rh-list { display: flex; flex-direction: column; gap: 4px; overflow: visible; padding: 0; }
.hdr-dropdown-body .rh-item { flex: 1 1 auto; min-width: 0; max-width: none; }

/* Compact query bar: no select anymore, just question + button */
.query-bar { padding: 8px 14px; gap: 6px; }
.query-bar .qb-textarea { min-height: 40px; padding: 7px 10px; }
.query-bar .qb-row-end { justify-content: space-between; align-items: center; }

/* ============ Mobile (< 900px) ============ */
.mobile-only { display: none; }
@media (max-width: 900px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: inline-flex; }

  /* Header: stack vertically, full-width selector */
  .app-header { padding: 8px 12px; gap: 6px; }
  .app-header h1 { font-size: 16px; }
  .hdr-left { flex: 1 1 100%; min-width: 0; }
  .hdr-company { flex: 1 1 auto; max-width: 100%; }
  .hdr-right { flex: 1 1 100%; gap: 6px; }
  .hdr-right .run-status { font-size: 11px; padding: 2px 8px; }
  .hdr-right .user-chip { font-size: 11px; padding: 3px 8px; }
  .hdr-btn { padding: 5px 8px; font-size: 11px; }
  .hdr-btn .src-badge { display: none; }

  /* Stepper: horizontal scroll, even tighter */
  .stepper { padding: 4px 8px; gap: 3px; }
  .step { min-width: 70px; padding: 4px 6px; }
  .step-name { font-size: 10px; }
  .step .step-meta, .step.active .step-meta { display: none; }

  /* Query bar: tighter */
  .query-bar { padding: 6px 10px; }
  .query-bar .qb-textarea { font-size: 13px; min-height: 38px; }
  .query-bar .qb-row-end { flex-direction: column; align-items: stretch; gap: 6px; }
  .query-bar .qb-hint { font-size: 11px; }
  .query-bar .btn { width: 100%; }

  /* Workspace: stack vertically, graph above tabs */
  .workspace {
    display: flex !important; flex-direction: column; grid-template-columns: none !important;
  }
  .workspace .left-pane { flex: 0 0 auto; max-height: 240px; border-bottom: 1px solid var(--border); }
  .workspace .right-pane { flex: 1 1 auto; min-height: 0; }

  /* Tab-Bar: scrollable, slightly smaller */
  .tab-bar { padding: 0 2px; }
  .tab { padding: 8px 10px; font-size: 12px; }

  /* History dropdown: full-width on phone, anchored under header */
  .hdr-dropdown { left: 8px; right: 8px; width: auto; top: 100%; max-height: 70vh; }

  /* Modals: tighter */
  .modal-card { padding: 20px 18px; }
  .modal-card.sources-modal { width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }

  /* Activity log: hide on mobile (noise) */
  .activity { display: none; }

  /* Node panel popover: shrink to fit phone */
  .node-panel { width: calc(100vw - 24px); max-height: 70vh; }
}

/* Backdrop for dropdown close-on-outside-click */
.hdr-dropdown-backdrop {
  position: fixed; inset: 0; z-index: 80; background: transparent;
}

/* --- Daten-Cockpit --- */
.hdr-settings-item.hsi-highlight { background: rgba(37,99,235,0.06); }
.hdr-settings-item.hsi-highlight:hover:not(:disabled) { background: rgba(37,99,235,0.12); }
.cockpit-panel { padding: 4px 2px; }
.cockpit-intro { font-size: 13px; color: var(--text-dim); line-height: 1.55; margin: 0 0 14px; }
.cockpit-loading { font-size: 13px; color: var(--text-dim); padding: 18px 4px; }
.cockpit-error { font-size: 13px; color: var(--err); padding: 8px 0; }
.cockpit-rows { display: flex; flex-direction: column; gap: 8px; max-height: 56vh; overflow-y: auto; padding-right: 4px; }
.cockpit-row {
  display: grid; grid-template-columns: 28px 1fr 180px; gap: 10px; align-items: center;
  padding: 9px 11px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg);
}
.cockpit-row.confirmed { border-color: var(--ok); background: rgba(22,163,74,0.05); }
.cockpit-check { display: flex; align-items: center; justify-content: center; }
.cockpit-check input { width: 17px; height: 17px; cursor: pointer; }
.cockpit-main { min-width: 0; }
.cockpit-row-head { display: flex; gap: 8px; align-items: center; }
.cockpit-row-head strong { font-size: 13.5px; color: var(--text); }
.cockpit-cat {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700;
  padding: 1px 6px; border-radius: 8px; cursor: help;
}
.cockpit-cat.intern { background: rgba(37,99,235,0.14); color: var(--accent, #2563eb); }
.cockpit-cat.extern { background: rgba(217,119,6,0.14); color: var(--warn); }
.cockpit-why { font-size: 11.5px; color: var(--text-dim); line-height: 1.45; margin-top: 3px; }
.cockpit-input { display: flex; align-items: center; gap: 6px; }
.cockpit-input input {
  width: 120px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 5px;
  font-size: 13px; text-align: right; background: var(--bg); color: var(--text);
}
.cockpit-unit { font-size: 11.5px; color: var(--text-dim); min-width: 44px; }
.cockpit-actions {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
}
.cockpit-count { font-size: 12.5px; font-weight: 600; color: var(--text); margin-right: auto; }
.cockpit-saved { font-size: 12.5px; color: var(--ok); font-weight: 600; }
.cockpit-weak { font-size: 12.5px; color: var(--warn); background: rgba(217,119,6,0.08); border: 1px solid rgba(217,119,6,0.25); border-radius: 5px; padding: 7px 10px; margin-bottom: 12px; line-height: 1.45; }
.cockpit-prio { font-size: 9px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700; padding: 1px 6px; border-radius: 8px; background: var(--warn); color: #fff; cursor: help; }
