/* ---------- Generic surfaces ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.card-bordered { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }

/* ---------- Page header ---------- */

.app-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.app-header-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); }
.app-header-title { font-size: 22px; font-weight: 700; margin-top: 2px; }
.app-header-description { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; max-width: 60ch; }
.app-context-row { display: flex; flex-wrap: wrap; gap: 8px; }
.app-context-chip {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--text-muted);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 100px; padding: 5px 10px;
}
.app-context-chip strong { color: var(--text); font-weight: 600; }

/* ---------- KPI cards ---------- */

.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi-label { font-size: 11px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-faint); }
.kpi-value { font-size: 20px; font-weight: 700; font-family: var(--font-mono); }
.kpi-subtle { font-size: 11.5px; color: var(--text-faint); }
.kpi-badge { align-self: flex-start; font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 100px; font-family: var(--font-mono); }
.kpi-badge-positive { background: var(--positive-soft); color: var(--positive); }
.kpi-badge-negative { background: var(--negative-soft); color: var(--negative); }
.kpi-badge-neutral { background: var(--overlay-6); color: var(--text-muted); }

/* ---------- Dashboard feature cards ---------- */

.dash-feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; cursor: default; }
.dash-feature-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-blue-soft); color: var(--accent-blue); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; font-size: 15px; }
.dash-status-positive .dash-feature-icon { background: var(--positive-soft); color: var(--positive); }
.dash-status-negative .dash-feature-icon { background: var(--negative-soft); color: var(--negative); }
.dash-status-warning .dash-feature-icon { background: var(--warning-soft); color: var(--warning); }
.dash-feature-title { font-size: 11.5px; color: var(--text-faint); font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; }
.dash-feature-value { font-size: 19px; font-weight: 700; font-family: var(--font-mono); margin-top: 4px; }
.dash-feature-label { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.dash-feature-delta { font-size: 11px; color: var(--text-faint); margin-top: 6px; }

/* ---------- Dashboard metric cards ---------- */

.dash-metric-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.dash-metric-icon { width: 28px; height: 28px; border-radius: 7px; background: var(--overlay-5); color: var(--text-muted); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px; }
.dash-metric-title { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.02em; }
.dash-metric-value-row { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.dash-metric-value { font-size: 17px; font-weight: 700; font-family: var(--font-mono); }
.dash-metric-subtitle { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.dash-status-text-positive { color: var(--positive); }
.dash-status-text-negative { color: var(--negative); }
.dash-status-text-warning { color: var(--warning); }
.dash-status-text-neutral { color: var(--text-faint); }

/* ---------- Dashboard panel wrapper ---------- */

.dash-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; height: 100%; display: flex; flex-direction: column; }
.dash-panel-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.dash-panel-title, .overview-panel-title { font-size: 13px; font-weight: 600; }
.dash-panel-subtitle, .overview-panel-subtitle { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }

/* ---------- Overview (Dashboard) section shells ---------- */

.overview-rule { height: 1px; background: var(--border); margin-top: 18px; }
.overview-section-title { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 4px; }
.overview-panel-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.overview-treemap-breadcrumb { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.overview-treemap-back-slot { display: flex; justify-content: flex-end; }
.overview-mini-chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.overview-mini-title { font-size: 10.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.02em; }
.overview-mini-value { font-size: 14px; font-weight: 700; font-family: var(--font-mono); margin-top: 2px; }
.overview-mini-delta { font-size: 10.5px; font-family: var(--font-mono); white-space: nowrap; }

/* ---------- Workbench section headers ---------- */

.workbench-section-head { margin-bottom: 4px; }
.workbench-section-title { font-size: 14px; font-weight: 600; }
.workbench-section-subtitle { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.workbench-subsection-label { font-size: 11px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-faint); margin: 10px 0 8px; }
.workbench-separator { height: 1px; background: var(--border); margin: 4px 0; }

/* ---------- Analysis panel wrapper ---------- */

.analysis-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; height: 100%; }
.analysis-panel-title { font-size: 13px; font-weight: 600; }
.analysis-panel-subtitle { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; margin-bottom: 12px; }

/* ---------- Info grid ---------- */

.info-grid { display: flex; flex-direction: column; gap: 8px; }
.info-grid-title { font-size: 11px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-faint); }
.info-grid-body { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.info-grid-item { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.info-grid-item span { color: var(--text-faint); font-size: 11px; }
.info-grid-item strong { color: var(--text); font-weight: 600; word-break: break-word; }
.info-grid-success .info-grid-title { color: var(--positive); }
.info-grid-warning .info-grid-title { color: var(--warning); }

/* ---------- Filter chips ---------- */

.filter-chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip { display: flex; align-items: center; gap: 6px; background: var(--overlay-4); border: 1px solid var(--border); border-radius: 100px; padding: 5px 10px; font-size: 11.5px; }
.filter-chip-label { color: var(--text-faint); }
.filter-chip-value { color: var(--text); font-weight: 600; }

/* ---------- Selectable chips (region/delikt toggles) ---------- */

.chip-toggle {
  padding: 6px 12px; border-radius: 100px; font-size: 12.5px; cursor: pointer; white-space: nowrap;
  background: transparent; border: 1px solid var(--border-strong); color: var(--text-muted);
  font-family: inherit;
}
.chip-toggle.active { background: var(--accent-blue-soft); border-color: rgba(76, 141, 255, 0.5); color: var(--text); }

/* ---------- Tab pills ---------- */

.tab-pills { display: flex; gap: 6px; }
.tab-pill { padding: 8px 16px; border-radius: var(--radius-md); font-size: 12.5px; cursor: pointer; font-weight: 500; background: transparent; color: var(--text-faint); border: none; font-family: inherit; }
.tab-pill.active { background: var(--accent-blue-soft); color: var(--accent-blue); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  padding: 9px 16px; border-radius: var(--radius-md); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); cursor: pointer;
}
.btn:hover { border-color: var(--overlay-28); }
.btn-primary { background: var(--accent-blue); border-color: var(--accent-blue); color: #0b0c0d; }
.btn-primary:hover { background: #6ba0ff; border-color: #6ba0ff; }
.btn-soft { background: var(--accent-blue-soft); border: none; color: var(--accent-blue); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 11.5px; }

/* ---------- Form controls ---------- */

label.field-label { display: block; font-size: 11px; font-weight: 600; color: var(--text-faint); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.02em; }

.input, select.input, textarea.input {
  width: 100%; font-family: inherit; font-size: 12.5px; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 8px 12px;
}
.input:focus, select.input:focus { outline: 2px solid var(--accent-blue); outline-offset: -1px; border-color: var(--accent-blue); }

.field { margin-bottom: 14px; }
.field-row { display: flex; gap: 12px; }
.field-row > .field { flex: 1; min-width: 0; }

.radio-row { display: flex; gap: 14px; align-items: center; }
.radio-row label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; cursor: pointer; }

.multiselect-list { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 6px; }
.multiselect-list label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 4px 6px; border-radius: var(--radius-sm); cursor: pointer; }
.multiselect-list label:hover { background: var(--overlay-4); }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.switch { position: relative; width: 34px; height: 20px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-track { position: absolute; inset: 0; border-radius: 100px; background: var(--overlay-12); transition: background .15s; pointer-events: none; }
.switch input:checked ~ .switch-track { background: var(--accent-blue); }
.switch-thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; pointer-events: none; }
.switch input:checked ~ .switch-thumb { left: 16px; }

/* ---------- Tables ---------- */

.data-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
table.data-table th { text-align: left; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; color: var(--text-faint); padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data-table td { padding: 8px 12px; border-bottom: 1px solid var(--overlay-5); font-family: var(--font-mono); white-space: nowrap; }
table.data-table td:first-child { font-family: var(--font-sans); white-space: normal; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: var(--overlay-2); }

details.table-expander { margin-top: 10px; }
details.table-expander > summary { cursor: pointer; font-size: 11.5px; color: var(--text-faint); padding: 4px 0; }
details.table-expander > summary:hover { color: var(--text); }

/* ---------- Callouts ---------- */

.region-emblem { width: 40px; height: 40px; object-fit: contain; margin-bottom: 10px; }

.callout { border-radius: var(--radius-md); padding: 10px 14px; font-size: 12.5px; line-height: 1.5; border: 1px solid transparent; }
.callout-info { background: rgba(76, 141, 255, 0.08); border-color: rgba(76, 141, 255, 0.25); color: var(--text-muted); }
.callout-success { background: var(--positive-soft); border-color: rgba(34, 211, 238, 0.3); color: var(--text); }
.callout-warning { background: var(--warning-soft); border-color: rgba(245, 166, 35, 0.3); color: var(--text); }
.callout-error { background: var(--negative-soft); border-color: rgba(242, 113, 138, 0.3); color: var(--text); }

/* ---------- AI status pill (Meridian header accent) ---------- */

.ai-status { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--accent-cyan); white-space: nowrap; }
.ai-status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-cyan); animation: pulse 2s ease-in-out infinite; }

/* ---------- ECharts / Plotly containers ---------- */

.echart { width: 100%; }
.chart-tiny { height: 96px; }
.chart-sm { height: 260px; }
.chart-treemap { height: 306px; }
.chart-md { height: 330px; }
.chart-lg { height: 420px; }
.plotly-map-wrap { width: 100%; height: 330px; }
.plotly-map-wrap-lg { height: 640px; }

/* ---------- Empty state ---------- */

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 48px 24px; text-align: center; color: var(--text-faint); }
.empty-state-icon { width: 34px; height: 34px; color: var(--text-ghost); }
.empty-state-title { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.empty-state-body { font-size: 12.5px; max-width: 46ch; }
.empty-state-badge { font-size: 10.5px; font-family: var(--font-mono); background: var(--overlay-5); border: 1px solid var(--border); border-radius: 100px; padding: 3px 10px; color: var(--text-faint); margin-top: 4px; }

/* ---------- Workspace canvas (Phase 4) ---------- */

.app-content.workspace-content { overflow: hidden; padding: 0; position: relative; }

.ws-canvas-viewport { position: absolute; inset: 0; overflow: hidden; cursor: grab; background-image: radial-gradient(var(--overlay-5) 1px, transparent 1.4px); background-size: 26px 26px; }
.ws-canvas-viewport.panning { cursor: grabbing; }
.ws-world { position: absolute; left: 0; top: 0; width: 1px; height: 1px; }

.ws-node { position: absolute; border-radius: var(--radius-lg); border: 1px solid var(--border); background: rgba(19, 20, 23, 0.9); backdrop-filter: blur(14px); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35); display: flex; flex-direction: column; overflow: hidden; z-index: 2; }
.ws-node.selected { border-color: var(--accent-blue); box-shadow: 0 0 0 2px var(--accent-blue-soft), 0 20px 40px rgba(0, 0, 0, 0.35); }
.ws-node.batch-selected { border-color: var(--accent-blue); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35); outline: 2px dashed var(--accent-blue-soft); outline-offset: 2px; }
.ws-node-header { height: 38px; flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 0 8px; border-bottom: 1px solid var(--border); cursor: grab; }
.ws-node-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.ws-node-title { flex: 1; font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-node-btn { width: 22px; height: 22px; flex-shrink: 0; border: none; background: transparent; color: var(--text-faint); font-size: 14px; cursor: pointer; border-radius: var(--radius-sm); }
.ws-node-btn:hover { background: var(--overlay-8); color: var(--text); }
.ws-node-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.ws-node-btn:disabled:hover { background: transparent; color: var(--text-faint); }
.ws-node-btn:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 1px; }
.ws-node-body { flex: 1; overflow: auto; font-size: 12px; min-height: 0; }
.ws-node-menu { position: absolute; top: 36px; right: 8px; background: #1a1c21; border: 1px solid var(--border-strong); border-radius: var(--radius-md); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5); padding: 4px; z-index: 5; min-width: 140px; }
.ws-node-menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; background: transparent; border: none; color: var(--text); font-size: 12.5px; border-radius: var(--radius-sm); cursor: pointer; }
.ws-node-menu button:hover { background: var(--overlay-6); }
.ws-node-menu button.danger { color: var(--danger); }
.ws-node-resize { position: absolute; right: 2px; bottom: 2px; width: 14px; height: 14px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, var(--overlay-18) 50%); border-radius: 0 0 12px 0; }
.ws-connections { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; z-index: 1; }
.ws-connections path { fill: none; }
.ws-connection-line { stroke: var(--overlay-16); stroke-width: 1.5px; pointer-events: none; }
.ws-connection-line.selected { stroke: var(--accent-blue); stroke-width: 2.5px; }
.ws-connection-hit { stroke: transparent; stroke-width: 14px; pointer-events: stroke; cursor: pointer; }

/* Marquee-Auswahlrechteck (siehe workspace-interactions.js) - Bildschirm-,
   nicht Weltkoordinaten, da es waehrend eines einzigen Drags gezeichnet wird. */
.ws-marquee { position: absolute; z-index: 15; border: 1px solid var(--accent-blue); background: var(--accent-blue-soft); opacity: 0.35; pointer-events: none; }
.ws-canvas-viewport.space-pan { cursor: grab; }

.ws-toolbar { position: absolute; top: 16px; left: 20px; right: 20px; z-index: 20; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.ws-toolbar-group { pointer-events: auto; position: relative; display: flex; align-items: center; gap: 8px; background: rgba(19, 20, 23, 0.85); backdrop-filter: blur(16px); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 7px 10px; box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3); }
.ws-toolbar-sep { width: 1px; height: 20px; background: var(--border); }

.ws-add-popover { position: absolute; top: 44px; left: 0; background: #1a1c21; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: 0 20px 44px rgba(0, 0, 0, 0.5); padding: 10px; z-index: 30; width: 300px; max-height: 70vh; overflow: auto; }
.ws-add-section-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); margin: 10px 4px 6px; }
.ws-add-item { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 8px 9px; background: transparent; border: none; color: var(--text); font-size: 12.5px; border-radius: var(--radius-md); cursor: pointer; }
.ws-add-item:hover { background: var(--overlay-6); }
.ws-add-item-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.ws-zoom-controls { position: absolute; bottom: 20px; right: 20px; z-index: 20; display: flex; align-items: center; gap: 2px; background: rgba(19, 20, 23, 0.85); backdrop-filter: blur(16px); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 5px; box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3); }
.ws-zoom-controls button { width: 26px; height: 26px; border: none; background: transparent; color: var(--text); font-size: 15px; cursor: pointer; border-radius: var(--radius-sm); }
.ws-zoom-controls button:hover { background: var(--overlay-8); }
.ws-zoom-value { width: 44px; text-align: center; font-size: 11.5px; color: var(--text-muted); }

.ws-minimap { position: absolute; bottom: 20px; left: 20px; width: 170px; height: 100px; z-index: 20; background: rgba(19, 20, 23, 0.85); backdrop-filter: blur(16px); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3); overflow: hidden; }
.ws-minimap-node { position: absolute; border-radius: 2px; opacity: 0.8; }
.ws-minimap-viewport { position: absolute; border: 1.5px solid var(--text); border-radius: 3px; pointer-events: none; }

.ws-config-panel { position: absolute; top: 16px; right: 20px; bottom: 20px; width: 300px; z-index: 25; background: rgba(19, 20, 23, 0.94); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 24px 50px rgba(0, 0, 0, 0.4); display: flex; flex-direction: column; overflow: hidden; }
.ws-config-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.ws-config-title { font-size: 13.5px; font-weight: 600; }
.ws-config-body { padding: 14px 16px; overflow: auto; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.ws-config-footer { padding: 12px 16px 16px; flex-shrink: 0; }

.ws-note-body { padding: 12px; height: 100%; box-sizing: border-box; }
.ws-note-body textarea { width: 100%; height: 100%; resize: none; background: transparent; border: none; color: var(--text); font-family: var(--font-sans); font-size: 12.5px; line-height: 1.5; outline: none; }
.ws-text-body { padding: 12px; height: 100%; box-sizing: border-box; overflow: auto; font-size: 13px; line-height: 1.5; outline: none; }
.ws-source-body, .ws-kpi-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; height: 100%; box-sizing: border-box; justify-content: center; }
.ws-source-badge { font-size: 10px; padding: 2px 7px; border-radius: 5px; background: var(--overlay-8); color: var(--text-muted); display: inline-block; margin-right: 4px; }
.ws-kpi-value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.ws-kpi-sub { font-size: 11px; color: var(--text-faint); }
.ws-table-wrap { font-size: 11.5px; overflow: auto; height: 100%; }
.ws-table-wrap table { width: 100%; border-collapse: collapse; }
.ws-table-wrap th { position: sticky; top: 0; background: #15171b; text-align: left; padding: 6px 8px; color: var(--text-faint); font-weight: 500; border-bottom: 1px solid var(--border); }
.ws-table-wrap td { padding: 6px 8px; border-bottom: 1px solid var(--overlay-5); }
.ws-node-empty { display: flex; align-items: center; justify-content: center; height: 100%; padding: 14px; text-align: center; font-size: 11.5px; color: var(--text-faint); }
.ws-node-chart { width: 100%; height: 100%; }
.ws-node-map { width: 100%; height: 100%; }

.ws-source-role { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ws-source-subtitle { font-size: 12.5px; color: var(--text-muted); }
.ws-source-meta { font-size: 11px; color: var(--text-faint); }

/* Port-Kennzeichnung: Datenquellen liefern rechts, Visualisierungen nehmen
   links entgegen (die Verbindungslinien selbst liefen schon vorher exakt so,
   siehe renderConnections() - hier nur die sichtbare Markierung dazu). */
.ws-node[data-node-role="source"]::after,
.ws-node[data-node-role="viz"]::before {
  content: ""; position: absolute; top: 50%; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-blue); border: 2px solid var(--bg); transform: translateY(-50%);
}
.ws-node[data-node-role="source"]::after { right: -5px; }
.ws-node[data-node-role="viz"]::before { left: -5px; }

.ws-key-search-row { display: flex; gap: 8px; }
.ws-key-search-results { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; }
.ws-key-search-empty { font-size: 11.5px; color: var(--text-faint); padding: 8px 2px; }
.ws-key-hit { display: block; width: 100%; text-align: left; padding: 8px 9px; background: var(--overlay-3); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.ws-key-hit:hover { border-color: var(--border-strong); background: var(--overlay-6); }
.ws-key-hit-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ws-key-hit-label { flex: 1; min-width: 0; font-size: 12px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-key-hit-meta { font-size: 10.5px; color: var(--text-faint); margin-top: 4px; }

.ws-key-selected-card { background: var(--overlay-3); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; }
.ws-key-selected-eyebrow { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); margin-bottom: 6px; }
.ws-key-selected-head { display: flex; align-items: center; gap: 8px; }
.ws-key-selected-label { font-size: 12.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-key-selected-meta { font-size: 11px; color: var(--text-muted); margin-top: 5px; }
.ws-key-selected-parent { font-size: 10.5px; color: var(--text-faint); margin-top: 2px; }
.ws-key-selected-actions { display: flex; gap: 8px; margin-top: 10px; }

.ws-preview-card { background: var(--overlay-3); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.ws-preview-line { font-size: 12.5px; color: var(--text-muted); }
.ws-preview-sources { font-size: 10.5px; color: var(--text-faint); margin-top: 4px; }

/* ---------- Workspace: PKS-Hierarchie-Dialog (Phase 2) - reuses the
   Delikt-Explorer's .hierarchy-node-* tree rows and .ws-key-hit/.ws-key-
   selected-* cards from the key picker above; only the modal chrome here
   is new. ---------- */

.ws-modal-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(4, 4, 6, 0.6);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.ws-hierarchy-dialog {
  width: 100%; max-width: 860px; max-height: 84vh; background: var(--sidebar-bg);
  border: 1px solid var(--border-strong); border-radius: var(--radius-xl);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.6); display: flex; flex-direction: column; overflow: hidden;
}
.ws-hierarchy-dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.ws-hierarchy-dialog-title { font-size: 15px; font-weight: 700; color: var(--text); }
.ws-hierarchy-dialog-search { padding: 14px 18px 0; flex-shrink: 0; }
.ws-hierarchy-dialog-body { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(300px, 1.2fr); gap: 14px; padding: 14px 18px; flex: 1; min-height: 0; }
.ws-hierarchy-dialog-tree, .ws-hierarchy-dialog-results { min-width: 0; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.ws-hierarchy-tree-scroll { flex: 1; min-height: 0; overflow-y: auto; background: var(--overlay-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px; }
.ws-hierarchy-dialog-results .ws-key-search-results { flex: 1; min-height: 0; overflow-y: auto; max-height: none; }
.ws-hierarchy-dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-top: 1px solid var(--border); flex-shrink: 0; }
.ws-hierarchy-dialog-selection { font-size: 13px; color: var(--text-muted); min-width: 0; }
.ws-hierarchy-dialog-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ---------- Workspace: Mehrfachauswahl (Regionen/Jahre der Kriminalstatistik-
   Quelle) - Datenquelle definiert den Datenraum, siehe CLAUDE.md/ADR; und
   Modus-Umschaltung "Quelle übernehmen" vs. "Schlüssel direkt wählen" für
   Heatmap/Netzwerkgraph. ---------- */

.ws-multiselect { position: relative; }
.ws-multiselect-summary {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; background: var(--overlay-3); border: 1px solid var(--border); border-radius: var(--radius-md);
  color: var(--text); font-size: 12.5px; text-align: left; cursor: pointer; font-family: inherit;
}
.ws-multiselect-summary:hover { border-color: var(--border-strong); }
.ws-multiselect-caret { color: var(--text-faint); font-size: 10px; }
.ws-multiselect-panel {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40;
  background: #1a1c21; border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.5); padding: 8px; display: flex; flex-direction: column; gap: 8px;
}
.ws-multiselect-panel[hidden] { display: none; }
.ws-multiselect-actions { display: flex; gap: 6px; }
.ws-multiselect-actions .btn { flex: 1; }
.ws-multiselect-options { display: flex; flex-direction: column; gap: 1px; max-height: 220px; overflow-y: auto; }
.ws-multiselect-option { display: flex; align-items: center; gap: 8px; padding: 6px 6px; border-radius: var(--radius-sm); font-size: 12px; color: var(--text-muted); cursor: pointer; }
.ws-multiselect-option:hover { background: var(--overlay-6); color: var(--text); }
.ws-multiselect-option input { flex-shrink: 0; }

.ws-mode-toggle { display: flex; background: var(--surface-soft); border-radius: var(--radius-md); padding: 3px; gap: 2px; }
.ws-mode-option { position: relative; flex: 1; text-align: center; padding: 6px 8px; border-radius: var(--radius-sm); font-size: 11.5px; font-weight: 500; color: var(--text-muted); cursor: pointer; }
.ws-mode-option input { position: absolute; opacity: 0; pointer-events: none; }
.ws-mode-option.active { background: var(--accent-blue); color: var(--bg); font-weight: 600; }

/* ---------- Workspace: einheitliches Konfigurationsschema (Phase 4, siehe
   ADR-037) - Titel/Datenquelle/Darstellung/Filter/Erweitert/Vorschau als
   konsistent gestaltete Sections, pro Knotentyp ausgeblendet statt neu
   erfunden (workspace-config-schema.js). ---------- */
.ws-config-section { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.ws-config-section-title { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); }

/* ---------- Workspace: Node-Gruppen (Phase 4) - Hintergrundrechteck hinter
   den (weiterhin einzeln editierbaren) Mitgliedsknoten bzw. ein kompakter
   Chip im eingeklappten Zustand. Ausdehnung wird immer live aus den
   Mitgliederpositionen berechnet (workspace-groups.js::computeGroupBounds). ---------- */
.ws-group { position: absolute; border: 1.5px dashed; border-radius: var(--radius-lg); z-index: 0; background: var(--overlay-3); }
.ws-group.selected { box-shadow: 0 0 0 2px var(--accent-blue-soft); }
.ws-group-collapsed { z-index: 2; background: rgba(19, 20, 23, 0.9); backdrop-filter: blur(14px); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35); }
.ws-group-header { height: 30px; display: flex; align-items: center; gap: 8px; padding: 0 8px; border-top-left-radius: var(--radius-lg); border-top-right-radius: var(--radius-lg); cursor: grab; }
.ws-group-collapsed .ws-group-header { height: 100%; border-radius: var(--radius-lg); }
.ws-group-description { padding: 0 10px 8px 26px; font-size: 11px; color: var(--text-faint); }

/* ---------- Workspace: Kontextmenue (Phase 4) - dynamisch an document.body
   angehaengt (siehe workspace-interactions.js::renderContextMenu), teilt
   die visuelle Sprache mit dem bestehenden Node-⋯-Menue. ---------- */
.ws-context-menu { position: fixed; z-index: 80; min-width: 170px; }

/* ---------- Workspace: KPI-Vergleichsgruppe (mehrere Mini-Werte statt
   einer einzelnen Kennzahl, siehe workspace-render.js::nodeBodyHtml). ---------- */
.ws-kpi-compare { padding: 12px; display: flex; flex-direction: column; gap: 6px; overflow: auto; height: 100%; box-sizing: border-box; }

.ws-minimap-node.selected { outline: 1.5px solid var(--accent-blue); }

/* ---------- Karten-Workbench: collapsed filter bar + drawer (Phase 2 redesign) ---------- */

.karte-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0 16px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.karte-filter-toggle {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--radius-md);
  border: 1px solid rgba(76, 141, 255, 0.4); background: var(--accent-blue-soft); color: #8fb8ff;
  font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.karte-filter-toggle:hover { color: #8fb8ff; border-color: rgba(76, 141, 255, 0.6); }
.karte-filter-badge { background: var(--accent-blue); color: var(--bg); border-radius: 10px; padding: 1px 7px; font-family: var(--font-mono); font-size: 10px; font-weight: 700; }
.karte-toolbar-reset { margin-left: auto; font-size: 12px; color: var(--text-faint); text-decoration: underline; }
.karte-toolbar-reset:hover { color: var(--text-muted); }

.karte-main-area { position: relative; }
.karte-panel-row { display: flex; min-height: 640px; }

.karte-map-panel {
  flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-right: none;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg); display: flex; flex-direction: column; gap: 12px; padding: 20px;
}
.segmented { display: flex; background: var(--surface-soft); border-radius: var(--radius-md); padding: 3px; gap: 2px; align-self: flex-start; }
.segmented-item { padding: 6px 12px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 500; color: var(--text-muted); text-decoration: none; border: none; background: transparent; cursor: pointer; font-family: inherit; }
.segmented-item.active { background: var(--accent-blue); color: var(--bg); font-weight: 600; }
.segmented-item.disabled { color: var(--text-ghost); cursor: default; }

.karte-map-surface { flex: 1; position: relative; border-radius: var(--radius-md); overflow: hidden; min-height: 0; }
.karte-map-surface .plotly-map-wrap { height: 100%; }
.karte-legend-chip { position: absolute; bottom: 16px; right: 16px; z-index: 4; background: var(--sidebar-bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 10px; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.karte-legend-bar { width: 80px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #8fb8ff, #4c8dff, #1a4fb0); }
.karte-legend-label { font-family: var(--font-mono); font-size: 10px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }

.karte-inspector-panel {
  width: 320px; flex: none; background: var(--surface); border: 1px solid var(--border); border-left: 1px solid rgba(76, 141, 255, 0.5);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0; display: flex; flex-direction: column; gap: 16px; padding: 20px; position: relative;
}
.karte-wappen-badge {
  position: absolute; left: -17px; top: 20px; width: 34px; height: 40px;
  border: 3px solid var(--bg); border-radius: var(--radius-sm); z-index: 2; overflow: hidden; background: var(--surface-soft);
}
.karte-wappen-badge img { width: 100%; height: 100%; object-fit: cover; clip-path: polygon(50% 0%, 100% 18%, 100% 62%, 50% 100%, 0% 62%, 0% 18%); }
.karte-inspector-heading { margin-left: 20px; }
.karte-inspector-heading .karte-region-name { font-size: 15px; font-weight: 600; color: var(--text); }
.karte-inspector-heading .karte-region-sub { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.karte-inspector-footer { font-family: var(--font-mono); font-size: 10px; color: var(--text-ghost); margin-top: auto; }

.karte-drawer-backdrop { position: absolute; inset: 0; z-index: 2; background: transparent; }
.karte-drawer {
  position: absolute; top: 0; left: 0; bottom: 0; width: 270px; background: var(--sidebar-bg);
  border: 1px solid rgba(76, 141, 255, 0.35); border-radius: var(--radius-lg); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  padding: 18px; display: flex; flex-direction: column; gap: 14px; z-index: 3; overflow-y: auto;
}
.karte-drawer-head { display: flex; align-items: center; justify-content: space-between; }
.karte-drawer-title { font-size: 13px; font-weight: 600; color: var(--text); }
.karte-drawer-title span { color: var(--text-faint); font-weight: 400; }
.karte-drawer-close { color: var(--text-faint); font-size: 15px; text-decoration: none; line-height: 1; }
.karte-drawer-close:hover { color: var(--text); }
.karte-drawer-section-label { font-size: 10px; font-weight: 600; letter-spacing: 0.04em; color: var(--text-faint); text-transform: uppercase; margin-bottom: 8px; }
.karte-drawer-reset { margin-top: auto; text-align: center; font-size: 11px; font-weight: 500; color: var(--text-faint); text-decoration: underline; }

/* ---------- Delikt-Explorer ---------- */

.example-chip-row { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.example-chip-label { font-size: 12px; color: var(--text-faint); flex-shrink: 0; }
.example-chip {
  background: var(--overlay-5); border: 1px solid var(--border); border-radius: 100px;
  padding: 6px 13px; font-size: 12px; color: var(--text-muted); text-decoration: none;
}
.example-chip:hover { background: var(--overlay-9); color: var(--text); }

.result-card-list { display: flex; flex-direction: column; gap: 8px; }
.result-card {
  display: block; padding: 13px 15px; border-radius: var(--radius-md); border: 1px solid var(--border);
  background: var(--overlay-2); text-decoration: none; color: inherit;
}
.result-card:hover { border-color: var(--border-strong); }
.result-card.active { background: var(--accent-blue-soft); border-color: rgba(76, 141, 255, 0.4); box-shadow: inset 3px 0 0 var(--accent-blue); }
.result-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.result-card-heading { display: flex; align-items: flex-start; gap: 10px; min-width: 0; flex: 1; }
.result-card-label {
  font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35;
}
.result-card-meta { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.result-card-avail { font-size: 11px; color: var(--text-faint); }

.relevance-badge { font-size: 10.5px; font-weight: 700; border-radius: 100px; padding: 3px 9px; background: var(--overlay-6); color: var(--text-muted); flex-shrink: 0; white-space: nowrap; }
.relevance-badge.relevance-exact { background: var(--positive-soft); color: var(--positive); }
.relevance-badge.relevance-direct { background: var(--accent-blue-soft); color: var(--accent-blue); }
.relevance-badge.relevance-related { background: var(--overlay-6); color: var(--text-muted); }
.relevance-badge.relevance-neutral { background: var(--overlay-6); color: var(--text-muted); }

.type-badge { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 100px; padding: 3px 10px; }
.type-badge-star { background: var(--warning-soft); color: var(--warning); }
.type-badge-digits { background: var(--accent-blue-soft); color: var(--accent-blue); }
.type-badge-sum { background: var(--warning-soft); color: var(--warning); }
.type-badge-neutral { background: var(--overlay-6); color: var(--text-muted); }

.hierarchy-code { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--text-muted); background: var(--overlay-6); padding: 3px 7px; border-radius: 5px; flex-shrink: 0; }

.profile-title-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.profile-header-label { font-size: 16px; font-weight: 700; color: var(--text); }
.profile-header-key {
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; color: var(--text-muted);
  background: var(--overlay-5); display: inline-block; padding: 3px 9px; border-radius: var(--radius-sm); flex-shrink: 0;
}
.profile-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.profile-card { background: var(--overlay-3); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; margin-top: 14px; }
.profile-card-title { font-size: 11px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.profile-legal-refs { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-legal-ref {
  font-size: 12.5px; font-weight: 600; color: var(--accent-blue); text-decoration: none;
  background: var(--accent-blue-soft); padding: 5px 11px; border-radius: 100px;
}
.profile-legal-ref:hover { text-decoration: underline; }
.profile-actions { margin-top: 14px; }

.hierarchy-tree { display: flex; flex-direction: column; gap: 4px; }
.hierarchy-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid transparent; }
.hierarchy-row.active { background: var(--accent-blue-soft); border-color: rgba(76, 141, 255, 0.4); box-shadow: inset 3px 0 0 var(--accent-blue); }
.hierarchy-row-main { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.hierarchy-label { font-size: 12.5px; font-weight: 500; color: var(--text-muted); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hierarchy-label:hover { color: var(--text); }
.hierarchy-row.active .hierarchy-label { color: var(--text); font-weight: 600; }
.hierarchy-breadcrumb { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; }
.hierarchy-breadcrumb b { color: var(--text); }
.explorer-tip-text { font-size: 11px; color: var(--text-ghost); text-align: center; margin-top: 10px; }

/* ---------- Delikt-Explorer: real recursive PKS-Hierarchie tree ---------- */

.hierarchy-node-tree, .hierarchy-node-tree .hierarchy-node-children { list-style: none; margin: 0; padding: 0; }
.hierarchy-node-tree .hierarchy-node-children { padding-left: 18px; }
.hierarchy-node-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm);
  border: 1px solid transparent;
}
.hierarchy-node-row:hover { background: var(--overlay-4); }
.hierarchy-node-row.active { background: var(--accent-blue-soft); border-color: rgba(76, 141, 255, 0.4); }
.hierarchy-node-toggle {
  width: 18px; height: 18px; flex-shrink: 0; border: none; background: none; padding: 0; cursor: pointer;
  color: var(--text-faint); display: flex; align-items: center; justify-content: center; border-radius: 4px;
}
.hierarchy-node-toggle:hover { background: var(--overlay-8); color: var(--text); }
.hierarchy-node-chevron { display: inline-block; font-size: 10px; transition: transform 0.15s ease; }
.hierarchy-node-toggle.expanded .hierarchy-node-chevron { transform: rotate(90deg); }
.hierarchy-node-toggle-leaf { width: 18px; height: 18px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.hierarchy-node-dot { font-size: 9px; color: var(--text-ghost); }
.hierarchy-node-dot.active { color: var(--accent-blue); }
.hierarchy-node-link {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; text-decoration: none;
}
.hierarchy-node-key { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--text-faint); flex-shrink: 0; }
.hierarchy-node-label {
  font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.hierarchy-node-link:hover .hierarchy-node-label { color: var(--text); }
.hierarchy-node-row.active .hierarchy-node-label,
.hierarchy-node-row.active .hierarchy-node-key { color: var(--text); font-weight: 600; }
.hierarchy-node-count {
  font-size: 10.5px; color: var(--text-muted); background: var(--overlay-6); padding: 1px 8px;
  border-radius: 100px; flex-shrink: 0;
}

.availability-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 13px; background: var(--overlay-3); border-radius: var(--radius-sm); margin-bottom: 8px; }
.availability-value { font-size: 12.5px; color: var(--text-faint); }
.availability-value.available { color: var(--positive); font-weight: 600; }

.content-blurred { filter: blur(2px) brightness(0.7); pointer-events: none; user-select: none; }

.confirm-overlay-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(4, 4, 6, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.confirm-overlay-card {
  width: 100%; max-width: 480px; background: var(--sidebar-bg); border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl); padding: 28px 30px; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.6);
}
.confirm-overlay-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 6px; }
.confirm-overlay-title { font-size: 18px; font-weight: 700; color: var(--text); }
.confirm-overlay-key { font-family: var(--font-mono); font-size: 15px; font-weight: 700; color: var(--text); background: var(--overlay-6); display: inline-block; padding: 5px 11px; border-radius: var(--radius-sm); margin: 6px 0 18px; }
.confirm-overlay-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; padding: 16px 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 18px;
}
.confirm-overlay-field-label { font-size: 11px; color: var(--text-faint); margin-bottom: 3px; }
.confirm-overlay-field-value { font-size: 13px; font-weight: 700; color: var(--text); }
.confirm-overlay-actions { display: flex; flex-direction: column; gap: 10px; }
.confirm-overlay-actions .btn { text-align: center; }
.karte-drawer-reset:hover { color: var(--text-muted); }
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[contenteditable="true"]:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

/* ---------- Dashboard: Executive Summary panel ---------- */

.exec-summary-head-row { display: flex; align-items: center; gap: 8px; }
.exec-summary-title { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.exec-summary-subtitle { font-size: 12px; color: var(--text-faint); margin-top: 4px; }

.exec-summary-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.exec-summary-card-head { display: flex; align-items: center; justify-content: space-between; }
.exec-summary-card-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); }
.exec-summary-stand { font-size: 11px; color: var(--text-ghost); font-family: var(--font-mono); }
.exec-summary-text { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--text-muted); }

.exec-bullets-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); }
.exec-bullet-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.exec-bullet-item { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; }
.exec-bullet-item-divider { border-top: 1px solid var(--border); }
.exec-bullet-icon {
  flex: none; width: 20px; height: 20px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--bg);
}
.exec-bullet-icon-positive { background: var(--positive); }
.exec-bullet-icon-negative { background: var(--negative); }
.exec-bullet-icon-neutral { background: var(--text-ghost); }
.exec-bullet-text { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--text-muted); }

.exec-summary-footnote { margin: 0; font-size: 11px; color: var(--text-ghost); text-align: center; }

/* ---------- Glossar ---------- */

.glossar-toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.glossar-search-field { position: relative; width: 320px; max-width: 100%; }
.glossar-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--text-faint); pointer-events: none; }
.glossar-search-field .input { width: 100%; padding-left: 34px; }
.glossar-result-count { font-size: 12px; color: var(--text-faint); }

.glossar-category-row { display: flex; flex-wrap: wrap; gap: 8px; }
.glossar-category-pill {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 100px;
  font-size: 12px; color: var(--text-muted); border: 1px solid var(--border); background: var(--surface-soft);
  text-decoration: none;
}
.glossar-category-pill:hover { border-color: var(--border-strong); color: var(--text); }
.glossar-category-pill.active { border-color: var(--accent-blue); color: var(--text); background: var(--accent-blue-soft); }
.glossar-category-dot { width: 7px; height: 7px; border-radius: 100px; flex-shrink: 0; }
.glossar-category-count { color: var(--text-ghost); }
.glossar-category-pill.active .glossar-category-count { color: var(--text-faint); }

.glossar-layout { display: grid; grid-template-columns: 360px 1fr; gap: 20px; align-items: start; }

.glossar-term-list { display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 260px); overflow-y: auto; padding-right: 4px; }
.glossar-term-card {
  display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 16px; text-decoration: none; color: inherit;
}
.glossar-term-card:hover { border-color: var(--border-strong); }
.glossar-term-card.active { background: var(--accent-blue-soft); border-color: rgba(76, 141, 255, 0.4); box-shadow: inset 3px 0 0 var(--accent-blue); }
.glossar-term-card-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.glossar-term-card-cat { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-faint); }
.glossar-term-card-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.glossar-term-card-kurz { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }

.glossar-detail-panel { position: sticky; top: 0; }
.glossar-detail-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px 30px; }
.glossar-detail-head { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.glossar-detail-title { margin: 0 0 12px; font-size: 21px; font-weight: 700; color: var(--text); }
.glossar-meta-row { margin: -4px 0 14px; }
.glossar-detail-kurz { margin: 0 0 20px; font-size: 14.5px; line-height: 1.6; color: var(--text); font-weight: 500; }
.glossar-detail-section { margin-bottom: 18px; }
.glossar-detail-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); font-weight: 600; margin-bottom: 6px; }
.glossar-detail-text { margin: 0; font-size: 13.5px; line-height: 1.65; color: var(--text-muted); }
.glossar-detail-list { margin: 0; padding-left: 18px; color: var(--text-muted); font-size: 13.5px; line-height: 1.6; }
.glossar-detail-list li + li { margin-top: 5px; }
.glossar-formula-box { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--overlay-3); }
.glossar-formula-display { margin: 0 0 10px; color: var(--text); font-family: var(--font-mono); font-size: 13px; }
.glossar-variable-list { display: grid; grid-template-columns: minmax(130px, auto) 1fr; gap: 5px 12px; margin: 0 0 10px; font-size: 12.5px; line-height: 1.5; }
.glossar-variable-list dt { color: var(--text); font-family: var(--font-mono); }
.glossar-variable-list dd { margin: 0; color: var(--text-muted); }
.glossar-used-in { padding-top: 16px; border-top: 1px solid var(--border); }

.glossar-warning-box { margin-bottom: 18px; background: var(--warning-soft); border: 1px solid rgba(245, 166, 35, 0.3); border-radius: var(--radius-sm); padding: 12px 16px; }
.glossar-warning-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--warning); font-weight: 700; margin-bottom: 6px; }
.glossar-warning-text { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--text-muted); }

.glossar-example-box { margin-bottom: 20px; border-left: 3px solid var(--accent-blue); padding: 4px 0 4px 14px; }
.glossar-example-text { margin: 0; font-size: 13px; line-height: 1.6; color: var(--text-faint); font-style: italic; }

.glossar-detail-footer { display: flex; gap: 28px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 18px; }
.glossar-chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.glossar-chip { font-size: 12px; padding: 5px 11px; border-radius: 100px; background: var(--accent-blue-soft); color: var(--accent-blue); text-decoration: none; }
.glossar-chip:hover { background: rgba(76, 141, 255, 0.22); color: var(--accent-blue); }
.glossar-chip-neutral { background: var(--overlay-6); color: var(--text-muted); }
.glossar-chip-neutral:hover { background: var(--overlay-9); }
.glossar-chip-placeholder { background: var(--overlay-4); color: var(--text-ghost); cursor: default; }

@media (max-width: 1200px) {
  .glossar-layout { grid-template-columns: 1fr; }
  .glossar-term-list { max-height: none; }
  .glossar-detail-panel { position: static; }
}
