/* PartnerHub / miete24 (grenke) — tokens from prometheus assets/styles/app.css */
:root {
  --primary: #143cdc;
  --primary-light: #489ff6;
  --primary-dark: #12268f;
  --secondary: #bd2fbd;
  --pink: #bd2ebd;

  --blue-50: #eff6ff;
  --blue-60: #ecf4ff;
  --blue-70: #e8f2ff;
  --blue-100: #deecfe;
  --blue-200: #bcdaff;
  --blue-300: #8ebffa;
  --blue-400: #489ff6;
  --blue-500: #0f6fde;
  --blue-600: #143cdc;
  --blue-700: #1431b0;
  --blue-800: #12268f;
  --blue-900: #0f1d6f;

  --pink-50: #f8f4f8;
  --pink-100: #f0e5f0;
  --pink-400: #cc66cc;
  --pink-600: #bd2ebd;

  --green: #91cd50;

  --gray-lightest: #f1f1f1;
  --gray-lighter: #dfdfdf;
  --gray-light: #cccccc;
  --gray: #aaaaaa;
  --gray-dark: #878787;
  --gray-darker: #636365;
  --gray-darkest: #3e3e40;
  --gray-external: #f8f8f8;

  --text: #111827;
  --text-muted: #6b7280;
  --border: #dfdfdf;
  --card: #ffffff;
  --danger: #dc2626;
  --warn: #d97706;
  --ok: #91cd50;

  --shadow-xs: 0 1px 2px rgba(17, 24, 39, 0.05);
  --shadow-sm: 0 1px 3px rgba(17, 24, 39, 0.08), 0 1px 2px rgba(17, 24, 39, 0.04);

  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-full: 9999px;

  --sidebar-w: 240px;
  --topbar-h: 60px;

  --font-sans: "IBM Plex Sans", "Open Sans", ui-sans-serif, system-ui, sans-serif;
  --font-display: Nunito, ui-serif, sans-serif;

  --gradient-primary: linear-gradient(
    to bottom right in oklab,
    #143cdc 0%,
    #143cdc 50%,
    #bd2ebd 100%
  );
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--gray-external);
  color: var(--text);
  line-height: 1.45;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); }
h1, h2, h3, .font-display {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
}

/* ——— Top header (white) ——— */
.ph-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 20px;
  gap: 16px;
}
.ph-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-decoration: none;
  color: inherit;
  min-width: 120px;
}
.ph-brand .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--primary);
  letter-spacing: -0.01em;
}
.ph-brand .powered {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
}
.ph-org {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-align: center;
  flex: 1;
}
.ph-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

/* ——— Sidebar ——— */
.ph-sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  z-index: 40;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  overflow-y: auto;
  padding: 16px 12px;
}
.ph-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ph-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: background 0.12s;
}
.ph-nav a:hover { background: var(--gray-lightest); }
.ph-nav a.active {
  background: var(--blue-50);
  color: var(--primary);
}
.ph-nav a.active .nav-ico { color: var(--primary); }
.ph-nav .nav-ico {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--gray-darker);
  display: grid;
  place-items: center;
}
.ph-nav .nav-ico svg { width: 20px; height: 20px; }
.ph-nav-sep {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin: 12px 0;
}

/* ——— Main content ——— */
.ph-main {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
  background: var(--gray-external);
}
.ph-page {
  padding: 24px 32px 40px;
  max-width: 1400px;
}
.ph-page.narrow { max-width: 1100px; }

.page-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.page-title-row h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}
.page-title-row .subtitle {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-family: var(--font-sans);
  font-weight: 400;
}

/* Prototype A/B secondary tabs (under title, not teal header) */
.proto-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4px;
  box-shadow: var(--shadow-xs);
}
.proto-tabs a {
  text-decoration: none;
  color: var(--gray-darker);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition: background 0.12s, color 0.12s;
}
.proto-tabs a:hover { background: var(--blue-50); color: var(--primary); }
.proto-tabs a.active {
  background: var(--blue-100);
  color: var(--primary);
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--gray-lighter);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 18px 20px;
}
.card + .card { margin-top: 16px; }
.card h2, .card h3 { margin: 0 0 10px; font-size: 1.05rem; }
.muted { color: var(--text-muted); font-size: 0.9rem; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .ph-sidebar { display: none; }
  .ph-main { margin-left: 0; }
  .ph-org { display: none; }
}

/* Badges / status chips — soft fill + border */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--badge, var(--primary)) 12%, white);
  color: color-mix(in srgb, var(--badge, var(--primary)) 85%, black);
  border: 1px solid color-mix(in srgb, var(--badge, var(--primary)) 28%, white);
}
.badge-ok { --badge: #65a30d; }
.badge-warn { --badge: var(--warn); }
.badge-danger { --badge: var(--danger); }
.badge-brand { --badge: var(--primary); }

/* Buttons */
.btn {
  appearance: none;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  background-image: var(--gradient-primary);
  background-color: var(--primary);
  color: #fff;
  transition: filter 0.15s, transform 0.05s, box-shadow 0.15s;
  box-shadow: var(--shadow-xs);
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.btn-ghost {
  background-image: none;
  background: #fff;
  color: var(--text);
  border-color: var(--gray-lighter);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--gray-external); filter: none; }
.btn-danger {
  background-image: none;
  background: var(--danger);
}
.btn-danger:hover { background: #b91c1c; filter: none; }
.btn-ok {
  background-image: none;
  background: #65a30d;
}
.btn-ok:hover { background: #4d7c0f; filter: none; }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--blue-50);
  color: var(--primary);
  border: 1px solid var(--blue-100);
  font-size: 0.78rem;
  font-weight: 600;
}

/* Fields */
.field { display: grid; gap: 4px; margin-bottom: 12px; }
.field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.field input, .field select, .field textarea {
  font: inherit;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-lighter);
  background: #fff;
  color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--blue-100);
  border-color: var(--primary-light);
}

/* Tables — uppercase small column headers */
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-lighter);
  vertical-align: top;
}
.table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
}

/* Formal check rows */
.check-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--gray-lighter);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  background: #fff;
}
.check-row.defect { border-color: #fecaca; background: #fff7f7; }
.check-row.ok { border-color: #d9f0b8; background: #f7fbef; }
.check-row .icon { font-size: 1.1rem; line-height: 1; margin-top: 2px; }
.check-row .body { flex: 1; }
.check-row .label { font-weight: 600; font-size: 0.92rem; color: var(--text); }
.check-row .value { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }
.check-row .defect-msg { color: #b91c1c; font-size: 0.85rem; font-weight: 600; margin-top: 4px; }

/* Stepper — primary blue active */
.stepper {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.stepper .step {
  flex: 1;
  min-width: 100px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid var(--gray-lighter);
  font-size: 0.78rem;
  color: var(--text-muted);
  box-shadow: var(--shadow-xs);
}
.stepper .step strong {
  display: block;
  color: var(--text);
  font-size: 0.85rem;
  margin-bottom: 2px;
  font-family: var(--font-sans);
}
.stepper .step.active {
  border-color: var(--primary-light);
  background: var(--blue-50);
  color: var(--primary);
}
.stepper .step.active strong { color: var(--primary); }
.stepper .step.done {
  border-color: #c5e89a;
  background: #f7fbef;
}

/* Toast / drawer */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  background: var(--gray-darkest);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  font-size: 0.9rem;
  max-width: 360px;
  display: none;
}
.toast.show { display: block; animation: fadeIn 0.2s; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.4);
  z-index: 60;
  display: none;
}
.drawer-backdrop.open { display: block; }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(520px, 100%);
  background: #fff;
  z-index: 70;
  box-shadow: -8px 0 32px rgba(17, 24, 39, 0.12);
  transform: translateX(100%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-lighter);
  display: flex;
  align-items: center;
  gap: 12px;
}
.drawer-body { padding: 16px 20px; overflow: auto; flex: 1; }
.drawer-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--gray-lighter);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Kanban — light headers */
.kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.kanban-col {
  background: var(--gray-lightest);
  border-radius: var(--radius-lg);
  padding: 10px;
  min-height: 420px;
  border: 1px solid var(--gray-lighter);
}
.kanban-col h4 {
  margin: 0 0 10px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-sans);
  font-weight: 600;
  padding: 4px 2px;
}
.kanban-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--gray-lighter);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}
.kanban-card:hover { border-color: var(--primary-light); }
.kanban-card .title { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.kanban-card .sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

.split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
  min-height: 70vh;
}
@media (max-width: 960px) { .split { grid-template-columns: 1fr; } }

.pdf-preview {
  background: var(--gray-darkest);
  border-radius: var(--radius-lg);
  padding: 16px;
  color: #e5e7eb;
  min-height: 560px;
}
.pdf-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.pdf-page {
  background: #fff;
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 24px;
  min-height: 420px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.pdf-thumbs { display: flex; gap: 8px; overflow-x: auto; margin-top: 12px; }
.pdf-thumb {
  width: 64px;
  height: 84px;
  background: var(--gray-dark);
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  color: #fff;
  font-weight: 700;
}
.pdf-thumb.active {
  border-color: var(--primary-light);
  background: var(--primary);
}

.switcher {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.switcher button {
  border: 1px solid var(--gray-lighter);
  background: #fff;
  border-radius: var(--radius-full);
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  color: var(--text);
}
.switcher button.active {
  background: var(--blue-50);
  border-color: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}


/* First-class KYC / Creditreform panel (display-only) */
.kyc-panel {
  background: var(--card);
  border: 1px solid var(--gray-lighter);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 16px 18px 18px;
  margin: 12px 0;
  border-left: 4px solid var(--pink, #bd2ebd);
}
.kyc-panel--compact { padding: 12px 14px; }
.kyc-panel-head { margin-bottom: 8px; }
.kyc-panel-title {
  margin: 0;
  font-size: 1.25rem;
  font-family: var(--font-display, 'Nunito', sans-serif);
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.kyc-display-only {
  font-size: 0.7rem;
  font-family: var(--font-sans);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--blue-50);
  color: var(--primary);
  border: 1px solid var(--blue-100);
  border-radius: 999px;
  padding: 3px 10px;
}
.kyc-panel-sub { margin: 6px 0 0; font-size: 0.85rem; }
.kyc-chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 12px;
}
@media (max-width: 900px) {
  .kyc-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.kyc-chip {
  background: linear-gradient(180deg, #fff 0%, var(--gray-external) 100%);
  border: 1px solid var(--gray-lighter);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  min-height: 72px;
}
.kyc-chip .chip-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}
.kyc-chip .chip-value {
  display: block;
  margin-top: 6px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.25;
}
.kyc-detail-heading {
  margin: 4px 0 8px;
  font-size: 0.95rem;
  font-weight: 700;
}
.kyc-detail-table th { color: var(--text-muted); font-weight: 600; }

.kyc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.kyc-metric {
  background: var(--gray-external);
  border: 1px solid var(--gray-lighter);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}
.kyc-metric .k {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.kyc-metric .v { font-weight: 700; margin-top: 2px; color: var(--text); }

/* Compact KYC index at customer (click → drawer) */
.kyc-index {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 0;
  padding: 6px 10px 6px 8px;
  border: 1px solid var(--gray-lighter);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  max-width: 100%;
  text-align: left;
}
.kyc-index:hover, .kyc-index:focus-visible {
  border-color: var(--primary-light, #489ff6);
  box-shadow: 0 0 0 3px var(--blue-50, #e8f2fe);
  outline: none;
  background: var(--blue-50, #e8f2fe);
}
.kyc-ampel {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}
.kyc-index--ok .kyc-ampel {
  background: var(--green, #91cd50);
  box-shadow: 0 0 0 3px rgba(145, 205, 80, 0.22);
}
.kyc-index--mid .kyc-ampel {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}
.kyc-index--risk .kyc-ampel {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}
.kyc-index-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.kyc-index-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  line-height: 1.1;
}
.kyc-index-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
}
.kyc-index-hint {
  margin-left: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}
.kyc-panel--drawer {
  margin: 0;
  border-left-width: 3px;
  box-shadow: none;
}

.customer-kyc-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 14px;
}
/* Prefer .entity-card; customer-kyc-row kept as legacy alias layout */

/* Wider drawer for Prüfakte */
.drawer--wide { width: min(640px, 100%); }
.drawer--nested { z-index: 90; }
.drawer-backdrop--nested { z-index: 85; }

/* Compact Prüfakte index (analog KYC) */
.pa-index {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 0;
  padding: 6px 10px 6px 8px;
  border: 1px solid var(--gray-lighter);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  max-width: 100%;
  text-align: left;
}
.pa-index:hover, .pa-index:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--blue-50, #e8f2fe);
  outline: none;
  background: var(--blue-50, #e8f2fe);
}
.pa-ampel {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}
.pa-index--ok .pa-ampel {
  background: var(--green, #91cd50);
  box-shadow: 0 0 0 3px rgba(145, 205, 80, 0.22);
}
.pa-index--mid .pa-ampel {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}
.pa-index--risk .pa-ampel {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}
.pa-index-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.pa-index-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  line-height: 1.1;
}
.pa-index-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
}
.pa-index-hint {
  margin-left: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

/* Entscheidungsband */
.pa-band {
  border: 1px solid var(--gray-lighter);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--blue-50, #e8f2fe);
  padding: 12px 14px;
  margin: 0 0 12px;
}
.pa-band-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.pa-band-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin-bottom: 10px;
}
@media (max-width: 480px) {
  .pa-band-grid { grid-template-columns: 1fr; }
}
.pa-band-cell {
  background: #fff;
  border: 1px solid var(--gray-lighter);
  border-radius: var(--radius-md);
  padding: 8px 10px;
}
.pa-band-cell .chip-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.pa-band-cell .chip-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.pa-rationale {
  background: #fff;
  border: 1px solid var(--gray-lighter);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 0.88rem;
  line-height: 1.45;
}
.pa-rationale p { margin: 6px 0 0; }
.pa-rationale--rv { border-left: 3px solid var(--pink, #bd2ebd); }

.pa-rv-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 14px;
}
.pa-rv-chip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--gray-lighter);
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.pa-rv-chip:hover, .pa-rv-chip:focus-visible {
  border-color: var(--primary-light, #489ff6);
  background: var(--blue-50, #e8f2fe);
  outline: none;
}
.pa-rv-chip.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--blue-50, #e8f2fe);
  background: var(--blue-50, #e8f2fe);
}
.pa-rv-id { font-weight: 700; font-size: 0.88rem; }
.pa-rv-art { flex: 1; min-width: 120px; font-size: 0.85rem; color: var(--text-muted); }

.pa-section { margin-top: 16px; }
.pa-h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
.pa-doc-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.88rem;
}
.pa-doc-list li { margin: 4px 0; }
.pa-open-item {
  border: 1px solid var(--gray-lighter);
  border-left: 3px solid var(--warn, #f59e0b);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #fffbeb;
  font-size: 0.88rem;
}
.pa-open-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pa-why {
  margin: 4px 0 0;
  font-size: 0.84rem;
  color: var(--text);
  line-height: 1.4;
}
.pa-kyc-reuse {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.pa-rv-detail {
  border-top: 1px solid var(--gray-lighter);
  padding-top: 12px;
  margin-top: 4px;
}


.callout {
  border-left: 4px solid var(--primary);
  background: var(--blue-50);
  padding: 10px 12px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.88rem;
  margin: 12px 0;
  color: var(--text);
}
.callout.warn { border-color: var(--warn); background: #fffbeb; }
.callout.danger { border-color: var(--danger); background: #fef2f2; }

.footer-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 24px;
}
.footer-note code {
  background: var(--gray-lightest);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--gray-darkest);
}

.variant-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s, box-shadow 0.12s;
}
.variant-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(20, 60, 220, 0.12);
}
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.hist-item {
  font-size: 0.85rem;
  padding: 6px 0;
  border-bottom: 1px dashed var(--gray-lighter);
  color: var(--text);
}
.hist-item .when { color: var(--text-muted); font-size: 0.78rem; }

/* Legacy aliases so older class names still layout */
.app-header { display: none; }
.shell, .shell-wide { /* content lives in .ph-page */ }

/* ——— Partner intake (dropzone, confidence, steps) ——— */
.dropzone {
  border: 2px dashed var(--blue-300);
  border-radius: var(--radius-lg);
  background: var(--blue-50);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: var(--blue-100);
}
.dropzone .dz-title {
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--primary);
  margin: 0 0 6px;
}
.dropzone .dz-hint { color: var(--text-muted); font-size: 0.85rem; margin: 0; }

.file-list { list-style: none; margin: 12px 0 0; padding: 0; }
.file-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--gray-lighter);
  border-radius: var(--radius-md);
  background: #fff;
  margin-bottom: 8px;
  font-size: 0.9rem;
}
.file-list li .file-ico {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: var(--blue-50);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.7rem;
  flex-shrink: 0;
}
.file-list li .file-meta { flex: 1; min-width: 0; }
.file-list li .file-name { font-weight: 600; }
.file-list li .file-sub { font-size: 0.78rem; color: var(--text-muted); }
.file-list li .file-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--gray-lightest);
  color: var(--gray-darker);
}
.file-list li .file-tag.required { background: var(--blue-50); color: var(--primary); }

.confidence {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
}
.confidence.high { background: #f7fbef; color: #4d7c0f; border-color: #c5e89a; }
.confidence.mid { background: #fffbeb; color: #b45309; border-color: #fcd34d; }
.confidence.low { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

.ocr-edit-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--gray-lighter);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  background: #fff;
}
.ocr-edit-row.has-defect {
  border-color: #fecaca;
  background: #fff7f7;
}
.ocr-edit-row .ocr-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}
.ocr-edit-row .ocr-label { font-weight: 600; font-size: 0.92rem; }
.ocr-edit-row .ocr-raw {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: ui-monospace, monospace;
}
.ocr-edit-row input {
  font: inherit;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-lighter);
  width: 100%;
}
.ocr-edit-row.has-defect input {
  border-color: #f87171;
  background: #fff;
}
.ocr-edit-row input:focus {
  outline: 2px solid var(--blue-100);
  border-color: var(--primary-light);
}

.flow-diagram {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 12px 0 0;
}
.flow-diagram .flow-step {
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-md);
}
.flow-diagram .flow-arrow {
  color: var(--gray);
  font-weight: 700;
  font-size: 0.85rem;
}

.success-panel {
  text-align: center;
  padding: 32px 20px;
}
.success-panel .success-ico {
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  border-radius: var(--radius-full);
  background: #f7fbef;
  border: 2px solid #c5e89a;
  color: #65a30d;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 700;
}
.rueckfrage {
  border: 1px solid #fcd34d;
  background: #fffbeb;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.rueckfrage .rq-from {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.rueckfrage .rq-text { margin-top: 4px; font-weight: 600; color: var(--text); }
.rueckfrage .rq-field { margin-top: 8px; }

/* ——— PDF Preview with extraction highlights (Split / reusable) ——— */
.pdf-preview--hl {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pdf-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.pdf-btn-rerun {
  background: #fff !important;
  color: var(--primary) !important;
  border: 1px solid var(--primary-light) !important;
  font-weight: 600;
}
.pdf-btn-rerun:disabled {
  opacity: 0.7;
  cursor: wait;
}
.pdf-rerun-spin {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: pdf-spin 0.7s linear infinite;
  vertical-align: -1px;
  margin-right: 4px;
}
@keyframes pdf-spin { to { transform: rotate(360deg); } }

.pdf-remap-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px dashed var(--gray-light);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
}
.pdf-remap-hint::before {
  content: "↕ ";
  color: var(--primary-light);
}

.pdf-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pdf-legend-chip {
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  border: 1px solid var(--hl, var(--primary-light));
  color: #e2e8f0;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.pdf-legend-chip::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hl, var(--primary-light));
  margin-right: 5px;
  vertical-align: 0;
}
.pdf-legend-chip.is-selected,
.pdf-legend-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.pdf-faux-page {
  position: relative;
}
.pdf-faux-sheet {
  position: relative;
  background: linear-gradient(180deg, #fafafa 0%, #f3f4f6 100%);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 28px 32px 40px;
  min-height: 480px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  overflow: hidden;
  /* slight scanned look */
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.9), rgba(243,244,246,0.95)),
    repeating-linear-gradient(0deg, transparent, transparent 27px, rgba(20,60,220,0.03) 28px);
}
.pdf-faux-stamp {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--pink);
  border: 1.5px solid var(--pink);
  border-radius: 4px;
  padding: 3px 8px;
  transform: rotate(8deg);
  opacity: 0.85;
  z-index: 2;
  pointer-events: none;
}
.pdf-faux-letterhead { margin-bottom: 4px; padding-right: 72px; }
.pdf-faux-brand {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pdf-faux-doc-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}
.pdf-faux-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.pdf-faux-rule {
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--pink));
  margin: 12px 0 16px;
  border-radius: 2px;
  opacity: 0.85;
}
.pdf-faux-line {
  margin: 0 0 4px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #1f2937;
}
.pdf-faux-muted {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px !important;
}
.pdf-faux-small { font-size: 0.82rem; color: var(--gray-darker); }
.pdf-faux-gap { color: #b91c1c; font-style: italic; }
.pdf-faux-footer {
  position: absolute;
  bottom: 12px;
  left: 32px;
  right: 32px;
  font-size: 0.7rem;
  color: var(--gray);
  border-top: 1px solid var(--gray-lighter);
  padding-top: 8px;
  pointer-events: none;
}

.pdf-hl-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
.pdf-hl {
  position: absolute;
  pointer-events: auto;
  border: 2px solid;
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
  margin: 0;
  background: transparent;
  transition: box-shadow 0.15s, transform 0.1s;
  box-shadow: none;
}
.pdf-hl:hover {
  box-shadow: 0 0 0 3px rgba(20, 60, 220, 0.2);
  z-index: 4;
}
.pdf-hl.is-selected {
  box-shadow: 0 0 0 3px rgba(189, 46, 189, 0.35), 0 4px 12px rgba(20, 60, 220, 0.25);
  z-index: 5;
  transform: scale(1.01);
}
.pdf-hl-chip {
  position: absolute;
  top: -11px;
  left: 6px;
  font-size: 0.62rem;
  font-weight: 700;
  color: #fff;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  letter-spacing: 0.02em;
  pointer-events: none;
  font-family: var(--font-sans);
}

/* Inline highlights: wrap real extracted lines (meeting-safe, no floating %) */
.pdf-hl-inline {
  display: block;
  width: 100%;
  text-align: left;
  position: relative;
  pointer-events: auto;
  border: 2px solid;
  border-radius: 4px;
  cursor: pointer;
  padding: 6px 10px 6px 10px;
  margin: 4px 0 8px;
  font: inherit;
  color: inherit;
  line-height: 1.45;
  transition: box-shadow 0.15s;
}
.pdf-hl-inline .pdf-hl-chip {
  position: absolute;
  top: -10px;
  left: 8px;
}
.pdf-hl-inline-body {
  display: block;
  padding-top: 2px;
}
.pdf-hl-inline:hover {
  box-shadow: 0 0 0 3px rgba(20, 60, 220, 0.2);
}
.pdf-hl-inline.is-selected {
  box-shadow: 0 0 0 3px rgba(189, 46, 189, 0.35), 0 4px 12px rgba(20, 60, 220, 0.2);
}


.pdf-recog {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: #e5e7eb;
  font-size: 0.85rem;
  min-height: 52px;
}
.pdf-recog.muted { color: #94a3b8; }
.pdf-recog-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.pdf-recog-label {
  font-weight: 700;
  color: #fff;
  font-size: 0.92rem;
}
.pdf-recog-pct {
  font-size: 0.8rem;
  color: #cbd5e1;
  margin-left: auto;
}
.pdf-recog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}
.pdf-recog-grid .chip-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  margin-bottom: 2px;
}
.pdf-recog-grid code {
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 1px 5px;
  border-radius: 3px;
}
@media (max-width: 640px) {
  .pdf-recog-grid { grid-template-columns: 1fr; }
}

/* Checklist row selection (linked to PDF highlight) */
.check-row {
  cursor: pointer;
  transition: box-shadow 0.12s, border-color 0.12s;
}
.check-row.is-selected {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px rgba(20, 60, 220, 0.25);
  outline: none;
}
.check-row.has-hl .label::after {
  content: " · PDF";
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0;
  text-transform: none;
}
.check-row .recog-inline {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--primary-dark);
  background: var(--blue-50);
  border-radius: 4px;
  padding: 4px 8px;
}

/* ——— Clean Fachprüfung decision rail (progressive disclosure) ——— */
.split.split--clean {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 400px);
  align-items: start;
  gap: 14px;
  min-height: calc(100vh - var(--topbar-h) - 120px);
}
.split--clean > #previewHost,
.split--clean > .decision-rail-wrap {
  min-width: 0;
}
.decision-rail-wrap {
  position: sticky;
  top: calc(var(--topbar-h) + 12px);
  max-height: calc(100vh - var(--topbar-h) - 24px);
  display: flex;
  flex-direction: column;
}
.decision-rail {
  background: var(--card);
  border: 1px solid var(--gray-lighter);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--topbar-h) - 24px);
  overflow: hidden;
}
.dr-scroll {
  overflow-y: auto;
  padding: 14px 14px 8px;
  flex: 1;
  min-height: 0;
}
.dr-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray-lightest);
  margin-bottom: 10px;
}
.dr-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.dr-customer {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.25;
  color: var(--text);
}
.dr-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.dr-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dr-switcher button {
  appearance: none;
  border: 1px solid var(--gray-lighter);
  background: #fff;
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}
.dr-switcher button.active {
  background: var(--blue-50);
  border-color: var(--blue-200);
  color: var(--primary);
}
.dr-band {
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--blue-100);
  background: var(--blue-50);
}
.dr-band.tone-warn {
  border-color: #fde68a;
  background: #fffbeb;
}
.dr-band.tone-ok {
  border-color: #d9f0b8;
  background: #f7fbef;
}
.dr-band-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.dr-band-rec {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  line-height: 1.3;
}
.dr-band-why {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.dr-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 6px;
}
.dr-blockers {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.dr-blocker {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  text-align: left;
  appearance: none;
  border: 1px solid #fecaca;
  background: #fff7f7;
  border-radius: var(--radius-md);
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
  transition: box-shadow 0.12s, border-color 0.12s;
}
.dr-blocker:hover { border-color: #f87171; }
.dr-blocker.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(20, 60, 220, 0.22);
}
.dr-blocker .ico {
  color: #b91c1c;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1.3;
}
.dr-blocker .body { flex: 1; min-width: 0; }
.dr-blocker .label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
}
.dr-blocker .defect {
  font-size: 0.78rem;
  color: #b91c1c;
  margin-top: 1px;
}
.dr-blocker .pdf-link {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}
.dr-blocker.no-hl .pdf-link { display: none; }
.dr-empty-ok {
  border: 1px solid #d9f0b8;
  background: #f7fbef;
  border-radius: var(--radius-md);
  padding: 8px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #3f6212;
  margin-bottom: 12px;
}
.dr-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  align-items: center;
}
.dr-fact {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--gray-lighter);
  background: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
}
.dr-fact.ok { border-color: #d9f0b8; background: #f7fbef; color: #3f6212; }
.dr-fact.warn { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.dr-facts .kyc-index,
.dr-facts .pa-index {
  padding: 4px 8px;
  min-height: 0;
  gap: 6px;
}
.dr-facts .kyc-index-label,
.dr-facts .pa-index-label { font-size: 0.65rem; }
.dr-facts .kyc-index-value,
.dr-facts .pa-index-value { font-size: 0.72rem; }
.dr-facts .kyc-index-hint,
.dr-facts .pa-index-hint {
  font-size: 0.65rem;
  padding: 1px 6px;
}
.dr-accordion {
  border: 1px solid var(--gray-lighter);
  border-radius: var(--radius-md);
  margin-bottom: 4px;
  overflow: hidden;
  background: #fff;
}
.dr-accordion > summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  user-select: none;
}
.dr-accordion > summary::-webkit-details-marker { display: none; }
.dr-accordion > summary::after {
  content: "+";
  font-weight: 700;
  color: var(--text-muted);
}
.dr-accordion[open] > summary::after { content: "−"; }
.dr-accordion-body {
  padding: 0 8px 8px;
  border-top: 1px solid var(--gray-lightest);
}
.dr-accordion .check-row {
  margin-top: 6px;
  padding: 8px 10px;
}
.dr-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--gray-lighter);
  background: #fff;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dr-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dr-footer-actions .btn { flex: 1 1 auto; min-width: 0; }
.dr-footer-more {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dr-footer-more .btn { font-size: 0.8rem; padding: 6px 10px; }
.dr-reason {
  width: 100%;
  font: inherit;
  font-size: 0.82rem;
  border: 1px solid var(--gray-lighter);
  border-radius: var(--radius-md);
  padding: 6px 8px;
  resize: vertical;
  min-height: 52px;
  color: var(--text);
}
.dr-reason:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(20, 60, 220, 0.15);
}
.clean-topbar-note {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.pill-primary {
  background: var(--blue-50);
  color: var(--primary);
  border: 1px solid var(--blue-200);
  font-weight: 700;
}
.pill-archived {
  background: var(--gray-lightest);
  color: var(--gray-darker);
  border: 1px solid var(--gray-lighter);
}
.variant-card.featured {
  border-color: var(--blue-200);
  box-shadow: 0 0 0 2px rgba(20, 60, 220, 0.08), var(--shadow-sm);
}
.variant-card .pill + .pill { margin-left: 6px; }

/* ——— Entity card (Partner / Customer) ——— */
.entity-card {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
}
.entity-card__main {
  min-width: 0;
  flex: 1 1 240px;
}
.entity-card__role {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-bottom: 2px;
}
.entity-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.25;
}
.entity-card__meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.entity-card__chips {
  margin-top: 8px;
}
.entity-card__accessors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.entity-card__accessors .kyc-index,
.entity-card__accessors .pa-index {
  margin: 0;
}
.entity-card__aside {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: flex-start;
  flex: 0 1 auto;
}
.entity-card__aside-block {
  min-width: 0;
}
.entity-card--compact .entity-card__title {
  font-size: 1rem;
}
.entity-card--compact .entity-card__accessors {
  margin-top: 8px;
  gap: 6px;
}
.entity-card--compact .entity-card__accessors .kyc-index,
.entity-card--compact .entity-card__accessors .pa-index {
  padding: 4px 8px;
  gap: 6px;
}
.entity-card--compact .kyc-index-label,
.entity-card--compact .pa-index-label { font-size: 0.65rem; }
.entity-card--compact .kyc-index-value,
.entity-card--compact .pa-index-value { font-size: 0.72rem; }
.entity-card--compact .kyc-index-hint,
.entity-card--compact .pa-index-hint {
  font-size: 0.65rem;
  padding: 1px 6px;
}

/* Hub primary path */
.hub-path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 14px 0 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.hub-path strong { color: var(--primary); }
.hub-path .hub-path-sep { color: var(--gray); font-weight: 500; }
.variant-card.featured-path {
  border-color: var(--blue-200);
  box-shadow: 0 0 0 2px rgba(20, 60, 220, 0.08), var(--shadow-sm);
}
.variant-card .path-step {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Rail: entity accessors live in header, not duplicated in facts */
.dr-header .entity-card {
  width: 100%;
}
.dr-header .entity-card__aside {
  flex-shrink: 0;
}
.dr-footer-more {
  opacity: 0.92;
}
.dr-footer-more .btn {
  background: #fff;
}

@media (max-width: 960px) {
  .split.split--clean { grid-template-columns: 1fr; }
  .decision-rail-wrap { position: static; max-height: none; }
  .decision-rail { max-height: none; }
}

/* ——— Track A: Nutzung aktiver Rahmen ——— */
.ta-title-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  justify-content: flex-end;
}
.ta-seg {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--border, var(--gray-lighter));
  border-radius: var(--radius-lg);
  padding: 4px;
  box-shadow: var(--shadow-xs);
}
.ta-seg--sm { padding: 3px; }
.ta-seg-btn {
  appearance: none;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-darker);
  padding: 7px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.ta-seg--sm .ta-seg-btn { padding: 5px 9px; font-size: 0.75rem; font-weight: 500; color: var(--text-muted); }
.ta-seg-btn:hover { background: var(--blue-50); color: var(--primary); }
.ta-seg-btn.active {
  background: var(--blue-100);
  color: var(--primary);
}

.ta-primary-card { border-color: var(--blue-200, #c7d2fe); }

.ta-inline-note {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.45;
  border: 1px solid transparent;
}
.ta-inline-note--ok {
  background: color-mix(in srgb, #65a30d 10%, white);
  border-color: color-mix(in srgb, #65a30d 28%, white);
  color: #3f6212;
}
.ta-inline-note--warn {
  background: color-mix(in srgb, #d97706 8%, white);
  border-color: color-mix(in srgb, #d97706 28%, white);
  color: #92400e;
}

.ta-rahmen-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-lighter);
}
.ta-sec-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.ta-hist-card { padding: 10px 16px; }

.ta-ober .ta-vol-stack { text-align: right; }
.ta-vol-big {
  font-family: Nunito, sans-serif;
  font-weight: 700;
  font-size: 1.45rem;
  color: var(--primary);
  line-height: 1.1;
}

.ta-bar { margin-top: 12px; width: 100%; }
.ta-bar-track {
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--gray-lighter, #e8e8e8);
  overflow: hidden;
}
.ta-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--primary);
  transition: width 0.35s ease;
}
.ta-bar-fill--ok { background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.ta-bar-fill--warn { background: linear-gradient(90deg, #d97706, #f59e0b); }
.ta-bar-fill--danger { background: linear-gradient(90deg, #dc2626, #f87171); }
.ta-bar-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.ta-teil-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.ta-teil-card {
  appearance: none;
  text-align: left;
  background: #fff;
  border: 1px solid var(--gray-lighter);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font: inherit;
  color: inherit;
}
.ta-teil-card--static {
  cursor: default;
}
.ta-teil-card--static:hover {
  border-color: var(--gray-lighter);
  box-shadow: none;
}
.ta-teil-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-xs);
}
.ta-teil-card.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(20, 60, 220, 0.12);
}
.ta-teil-rest {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.ta-teil-rest strong { color: var(--text); }

.ta-folge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.ta-readonly {
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-lighter);
  background: var(--gray-external, #f5f6f8);
  font-size: 0.9rem;
}

.ta-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-bottom: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}
.ta-step {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--gray-external, #f5f6f8);
  color: var(--text-muted);
  border: 1px solid var(--gray-lighter);
}
.ta-step.is-active {
  background: var(--blue-100);
  color: var(--primary);
  border-color: var(--blue-200, var(--blue-100));
}
.ta-step.is-done {
  background: color-mix(in srgb, #65a30d 12%, white);
  color: #4d7c0f;
  border-color: color-mix(in srgb, #65a30d 28%, white);
}
.ta-step-arrow { color: var(--gray); font-weight: 500; }

.ta-details {
  border-top: none;
  padding-top: 0;
}
.ta-details > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
  list-style: none;
}
.ta-details > summary::-webkit-details-marker { display: none; }
.ta-details > summary::before {
  content: '▸ ';
  color: var(--primary-light);
}
.ta-details[open] > summary::before { content: '▾ '; }

.ta-hist-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}
.ta-hist-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-lighter);
}
.ta-hist-list li:last-child { border-bottom: none; }
.ta-hist-main { font-size: 0.9rem; }
.ta-hist-meta {
  margin-top: 4px;
  font-size: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
}

/* ——— Track A: Quote-Wizard Bestellung ——— */
.ta-qw-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-bottom: 14px;
  font-size: 0.78rem;
  font-weight: 600;
}
.ta-qw-body { min-height: 120px; }
.ta-qw-panel h3 {
  font-family: Nunito, sans-serif;
  font-size: 1.1rem;
}
.ta-qw-bound {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  padding: 12px;
  background: var(--gray-external, #f5f6f8);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-lighter);
}
.ta-qw-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}
.ta-qw-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ta-qw-choice {
  appearance: none;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--gray-lighter);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}
.ta-qw-choice:hover {
  border-color: var(--primary-light);
  background: var(--blue-50);
}
.ta-qw-choice.is-selected {
  border-color: var(--primary);
  background: var(--blue-100);
  color: var(--primary);
  box-shadow: 0 0 0 2px rgba(20, 60, 220, 0.12);
}
.ta-qw-choice--wide {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 160px;
}
.ta-qw-dl {
  display: grid;
  gap: 8px 16px;
  margin: 0;
}
.ta-qw-dl > div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px;
  font-size: 0.9rem;
  padding: 6px 0;
  border-bottom: 1px solid var(--gray-lighter);
}
.ta-qw-dl dt {
  margin: 0;
  color: var(--text-muted);
  font-weight: 500;
}
.ta-qw-dl dd { margin: 0; }
.ta-qw-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px 14px;
}
.ta-qw-summary > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: var(--gray-external, #f5f6f8);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-lighter);
  font-size: 0.875rem;
}
.ta-qw-summary strong { font-size: 0.95rem; }
.ta-qw-done { padding: 4px 0 8px; }
.ta-qw-status-jump {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: 0.8rem;
  font-weight: 600;
}
.ta-qw-status {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--gray-external, #f5f6f8);
  border: 1px solid var(--gray-lighter);
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
}
.ta-qw-status--skip {
  text-decoration: line-through;
  opacity: 0.75;
  background: #fff;
}
.ta-qw-status--skip em {
  font-style: normal;
  text-decoration: none;
  display: inline-block;
  margin-left: 4px;
  color: var(--primary);
  font-weight: 700;
  font-family: inherit;
}
.ta-qw-status--ok {
  background: color-mix(in srgb, #65a30d 12%, white);
  color: #4d7c0f;
  border-color: color-mix(in srgb, #65a30d 28%, white);
}
.pill-muted {
  background: var(--gray-external, #f5f6f8);
  color: var(--text-muted);
  border: 1px solid var(--gray-lighter);
}
