/* ================================================================
   DMSKI DESIGN SYSTEM – High-Trust Navy + Gold
   "A Private Digital Vault with a Senior Legal AI Adviser"
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700&family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Design Tokens ── */
:root {
  --navy:          #1A2B3C;
  --navy-2:        #243447;
  --navy-3:        #0F1E2B;
  --navy-glass:    rgba(26, 43, 60, 0.04);
  --gold:          #C5A059;
  --gold-2:        #B8904A;
  --gold-light:    rgba(197, 160, 89, 0.10);
  --gold-border:   rgba(197, 160, 89, 0.28);
  --emerald:       #B8904A;
  --emerald-light: #f3ecdb;

  --bg:            #F8F9FA;
  --bg-subtle:     #F0F2F5;
  --card:          #FFFFFF;
  --border:        #E2E8EF;
  --border-soft:   #EEF2F6;

  --ink:           #1A2B3C;
  --ink-soft:      #4A5568;
  --ink-muted:     #8899AA;

  /* Semantic aliases — kept so existing CSS still works */
  --accent:        #C5A059;
  --accent-2:      #B8904A;
  --accent-light:  rgba(197, 160, 89, 0.08);
  --error:         #C0392B;
  --error-light:   #FDF0EF;
  --ok:            #B8904A;
  --ok-light:      #f3ecdb;

  --radius-lg:     8px;
  --radius-md:     6px;
  --radius-sm:     4px;

  --sidebar-w:     220px;
  --shadow:        0 1px 3px rgba(26,43,60,.05), 0 2px 10px rgba(26,43,60,.07);
  --shadow-md:     0 4px 20px rgba(26,43,60,.10), 0 1px 4px rgba(26,43,60,.06);
  --shadow-lg:     0 8px 32px rgba(26,43,60,.14);
}

/* ── Global reset (ensure Inter is used everywhere) ── */
* { box-sizing: border-box; }
body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  margin: 0;
  min-height: 100vh;
}

/* Headings use Poppins */
h1, h2, h3, h4, .card-title, .step-title, .workflow-gutachter-title {
  font-family: "Poppins", "Inter", system-ui, sans-serif !important;
  letter-spacing: -.01em;
}

/* ================================================================
   SIDEBAR NAVIGATION
   ================================================================ */
.dmski-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid rgba(255,255,255,.06);
}

/* Logo area */
.sb-logo-area {
  padding: 1.5rem 1.25rem 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}

.sb-brand { display: inline-block; text-decoration: none; }
.sb-logo {
  display: block;
  height: 2.8rem;
  width: auto;
}

.sb-tagline {
  margin: .5rem 0 0;
  font-size: .67rem;
  font-weight: 400;
  line-height: 1.45;
  font-style: italic;
  color: rgba(255,255,255,.52);
  font-family: "Inter", sans-serif !important;
}

/* Greeting */
.sb-greeting {
  padding: .8rem 1.2rem .2rem;
  font-size: .82rem;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  letter-spacing: .01em;
}
.sb-greeting .sb-role {
  display: block;
  margin-top: .15rem;
  font-size: .72rem;
  font-weight: 600;
  color: #C5A059;
  letter-spacing: .04em;
}

/* Credit badge in sidebar */
.sb-credit-badge {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: .5rem 1rem .3rem;
  padding: .5rem .9rem;
  border-radius: 8px;
  background: rgba(197,160,89,.1);
  border: 1px solid rgba(197,160,89,.2);
  color: var(--gold);
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 180ms ease;
}
.sb-credit-badge svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.sb-credit-badge:hover {
  background: rgba(197,160,89,.18);
  border-color: rgba(197,160,89,.35);
}

/* Nav area */
.sb-nav {
  flex: 1;
  padding: 1rem 0 .5rem;
  display: flex;
  flex-direction: column;
}

.sb-section {
  display: block;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.38);
  padding: .7rem 1.25rem .3rem;
  font-family: "Inter", sans-serif !important;
}

.sb-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .62rem 1.25rem;
  font-size: .84rem;
  font-weight: 500;
  color: rgba(255,255,255,.78);
  text-decoration: none;
  transition: color .15s ease, background .15s ease;
  border: none;
  background: none;
  font-family: "Inter", sans-serif !important;
  cursor: pointer;
  width: 100%;
  text-align: left;
  border-left: 2px solid transparent;
}

.sb-link:hover {
  color: rgba(255,255,255,.92);
  background: rgba(255,255,255,.05);
}

.sb-link.sb-active {
  color: var(--gold);
  background: rgba(197,160,89,.09);
  border-left-color: var(--gold);
  font-weight: 600;
}

.sb-link svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  opacity: .8;
}

.sb-link.sb-active svg { opacity: 1; }

/* Footer / Logout */
.sb-footer {
  padding: .75rem 0 1.25rem;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}

.sb-logout { color: rgba(255,255,255,.50) !important; }
.sb-logout:hover { color: rgba(192,57,43,0.8) !important; background: rgba(255,80,80,.08) !important; }
.sb-logout svg { opacity: .75; }

/* ── Sidebar mobile collapse ── */
@media (max-width: 768px) {
  .dmski-sidebar { width: 100%; height: auto; position: relative; flex-direction: row; flex-wrap: wrap; }
  .sb-logo-area { padding: .75rem 1rem; border-bottom: none; border-right: 1px solid rgba(255,255,255,.08); }
  .sb-nav { flex-direction: row; padding: .5rem 0; flex: 1; }
  .sb-section { display: none; }
  .sb-link { padding: .5rem .85rem; font-size: .8rem; border-left: none; border-bottom: 2px solid transparent; }
  .sb-link.sb-active { border-bottom-color: var(--gold); border-left-color: transparent; }
  .sb-footer { padding: .5rem 0; border-top: none; border-left: 1px solid rgba(255,255,255,.08); }
  .sb-tagline { display: none; }
}

/* ── Page layout with sidebar ── */
body.has-sidebar .page {
  margin-left: var(--sidebar-w);
  max-width: none;
  padding: 2rem 2.5rem 4rem;
}

@media (max-width: 768px) {
  body.has-sidebar .page {
    margin-left: 0;
    padding: 1.25rem 1rem 3rem;
  }
}

/* ── Page Hero Banner (injected by nav.js) ── */
.page-hero {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1.2rem 1.6rem;
  margin-bottom: 1.8rem;
  background: linear-gradient(135deg, var(--navy, #1A2B3C) 0%, #243b50 100%);
  border-radius: 12px;
  border-bottom: 3px solid var(--gold, #C5A059);
  box-shadow: 0 2px 12px rgba(26,43,60,.12);
}

.page-hero-icon {
  width: 2.6rem;
  height: 2.6rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.1);
  border-radius: 10px;
  border: 1px solid rgba(197,160,89,.25);
}

.page-hero-icon svg {
  width: 1.3rem;
  height: 1.3rem;
  fill: none;
  stroke: var(--gold, #C5A059);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-hero-text h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #F8F9FA;
  letter-spacing: -0.01em;
}

.page-hero-text p {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: rgba(255,255,255,.55);
  font-weight: 400;
}

/* ── Modern Modal (Glassmorphism) ── */
.dmski-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 20, 30, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: dmskiModalFadeIn 0.2s ease;
}

@keyframes dmskiModalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes dmskiModalSlideUp {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.dmski-modal {
  position: relative;
  width: 92%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(10, 20, 30, 0.25), 0 2px 8px rgba(10, 20, 30, 0.1);
  padding: 1.8rem 1.6rem 1.4rem;
  animation: dmskiModalSlideUp 0.25s ease;
}

.dmski-modal-icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.9rem;
  font-size: 1.2rem;
}

.dmski-modal-icon.is-warn {
  background: rgba(197, 160, 89, 0.15);
  color: var(--gold, #C5A059);
}

.dmski-modal-icon.is-info {
  background: rgba(26, 43, 60, 0.08);
  color: var(--navy, #1A2B3C);
}

.dmski-modal-icon.is-error {
  background: rgba(213, 83, 83, 0.12);
  color: #C0392B;
}

.dmski-modal-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy, #1A2B3C);
}

.dmski-modal-body {
  margin: 0 0 1.3rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #4A5568;
}

.dmski-modal-body strong {
  color: var(--navy, #1A2B3C);
  font-weight: 600;
}

.dmski-modal-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}

.dmski-modal-btn {
  padding: 0.55rem 1.2rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  font-family: inherit;
}

.dmski-modal-btn.is-secondary {
  background: rgba(26, 43, 60, 0.07);
  color: #4A5568;
}

.dmski-modal-btn.is-secondary:hover {
  background: rgba(26, 43, 60, 0.13);
}

.dmski-modal-btn.is-primary {
  background: var(--navy, #1A2B3C);
  color: #F8F9FA;
}

.dmski-modal-btn.is-primary:hover {
  background: #243b50;
}

.dmski-modal-btn.is-gold {
  background: linear-gradient(135deg, #C5A059, #b08a3e);
  color: #fff;
}

.dmski-modal-btn.is-gold:hover {
  background: linear-gradient(135deg, #d4af6a, #C5A059);
}

.dmski-modal-btn.is-danger {
  background: #C0392B;
  color: #fff;
}

.dmski-modal-btn.is-danger:hover {
  background: #a93226;
}

.dmski-modal-btn.is-danger-outline {
  background: transparent;
  color: #C0392B;
  border: 1px solid rgba(213, 83, 83, 0.3);
}

.dmski-modal-btn.is-danger-outline:hover {
  background: rgba(213, 83, 83, 0.08);
  border-color: rgba(213, 83, 83, 0.5);
}

/* ── Hide old topbar (replaced by sidebar) ── */
.topbar { display: none !important; }

/* ── Auth Gate update ── */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

/* ================================================================
   CARDS – updated to new design system
   ================================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

/* Card accent lines – subtle, modern */
.card-new-case  { border-top: 2px solid var(--gold); }
.card-open-case { border-top: 2px solid rgba(26,43,60,0.15); }
.card-workflow  { border-top: 2px solid rgba(26,43,60,0.1); }

/* ================================================================
   BUTTONS – Primary now uses Gold
   ================================================================ */
.btn-primary {
  background: linear-gradient(150deg, var(--gold), var(--gold-2)) !important;
  color: #fff !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 2px 8px rgba(197,160,89,.28);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(197,160,89,.38) !important;
  filter: brightness(1.05);
}

button[type="submit"],
.btn-save {
  background: linear-gradient(150deg, var(--gold), var(--gold-2)) !important;
  border-color: var(--gold-2) !important;
}

/* Ghost buttons – use Navy style */
.ghost {
  border: 1.5px solid rgba(26,43,60,.15);
  color: var(--ink-soft);
  background: transparent;
}
.ghost:hover {
  background: var(--navy-glass);
  border-color: rgba(26,43,60,.28);
  color: var(--navy);
}

/* ================================================================
   FORM ELEMENTS – updated focus to gold
   ================================================================ */
.field-input:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px rgba(197,160,89,.15) !important;
}

select.field-input {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--gold) 50%),
    linear-gradient(135deg, var(--gold) 50%, transparent 50%) !important;
}

/* ================================================================
   MISC COMPONENT UPDATES
   ================================================================ */
/* Step numbers – Navy instead of teal */
.step-number {
  background: linear-gradient(145deg, var(--navy-2), var(--navy)) !important;
  box-shadow: 0 2px 6px rgba(26,43,60,.22) !important;
}

/* Workflow step connector line */
.workflow-step:not(:last-child)::after {
  background: linear-gradient(to bottom, var(--gold), transparent) !important;
}

/* Required dot */
.required-dot { color: var(--gold) !important; }

/* Open case select border */
.open-case-select { border-color: var(--navy) !important; }

/* Welcome strip */
.welcome-strip {
  background: linear-gradient(135deg, rgba(197,160,89,.06), rgba(197,160,89,.03)) !important;
  border-color: rgba(197,160,89,.22) !important;
}
.welcome-icon {
  background: rgba(197,160,89,.12) !important;
  color: var(--gold) !important;
}

/* Card icon variants */
.card-icon--teal  { background: rgba(197,160,89,.12); color: var(--gold); }
.card-icon--blue  { background: rgba(26,43,60,.08); color: var(--navy); }
.card-icon--amber { background: var(--emerald-light); color: var(--emerald); }

/* Workflow gutachter box – green preserved */
.workflow-gutachter-box { background: linear-gradient(135deg, rgba(197,160,89,0.06), rgba(197,160,89,0.04)) !important; border-color: rgba(197,160,89,0.28) !important; }
.workflow-gutachter-num { color: var(--emerald) !important; }

/* Workflow tip box */
.workflow-tip { background: rgba(197,160,89,.06) !important; border-color: rgba(197,160,89,.3) !important; color: var(--ink-soft) !important; }
.workflow-tip svg { color: var(--gold) !important; }
.workflow-tip strong { color: var(--navy) !important; }

/* Message states */
.message--success { color: var(--emerald) !important; }
.message--error   { color: var(--error) !important; }

/* ================================================================
   DASHBOARD – NEW UI COMPONENTS (welcome strip, grid, workflow)
   ================================================================ */

/* ── Welcome strip ── */
.welcome-strip {
  margin-bottom: 1.5rem;
  padding: .85rem 1.2rem;
  border-radius: var(--radius-md);
  background: #f5f6f8;
  border: none;
}

.welcome-inner {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.welcome-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: rgba(26,43,60,.13);
  color: var(--accent);
  flex-shrink: 0;
}

.welcome-icon svg { width: 1rem; height: 1rem; }

.welcome-text {
  margin: 0;
  font-size: .88rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* ── Two-column dashboard grid ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-bottom: 1.5rem;
  align-items: start;
}

@media (max-width: 860px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* ── Card variants ── */
.card-new-case  { border-top: 3px solid var(--accent); }
.card-open-case { border-top: 3px solid #C5A059; }
.card-workflow  { border-top: 3px solid #C5A059; }

/* ── Card header row (icon + title + subtitle) ── */
.card-header-row {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: 1.25rem;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 10px;
  flex-shrink: 0;
  margin-top: .05rem;
}

.card-icon svg { width: 1.1rem; height: 1.1rem; }

.card-icon--teal  { background: rgba(197,160,89,0.08); color: var(--accent); }
.card-icon--blue  { background: rgba(26,43,60,0.08); color: #1A2B3C; }
.card-icon--amber { background: rgba(197,160,89,0.1); color: #B8904A; }

.card-title {
  margin: 0 0 .2rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .01em;
  line-height: 1.25;
}

.card-subtitle {
  margin: 0;
  font-size: .82rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ── Form layout ── */
.dashboard-form {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: .28rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
}

@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
}

.field-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .22em;
  font-size: .8rem;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: .01em;
}

.required-dot {
  color: var(--accent);
  font-size: .82em;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}

.field-help {
  font-size: .72rem;
  line-height: 1.45;
  color: var(--ink-muted);
  margin-top: .18rem;
  padding-left: .1rem;
}

.parties-intro {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .78rem .95rem .8rem;
  margin: .25rem 0 .85rem;
  background: linear-gradient(135deg, rgba(197,160,89,.08), rgba(197,160,89,.02));
  border: 1px solid rgba(197,160,89,.22);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
}

.parties-intro-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--accent);
  margin-top: .08rem;
}

.parties-intro-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.parties-intro p {
  margin: 0;
  font-size: .8rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.parties-intro strong {
  display: block;
  color: var(--ink);
  font-weight: 700;
  font-size: .84rem;
  margin-bottom: .2rem;
}

.parties-intro u {
  text-decoration: none;
  font-weight: 600;
  color: var(--ink);
  background: linear-gradient(180deg, transparent 62%, rgba(197,160,89,.28) 62%);
  padding: 0 .1em;
}

.parties-intro em {
  font-style: normal;
  color: var(--accent-2);
  font-weight: 600;
  white-space: nowrap;
}

.field-input {
  width: 100%;
  padding: .68rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: .9rem;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
  appearance: none;
}

.field-input::placeholder { color: var(--ink-muted); }

.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26,43,60,.13);
}

.field-input:hover:not(:focus):not(:disabled) { border-color: rgba(197,160,89,0.5); }

.field-input:disabled {
  background: #f5f8fa;
  color: var(--ink-muted);
  cursor: not-allowed;
  opacity: .72;
}

select.field-input {
  padding-right: 2.2rem;
  background-image:
    linear-gradient(45deg,  transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position:
    calc(100% - 1rem)   calc(50% - .05rem),
    calc(100% - .75rem) calc(50% - .05rem);
  background-size: .38rem .38rem;
  background-repeat: no-repeat;
  cursor: pointer;
}

select.field-input:disabled {
  background-image:
    linear-gradient(45deg,  transparent 50%, var(--ink-muted) 50%),
    linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 1rem)   calc(50% - .05rem),
    calc(100% - .75rem) calc(50% - .05rem);
  background-size: .38rem .38rem;
  background-repeat: no-repeat;
}

/* ── Primary button ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border: 0;
  border-radius: var(--radius-md);
  padding: .75rem 1.5rem;
  font: inherit;
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .01em;
  cursor: pointer;
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
  color: #fff;
  white-space: nowrap;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(26,43,60,.26);
  filter: saturate(1.07);
}

.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-full { width: 100%; margin-top: .25rem; }

/* ── Open-case section ── */
.open-case-body {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.open-case-select {
  font-size: 1rem !important;
  padding: .85rem 2.2rem .85rem 1rem !important;
  border-color: var(--accent) !important;
  border-width: 1.5px !important;
  box-shadow: 0 1px 4px rgba(26,43,60,.06) !important;
}

.open-case-hint {
  display: flex;
  align-items: flex-start;
  gap: .4rem;
  margin: .35rem 0 0;
  font-size: .8rem;
  color: var(--ink-muted);
  line-height: 1.55;
}

/* ── Workflow steps ── */
.workflow-steps {
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  counter-reset: none;
}

.workflow-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: .9rem 0;
  border-bottom: 1px solid var(--border-soft);
  position: relative;
}

.workflow-step:last-child { border-bottom: none; }

/* Vertical connector line between steps */
.workflow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 1.05rem;
  top: calc(.9rem + 2.1rem);
  bottom: 0;
  width: 1.5px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  opacity: .25;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: .82rem;
  font-weight: 800;
  flex-shrink: 0;
  letter-spacing: .02em;
  box-shadow: 0 2px 6px rgba(26,43,60,.22);
}

.step-body {
  flex: 1;
  min-width: 0;
  padding-top: .18rem;
}

.step-title {
  display: block;
  font-size: .92rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: .28rem;
}

.step-desc {
  margin: 0;
  font-size: .84rem;
  color: var(--ink-soft);
  line-height: 1.65;
}

.step-desc em {
  font-style: normal;
  font-weight: 600;
  color: var(--accent-2);
}

/* ── Gutachter quickstart box ── */
.workflow-gutachter-box {
  margin-bottom: 1.4rem;
  padding: 1rem 1.15rem 1.1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(197,160,89,0.06), rgba(197,160,89,0.04));
  border: 1.5px solid #f3ecdb;
}

.workflow-gutachter-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .55rem;
  flex-wrap: wrap;
}

.workflow-gutachter-badge {
  display: inline-flex;
  align-items: center;
  padding: .22rem .72rem;
  border-radius: 999px;
  background: #C5A059;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.workflow-gutachter-title {
  font-size: .95rem;
  font-weight: 800;
  color: #1A2B3C;
  line-height: 1.25;
}

.workflow-gutachter-desc {
  margin: 0 0 .7rem;
  font-size: .88rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

.workflow-gutachter-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .52rem;
}

.workflow-gutachter-steps li {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  font-size: .88rem;
  color: var(--ink);
  line-height: 1.6;
}

.workflow-gutachter-num {
  flex-shrink: 0;
  font-size: 1.15rem;
  line-height: 1.3;
  color: #C5A059;
  font-weight: 800;
}

/* Step text wrapper – ensures text stays as one flex child */
.wg-step-text {
  flex: 1;
  min-width: 0;
  line-height: 1.65;
}

/* ── Section divider title ── */
.workflow-all-title {
  margin: 0 0 .9rem;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--ink-muted);
}

/* ── Workflow tip box ── */
.workflow-tip {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .75rem 1rem;
  border-radius: var(--radius-md);
  background: #fffbec;
  border: 1px solid #f0c96c;
  color: #6b4c00;
  font-size: .84rem;
  line-height: 1.6;
}

.workflow-tip svg { color: #B8904A; margin-top: .1rem; }
.workflow-tip strong { font-weight: 700; color: #4a3000; }

/* ══════════════════════════════════════════════
   ROLE CARDS – Fall-Inhaber & Fall-Teammitglied
   ══════════════════════════════════════════════ */
.role-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.2rem;
}
@media (max-width: 860px) {
  .role-cards { grid-template-columns: 1fr; }
}

.role-card {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 220ms ease;
}
.role-card:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,.06);
}

.role-card-header {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: 1.2rem 1.4rem;
}
.role-card-header--owner {
  background: linear-gradient(135deg, rgba(26,43,60,.06), rgba(26,43,60,.02));
  border-bottom: 1px solid rgba(26,43,60,.08);
}
.role-card-header--team {
  background: linear-gradient(135deg, rgba(197,160,89,.08), rgba(197,160,89,.02));
  border-bottom: 1px solid rgba(197,160,89,.15);
}

.role-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.role-card-header--owner .role-card-icon {
  background: var(--navy);
  color: #fff;
}
.role-card-header--team .role-card-icon {
  background: var(--gold);
  color: var(--navy);
}
.role-card-icon svg { width: 20px; height: 20px; }

.role-card-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  line-height: 1.3;
}
.role-card-sub {
  font-size: .78rem;
  color: var(--ink-soft);
  margin: .15rem 0 0;
  line-height: 1.4;
}

.role-steps {
  list-style: none;
  margin: 0;
  padding: .8rem 1.4rem 1.2rem;
}
.role-steps li {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .65rem 0;
  border-bottom: 1px solid var(--border-soft);
}
.role-steps li:last-child { border-bottom: none; }

.role-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: .1rem;
}
.role-card-header--owner ~ .role-steps .role-step-num {
  background: rgba(26,43,60,.08);
  color: var(--navy);
}
.role-card-header--team ~ .role-steps .role-step-num {
  background: rgba(197,160,89,.12);
  color: var(--gold-2);
}

.role-steps li strong {
  display: block;
  font-size: .85rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: .15rem;
}
.role-steps li p {
  font-size: .82rem;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0;
}

/* ── Workflow layout on wider screens: 2-column for steps ── */
@media (min-width: 860px) {
  .workflow-steps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 2rem;
  }

  /* Remove bottom borders in 2-column grid */
  .workflow-step { border-bottom: none; padding: .7rem 0; }
  .workflow-step:not(:last-child)::after { display: none; }

  /* Add subtle row separator between rows 1–2 and rows 3–4 */
  .workflow-step:nth-child(1),
  .workflow-step:nth-child(2) {
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 1rem;
  }

  .workflow-step:nth-child(3),
  .workflow-step:nth-child(4) {
    padding-top: 1rem;
  }
}

/* ================================================================
   GLOBAL FONT OVERRIDE – Inter everywhere, no exceptions
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');
*, *::before, *::after {
  font-family: "Inter", system-ui, -apple-system, sans-serif !important;
  box-sizing: border-box;
}

/* Dashboard-Form grössere Felder */
.dashboard-form input,
.dashboard-form select {
  font-size: 1rem;
  padding: 0.82rem 1rem;
}

/* Optisch abgesetzte Sektion für Fallauswahl */
.open-case.open-case-highlight {
  background: var(--accent-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(26,43,60,0.06);
  padding: 2.2rem 2.25rem 1.6rem 2.25rem;
  margin-top: 2.2rem;
  border: 1.5px solid var(--border-soft);
}

.open-case-select-label {
  width: 100%;
}

.open-case-select {
  background: #fff;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-md);
  font-size: 1.08rem;
  padding: 1rem 1.2rem;
  box-shadow: 0 1px 4px rgba(26,43,60,0.04);
  margin-top: 0.5rem;
}

@media (max-width: 600px) {
  .dashboard-form input,
  .dashboard-form select,
  .open-case-select {
    font-size: 1rem;
    padding: 0.8rem 0.8rem;
  }
  .open-case.open-case-highlight {
    padding: 1.2rem 1rem 1rem 1rem;
  }
}
/* ============================================================
   DMSKI Dashboard � Professional Light Design System
   Light mode: reduces eye fatigue when working with white docs.
   Brand accent: teal (#1A2B3C) � retained from login page.
   ============================================================ */

/* ---- Design Tokens ---- */
:root {
  --bg:          #f0f4f7;
  --bg-subtle:   #e8edf2;
  --card:        #ffffff;
  --card-raised: #ffffff;
  --border:      #dae2e8;
  --border-soft: #eaeff3;
  --ink:         #1A2B3C;
  --ink-soft:    #4A5568;
  --ink-muted:   #8899AA;
  --accent:      #1A2B3C;
  --accent-2:    #243447;
  --accent-light:#e4f4f5;
  --error:       #c0392b;
  --error-light: #fdf0ef;
  --ok:          #C5A059;
  --ok-light:    #edf8f1;
  --surface:     rgba(26, 43, 60, 0.06);
  --radius-lg:   16px;
  --radius-md:   10px;
  --radius-sm:   7px;
  --shadow:      0 2px 12px rgba(15, 43, 54, 0.09), 0 1px 3px rgba(15, 43, 54, 0.06);
  --shadow-md:   0 4px 24px rgba(15, 43, 54, 0.12), 0 2px 6px rgba(15, 43, 54, 0.07);
  --topbar-h:    3.6rem;
}

/* ---- Auth Gate ---- */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg, #f0f4f7);
  font-family: "Inter", sans-serif;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

/* ================================================================
   TOPBAR
   ================================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  isolation: isolate;
  margin-top: -2.2rem;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 2rem;
  background: transparent;
  border-bottom: 0;
  box-shadow: none;
}

.topbar::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline: calc(50% - 50vw);
  background: rgba(255, 255, 255, 0.46);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 0;
  box-shadow: none;
  pointer-events: none;
  z-index: -1;
}

.topbar > * {
  position: relative;
  z-index: 1;
}

.topbar .actions-cell {
  align-items: flex-end;
  padding-top: 0.35rem;
}

#goToUploadBtn {
  min-width: 12.8rem;
  padding-inline: 1.65rem;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-home-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.header-logo {
  height: 2.1rem;
  width: auto;
  object-fit: contain;
}

/* ================================================================
   PAGE CONTAINER
   ================================================================ */
.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 2.2rem 2rem 5rem;
}

/* ================================================================
   CARDS
   ================================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.7rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.files-card {
  overflow-x: auto;
  min-width: 0;
  padding: 1.5rem 1.8rem 1.8rem !important;
}

.card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.card h3 {
  margin: 0 0 0.9rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-soft);
}

/* ================================================================
   FORM LAYOUT
   ================================================================ */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  max-width: 580px;
}

.full { grid-column: 1 / -1; }

label {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

.form-field-inline { gap: 0; }

input,
select {
  width: 100%;
  padding: 0.72rem 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 0.93rem;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input::placeholder { color: var(--ink-muted); }

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26, 43, 60, 0.14);
}

input[readonly] {
  background: #f7fafb;
  color: var(--ink-soft);
  cursor: default;
}

input:hover:not(:focus):not([readonly]),
select:hover:not(:focus) {
  border-color: #cdd9e1;
}

select {
  padding-right: 2.5rem;
  background-image:
    linear-gradient(45deg,  transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position:
    calc(100% - 1.1rem)  calc(50% - 0.05rem),
    calc(100% - 0.82rem) calc(50% - 0.05rem);
  background-size: 0.4rem 0.4rem;
  background-repeat: no-repeat;
  appearance: none;
  cursor: pointer;
}

option {
  background: #ffffff;
  color: var(--ink);
}

/* ================================================================
   BUTTONS
   ================================================================ */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: var(--radius-md);
  padding: 0.72rem 1.55rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  letter-spacing: 0.01em;
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
  color: #ffffff;
  white-space: nowrap;
  transition: transform 130ms ease, box-shadow 130ms ease, filter 130ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(26, 43, 60, 0.28);
  filter: saturate(1.08);
}

button:active:not(:disabled) { transform: translateY(0); }

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ghost {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--ink-soft);
  font-weight: 600;
}

.ghost:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: #cdd9e1;
  color: var(--ink);
  box-shadow: none;
  filter: none;
  transform: none;
}

/* ── Ghost on <a> links (e.g. Profil nav button) ── */
a.ghost {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: .88rem;
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  transition: background .13s, border-color .13s, color .13s;
  white-space: nowrap;
}
a.ghost:hover {
  background: var(--bg-subtle);
  border-color: #cdd9e1;
  color: var(--ink);
}

#createCaseBtn {
  width: auto;
  margin-top: 0.2rem;
}

/* ================================================================
   OPEN-CASE SECTION
   ================================================================ */
.open-case {
  margin-top: 1.6rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--border-soft);
}

.open-case-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: end;
  max-width: 560px;
}

/* ================================================================
   SERVICE ALERT
   ================================================================ */
.service-alert {
  margin: 0 0 1.2rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid #f0c96c;
  background: #fffbec;
  color: #6b4c00;
  font-size: 0.9rem;
  line-height: 1.45;
}

/* ================================================================
   MESSAGES & HINTS
   ================================================================ */
.message {
  min-height: 1.2rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}
.message.error,
.message--error   { color: var(--error); }
.message.success,
.message--success { color: var(--ok);    }

.hint {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ================================================================
   ACTIVE CASE BANNER
   ================================================================ */
.active-case-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 1.2rem;
  padding: 0.3rem 0.95rem;
  border-radius: 999px;
  border: 1.5px solid rgba(26, 43, 60, 0.3);
  background: var(--accent-light);
  color: var(--accent-2);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

/* ================================================================
   DROPZONE
   ================================================================ */
.dropzone {
  margin-top: 1.1rem;
  border: 2px dashed #cdd9e1;
  background: #f5fbfb;
  border-radius: var(--radius-lg);
  padding: 2.8rem 2rem;
  min-height: 9rem;
  text-align: center;
  cursor: pointer;
  transition: all 140ms ease;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.6;
}

.dropzone::before {
  content: "?";
  display: block;
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
  opacity: 0.45;
}

.dropzone:hover,
.dropzone:focus {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-2);
}

.dropzone.drag {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: inset 0 0 0 1px rgba(26, 43, 60, 0.2);
  color: var(--accent-2);
}

.dropzone.paste-flash {
  border-color: var(--ok);
  background: var(--ok-light);
  box-shadow: 0 0 0 3px rgba(29, 122, 62, 0.14);
}

.queue-item.done .queue-analysis,
.analysis-box .queue-analysis {
  margin-top: 0.55rem;
  padding: 0.55rem 0.7rem;
  background: linear-gradient(135deg, rgba(248,249,250,0.97), rgba(240,243,247,0.95));
  border: 1px solid rgba(26,43,60,0.10);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
  box-sizing: border-box;
}

.qa-tag {
  display: inline-block;
  background: var(--navy);
  color: #F8F9FA;
  font-size: 0.73rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.12rem 0.6rem;
  letter-spacing: 0.03em;
  margin-bottom: 0.15rem;
  align-self: flex-start;
}

.qa-card-title {
  font-family: "IBM Plex Serif", serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #1A2B3C;
  margin-bottom: 0.1rem;
}

.qa-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.qa-subtitle {
  font-size: 0.76rem;
  color: #5a6b78;
  line-height: 1.35;
}

.qa-chip-row {
  display: flex;
  align-items: flex-end;
  gap: 0.38rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.qa-doctype-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}

.qa-doctype-label {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(26,43,60,0.4);
}

.qa-report-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.24rem 0.62rem;
  border: 1px solid #d3e2e8;
  background: rgba(255, 255, 255, 0.86);
  color: #1A2B3C;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.qa-report-chip.is-positive {
  border-color: #f3ecdb;
  background: #edf8f1;
  color: #C5A059;
}

.qa-report-chip.is-negative {
  border-color: #efceca;
  background: #fff2f0;
  color: #b84434;
}

.qa-report-chip.is-neutral {
  border-color: #cdd9e1;
  background: #f7fbfc;
  color: #5a6b78;
}

.qa-field {
  display: grid;
  grid-template-columns: minmax(5rem, auto) minmax(0, 1fr);
  column-gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--ink);
  line-height: 1.4;
  align-items: start;
}

.qa-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.22rem;
}

.qa-wide {
  margin-top: 0.12rem;
}

.qa-label {
  font-weight: 700;
  color: var(--ink-soft);
  min-width: 5rem;
  flex-shrink: 0;
}

.qa-field-value {
  min-width: 0;
}

.qa-mentions {
  border-top: 1px dashed #cdd9e1;
  padding-top: 0.55rem;
}

.qa-evidence-shell {
  display: grid;
  gap: 0.65rem;
  border-top: 1px dashed #cdd9e1;
  padding-top: 0.7rem;
}

.qa-evidence-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.qa-evidence-title {
  font-family: "IBM Plex Serif", serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1A2B3C;
}

.qa-evidence-subtitle {
  font-size: 0.76rem;
  color: #5a6b78;
}

.qa-evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.qa-evidence-column {
  display: grid;
  gap: 0.52rem;
  padding: 0.72rem;
  border: 1px solid #d8e6eb;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
}

.qa-evidence-person {
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5a6b78;
}

.qa-evidence-block {
  display: grid;
  gap: 0.34rem;
  padding: 0.58rem 0.62rem;
  border-radius: 12px;
  border: 1px solid #dbe7eb;
  background: #fbfdfe;
}

.qa-evidence-block.is-positive {
  border-color: #f3ecdb;
  background: linear-gradient(135deg, #fbfefc, #f1f9f3);
}

.qa-evidence-block.is-negative {
  border-color: #efd8d4;
  background: linear-gradient(135deg, #fffaf9, #fdf2f0);
}

.qa-evidence-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5a6b78;
}

.qa-evidence-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.32rem;
}

.qa-evidence-list li {
  position: relative;
  padding-left: 0.95rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #1A2B3C;
}

.qa-evidence-list li::before {
  content: "";
  position: absolute;
  top: 0.48rem;
  left: 0;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: #cdd9e1;
}

.qa-evidence-block.is-positive .qa-evidence-list li::before {
  background: #B8904A;
}

.qa-evidence-block.is-negative .qa-evidence-list li::before {
  background: #d25b4a;
}

.qa-evidence-empty {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #5a6b78;
  font-style: italic;
}

.qa-focus-strip {
  display: grid;
  gap: 0.58rem;
  border-top: 1px dashed #cdd9e1;
  padding-top: 0.72rem;
}

.qa-focus-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.qa-focus-title {
  font-family: "IBM Plex Serif", serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: #1A2B3C;
}

.qa-focus-subtitle {
  font-size: 0.76rem;
  color: #5a6b78;
}

.qa-focus-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.52rem;
}

.qa-focus-item {
  display: grid;
  gap: 0.16rem;
  padding: 0.6rem 0.66rem;
  border-radius: 12px;
  border: 1px solid #d6e5ea;
  background: rgba(255, 255, 255, 0.8);
}

.qa-focus-item.is-negative {
  border-color: #efd7d3;
  background: linear-gradient(135deg, #fff9f8, #fdf1ef);
}

.qa-focus-item strong {
  font-size: 0.82rem;
  color: #1A2B3C;
}

.qa-focus-item span {
  font-size: 0.76rem;
  line-height: 1.4;
  color: #5a6b78;
}

.qa-focus-item em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7d4040;
}

.qa-persons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
}

.qa-person-col {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.qa-person-col-label {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.qa-person-role {
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.qa-person-keywords {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: normal;
  text-transform: none;
  line-height: 1.35;
}

.qa-badges {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.qa-badge-rows {
  display: grid;
  gap: 0.32rem;
}

.qa-badge-row {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  flex-wrap: wrap;
}

.qa-badge-row-label {
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 3.4rem;
  letter-spacing: 0.01em;
}

.qa-badge-row-label.is-positive {
  color: #C5A059;
}

.qa-badge-row-label.is-negative {
  color: #c0392b;
}

.qa-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1.5px solid transparent;
  white-space: nowrap;
}

.qa-badge svg {
  width: 0.82rem;
  height: 0.82rem;
  flex-shrink: 0;
  stroke-width: 2.4;
}

.qa-badge.is-positive {
  background: #edf8f1;
  color: #C5A059;
  border-color: #f3ecdb;
}

.qa-badge.is-negative {
  background: #fdf0ef;
  color: #c0392b;
  border-color: #f5c6c1;
}

/* Legacy dot classes kept for files.js compatibility */
.qa-dot-track {
  display: inline-flex;
  align-items: center;
  gap: 0.16rem;
  flex-wrap: wrap;
  row-gap: 0.22rem;
  max-inline-size: 22rem;
}

.qa-dot-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
}

.qa-dot-count {
  font-size: 0.76rem;
  font-weight: 700;
  color: #1A2B3C;
}

.qa-dot {
  width: 1.15rem;
  height: 0.2rem;
  border-radius: 999px;
  display: inline-block;
  border: 1px solid transparent;
}

.qa-dot.is-positive {
  background: #B8904A;
  border-color: #B8904A;
}

.qa-dot.is-negative {
  background: #C0392B;
  border-color: #a93226;
}

.qa-dot-empty {
  font-size: 0.75rem;
  color: var(--ink-muted);
  font-weight: 600;
}

.qa-dot-overflow,
.qa-dot-total {
  font-size: 0.72rem;
  color: #5a6b78;
  font-weight: 700;
}

/* AI Thinking waveform animation */
.queue-ai-thinking {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.7rem;
  margin-top: 0.55rem;
  background: linear-gradient(135deg, rgba(248,249,250,0.97), rgba(240,243,247,0.95));
  border: 1px solid rgba(26,43,60,0.10);
  border-radius: 8px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
}

.ai-wave {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 1.1rem;
  flex-shrink: 0;
}

.ai-wave span {
  display: block;
  width: 3px;
  min-height: 3px;
  background: var(--accent);
  border-radius: 2px;
  animation: aiPulse 1.2s ease-in-out infinite;
}

.ai-wave span:nth-child(1) { animation-delay: 0s; }
.ai-wave span:nth-child(2) { animation-delay: 0.12s; }
.ai-wave span:nth-child(3) { animation-delay: 0.24s; }
.ai-wave span:nth-child(4) { animation-delay: 0.36s; }
.ai-wave span:nth-child(5) { animation-delay: 0.48s; }
.ai-wave span:nth-child(6) { animation-delay: 0.36s; }
.ai-wave span:nth-child(7) { animation-delay: 0.24s; }

.queue-item.done .queue-analysis {
  margin-top: 0.55rem;
  padding: 0.55rem 0.7rem;
  background: linear-gradient(135deg, rgba(248,249,250,0.97), rgba(240,243,247,0.95));
  border: 1px solid rgba(26,43,60,0.10);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.qa-tag {
  display: inline-block;
  background: var(--navy);
  color: #F8F9FA;
  font-size: 0.73rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.12rem 0.6rem;
  letter-spacing: 0.03em;
  margin-bottom: 0.15rem;
  align-self: flex-start;
}

.qa-field {
  display: flex;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--ink);
  line-height: 1.4;
  flex-wrap: wrap;
}

.qa-label {
  font-weight: 700;
  color: var(--ink-soft);
  min-width: 5rem;
  flex-shrink: 0;
}

/* ================================================================
   UPLOAD QUEUE
   ================================================================ */
.upload-queue {
  margin-top: 1rem;
  display: grid;
  gap: 0.5rem;
}

.queue-item {
  border: 1px solid var(--border);
  background: #f7fbfc;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
}

.queue-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.queue-name {
  font-size: 0.88rem;
  word-break: break-word;
  color: var(--ink);
}

.queue-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.queue-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border-radius: 999px;
  border: 1.5px solid #f5c6c1;
  background: #fff5f4;
  color: var(--error);
  cursor: pointer;
  transition: background 130ms ease;
}

.queue-delete:hover:not(:disabled) {
  background: #fde8e6;
  transform: none;
  box-shadow: none;
  filter: none;
}

.queue-delete-icon {
  width: 0.76rem;
  height: 0.76rem;
  fill: currentColor;
}

.spinner {
  width: 0.85rem;
  height: 0.85rem;
  border: 2px solid #cdd9e1;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
  display: none;
}

.queue-item.uploading .spinner { display: inline-block; }

.progress {
  height: 0.3rem;
  border-radius: 999px;
  background: #dde9eb;
  overflow: hidden;
  margin-top: 0.5rem;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 120ms linear;
}

.queue-item.done  .queue-meta { color: var(--ok);   }
.queue-item.error .queue-meta { color: var(--error); }

/* ================================================================
   UPLOAD BIG BUTTON
   ================================================================ */
.btn-upload-big {
  width: auto;
  padding: 0.8rem 2.2rem;
  font-size: 0.96rem;
  margin-bottom: 1.2rem;
}

/* ================================================================
   TABS
   ================================================================ */
.tabs {
  display: inline-flex;
  gap: 0.2rem;
  margin-bottom: 1.2rem;
  padding: 0.25rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.tabs.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  padding: 0.4rem 1.1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 130ms ease, color 130ms ease;
}

.tab:hover:not(:disabled) {
  background: rgba(26, 43, 60, 0.08);
  color: var(--accent-2);
  transform: none;
  box-shadow: none;
  filter: none;
}

.tab.active {
  background: var(--card);
  color: var(--accent-2);
  box-shadow: 0 1px 4px rgba(15, 43, 54, 0.10);
  transform: none;
}

.panel.hidden { display: none; }

/* ================================================================
   FILTER ROW
   ================================================================ */
.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 1.4rem;
  align-items: flex-end;
}

.filter-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-row label {
  gap: 0.32rem;
  font-size: 0.84rem;
}

.filter-btn {
  border: 0;
  border-radius: var(--radius-md);
  padding: 0.72rem 1.4rem;
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 130ms ease, box-shadow 130ms ease;
  justify-self: start;
  min-width: 10.5rem;
}

#exportPdfReportBtn,
#toggleMultiDeleteBtn,
.filter-actions #goToUploadBtn {
  min-width: 11.5rem;
}

#exportPdfReportBtn {
  background: linear-gradient(135deg, #C5A059, #B8904A);
  color: #1A2B3C;
  border-color: transparent;
}

#exportPdfReportBtn svg,
#exportPdfReportBtn:hover:not(:disabled) svg { color: #1A2B3C; }

#exportPdfReportBtn:hover:not(:disabled) {
  background: linear-gradient(135deg, #d4af6a, #C5A059);
  color: #1A2B3C;
  filter: none;
  box-shadow: 0 5px 14px rgba(197, 160, 89, 0.4);
}

.filter-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(26, 43, 60, 0.26);
}

.filter-btn.active {
  background: var(--error-light);
  border: 1.5px solid #f5c6c1;
  color: var(--error);
}

/* ================================================================
   LIST HEADER ROW
   ================================================================ */
.list-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0;
  padding: 0;
}

.list-header-main {
  flex: 1;
  min-width: 0;
}

.list-header-row h2 { margin: 0; }

#deleteCaseBtn {
  margin-top: 0.08rem;
  flex-shrink: 0;
}

.upload-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

/* ── Fall-Cover Header ── */
.case-cover {
  margin: 0 0 1.5rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(26,43,60,0.06);
  box-shadow: 0 1px 3px rgba(26,43,60,0.06), 0 10px 28px rgba(26,43,60,0.05);
  overflow: hidden;
}
.case-cover-band {
  background: linear-gradient(135deg, #1A2B3C, #243447);
  padding: 1.3rem 1.5rem 1.15rem;
  border-bottom: 2px solid rgba(197,160,89,0.5);
}
.case-cover-headrow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.case-cover-name {
  margin: 0;
  font-family: "Poppins", sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
}
.case-cover-id {
  font-family: "Inter", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #C5A059;
  background: rgba(197,160,89,0.12);
  border: 1px solid rgba(197,160,89,0.32);
  padding: 0.2rem 0.62rem;
  border-radius: 999px;
  white-space: nowrap;
}
.case-cover-delete {
  flex-shrink: 0;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 9px;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.case-cover-delete:hover { background: rgba(192,57,43,0.95); border-color: rgba(192,57,43,0.95); color: #fff; }
.case-cover-delete svg { width: 1.15rem; height: 1.15rem; stroke: currentColor; }
.case-cover-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}
.case-cover-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.3rem 0.72rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
}
.case-cover-chip .cc-k {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}
.case-cover-chip .cc-v {
  font-size: 0.74rem;
  font-weight: 700;
  color: #E8D9B5;
}
.case-cover .case-person-field { border-left: 3px solid transparent; }
.case-cover .case-person-field.is-protected { border-left-color: #C5A059; }
.case-cover .case-person-field.is-opposing { border-left-color: rgba(192,57,43,0.55); }
.case-cover .case-persons-row {
  margin: 0;
  padding: 1.1rem 1.5rem 1.35rem;
  border-bottom: none;
}

.case-persons-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(14rem, 1fr));
  gap: 0.6rem;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(26,43,60,0.08);
}

.analysis-report {
  position: relative;
  overflow: hidden;
  margin-top: 0.5rem;
  padding: 1.2rem 0 1.3rem;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.analysis-report::before {
  display: none;
}

.analysis-report-head-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

/* PDF KI-Report button inside the report header (not in filter-section)
   Uses !important to beat the #exportPdfReportBtn ID rule (dark gradient) */
.analysis-report-head-actions .filter-btn--report,
.analysis-report-head-actions #exportPdfReportBtn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  padding: 0.6rem 1.2rem !important;
  border: none !important;
  border-radius: var(--radius-md) !important;
  background: linear-gradient(150deg, var(--navy), #243447) !important;
  color: #F8F9FA !important;
  font: inherit !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  letter-spacing: 0.02em !important;
  transition: transform 120ms ease, box-shadow 120ms ease !important;
  min-width: 0 !important;
  box-shadow: 0 2px 8px rgba(26,43,60,0.2) !important;
  transform: none !important;
}

.analysis-report-head-actions .filter-btn--report svg,
.analysis-report-head-actions #exportPdfReportBtn svg {
  width: 0.85rem;
  height: 0.85rem;
  flex-shrink: 0;
  stroke-width: 2.2;
  stroke: var(--gold);
}

.analysis-report-head-actions .filter-btn--report:hover:not(:disabled),
.analysis-report-head-actions #exportPdfReportBtn:hover:not(:disabled) {
  background: linear-gradient(150deg, #243447, var(--navy)) !important;
  color: #F8F9FA !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 16px rgba(26,43,60,0.3) !important;
  filter: none !important;
}

.analysis-report-head-actions .filter-btn--report:disabled,
.analysis-report-head-actions #exportPdfReportBtn:disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
}
.analysis-report-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(26,43,60,0.08);
}

.analysis-report-eyebrow {
  margin: 0 0 0.16rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-2);
}

.analysis-report-title {
  margin: 0;
  font-family: "IBM Plex Serif", serif;
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--navy);
}

.analysis-report-hint {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: rgba(26,43,60,0.55);
  text-align: right;
}

.analysis-report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.analysis-report-meta {
  display: none;
}

.analysis-report-meta-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem 1.05rem;
  border-radius: 16px;
  border: 1.5px solid #cdd9e1;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(15,43,54,0.06);
  transition: box-shadow 140ms ease, transform 140ms ease;
}

.analysis-report-meta-card:hover {
  box-shadow: 0 4px 16px rgba(15,43,54,0.1);
  transform: translateY(-1px);
}

.analysis-report-meta-card.is-positive {
  border-color: #f3ecdb;
  background: linear-gradient(135deg, #f4fdf7, #e8f8ee);
}

.analysis-report-meta-card.is-negative {
  border-color: #eac8c3;
  background: linear-gradient(135deg, #fff8f7, #fdecea);
}

/* label removed – no .analysis-report-meta-label styles needed */

.analysis-report-meta-value {
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.2;
  color: #1A2B3C;
  letter-spacing: -0.01em;
}

.analysis-report-meta-card.is-positive .analysis-report-meta-value { color: #B8904A; }
.analysis-report-meta-card.is-negative .analysis-report-meta-value { color: #a83228; }

.analysis-report-meta-text {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #5a6b78;
}

.analysis-report-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(26,43,60,0.1);
  background: #fff;
}

.analysis-report-card-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(26,43,60,0.55);
}

.analysis-report-card-value {
  font-size: 1.15rem;
  line-height: 1.15;
  font-weight: 800;
  color: var(--navy);
}

.analysis-report-card-detail {
  font-size: 0.75rem;
  line-height: 1.4;
  color: rgba(26,43,60,0.6);
}

.analysis-report-card.is-positive {
  border-color: rgba(26,43,60,0.1);
  background: #fff;
}

.analysis-report-card.is-positive .analysis-report-card-value {
  color: var(--navy);
}

.analysis-report-card.is-negative {
  border-color: rgba(26,43,60,0.1);
  background: #fff;
}

.analysis-report-card.is-negative .analysis-report-card-value {
  color: var(--navy);
}

.case-person-field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.55rem 0.75rem;
  background: #f5f6f8;
}

.case-person-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: rgba(26,43,60,0.5);
}

.case-person-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--navy);
}

.case-person-field.is-protected {
  background: #f5f6f8;
}

.case-person-field.is-opposing {
  background: #f5f6f8;
}

.case-person-field.is-meta {
  background: #f5f6f8;
}

.case-person-field.is-case {
  background: #f5f6f8;
}

.case-person-chip {
  display: inline-block;
  border-radius: 999px;
  padding: 0.18rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--ink-soft);
}

.case-person-chip.is-protected {
  border-color: rgba(22,101,52,0.3);
  background: #f0faf3;
  color: var(--emerald);
}

.case-person-chip.is-opposing {
  border-color: #c0392b;
  background: var(--error-light);
  color: var(--error);
}

/* ================================================================
   ICON BUTTONS
   ================================================================ */
.icon-btn {
  width: 2.1rem;
  height: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #ffffff;
  color: var(--ink-soft);
  padding: 0;
  cursor: pointer;
  transition: background 130ms ease, border-color 130ms ease, color 130ms ease;
}

.icon-btn svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.icon-btn:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: #cdd9e1;
  color: var(--ink);
  transform: none;
  box-shadow: none;
  filter: none;
}

.icon-btn.danger {
  border-color: #f5c6c1;
  color: var(--error);
  background: #fff8f7;
}

.icon-btn.danger:hover:not(:disabled) {
  background: #fdecea;
  border-color: #f0a09a;
  transform: none;
  box-shadow: none;
  filter: none;
}

/* ================================================================
   UNDO BAR
   ================================================================ */
.undo-bar {
  margin-top: 0.7rem;
  padding: 0.65rem 0.95rem;
  border: 1px solid #cdd9e1;
  border-radius: var(--radius-md);
  background: #edf8fa;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  font-size: 0.88rem;
}

.undo-bar.hidden { display: none; }

.undo-btn {
  border: 1.5px solid #cdd9e1;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--accent-2);
  padding: 0.3rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 130ms ease;
}

.undo-btn:hover {
  background: var(--accent-light);
  transform: none;
  box-shadow: none;
  filter: none;
}

/* ================================================================
   MULTI-DELETE BAR
   ================================================================ */
.multi-delete-bar {
  margin-top: 0.7rem;
  padding: 0.65rem 0.95rem;
  border: 1px solid #f5c6c1;
  border-radius: var(--radius-md);
  background: var(--error-light);
  color: #6b1c15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  font-size: 0.88rem;
}

.multi-delete-bar.hidden { display: none; }

.delete-btn {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0.36rem 0.9rem;
  background: linear-gradient(150deg, #c0392b, #962d22);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 130ms ease;
}

.delete-btn:hover:not(:disabled) {
  opacity: 0.86;
  transform: none;
  box-shadow: none;
  filter: none;
}

.delete-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.toggle-btn.active {
  background: var(--error-light);
  border: 1.5px solid #f5c6c1;
  color: var(--error);
}

/* ================================================================
   TABLE
   ================================================================ */
.files-card table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.6rem;
  table-layout: fixed;
}

.files-card th:nth-child(2),
.files-card td.preview-cell {
  width: 60%;
}

.files-card th:nth-child(3),
.files-card td.analysis-cell {
  width: 40%;
}

/* WICHTIG: Der echte Tabellen-Container heisst .files-panel (NICHT .files-card) —
   nur diese Regeln greifen. table-layout:fixed verhindert, dass der PDF-iframe die
   Vorschau-Spalte aufbläht; colgroup setzt 60/40 autoritativ durch. */
.files-panel table { table-layout: fixed; width: 100%; }
.files-panel col.col-checkbox { width: 0; }
/* Multi-Lösch-Modus: Checkbox-Spalte sichtbar machen. Unter table-layout:fixed
   ist die <col>-Breite massgeblich — die Zelle allein reicht NICHT. */
.files-panel table.multi-delete-active col.col-checkbox { width: 2.5rem; }
.files-panel col.col-preview  { width: 60%; }
.files-panel col.col-analysis { width: 40%; }
.files-card col.col-preview  { width: 60%; }
.files-card col.col-analysis { width: 40%; }
/* Checkbox-Spalte NICHT per display:none entfernen (würde unter table-layout:fixed die
   Spalten-Zuordnung verschieben) — stattdessen 0-breit kollabieren, Zelle bleibt erhalten. */
.files-panel .checkbox-col.hidden {
  display: table-cell;
  width: 0;
  min-width: 0;
  padding: 0;
  border: none;
  overflow: hidden;
}
.files-panel .checkbox-col.hidden > * { display: none; }

.files-card > .files-panel > table > thead > tr > th {
  padding: 12px 15px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #FFFFFF;
  border-bottom: none;
  text-align: left;
  background: #1A2B3C;
}

.files-card > .files-panel > table > thead > tr > th:first-child {
  border-top-left-radius: 8px;
}

.files-card > .files-panel > table > thead > tr > th:last-child {
  border-top-right-radius: 8px;
}

/* Fallback for other tables that use bare th */
th {
  padding: 12px 15px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border-bottom: 1.5px solid var(--border);
  text-align: left;
  background: var(--bg);
}

td {
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  padding: 12px 15px;
  font-size: 0.92rem;
  color: var(--ink);
  overflow: hidden;
}

.doc-id {
  font-size: 0.9rem;
  color: var(--ink-soft);
  font-weight: 600;
}

/* ================================================================
   CHECKBOXES
   ================================================================ */
.checkbox-col        { width: 2.5rem; text-align: center; }
.checkbox-col.hidden { display: none; }

.file-checkbox {
  width: 1.05rem;
  height: 1.05rem;
  cursor: pointer;
  accent-color: var(--accent);
}

/* ================================================================
   FILE ROWS
   ================================================================ */
.file-row td {
  transition: background-color 140ms ease;
  vertical-align: top;
  padding: 14px 15px;
  border-bottom: 1px solid rgba(26,43,60,0.08);
}

.file-row:hover td {
  background: #f0f2f5;
}

.file-row:last-child td {
  border-bottom: none;
}

.file-row.multi-delete-row:hover td {
  background: #fafcfd;
}

.file-row.is-selected td {
  background: rgba(197,160,89,0.06);
}

.file-row.is-selected .preview-doc-id {
  color: var(--gold-2);
}

/* ── Modern row action buttons (icon-only) ── */
.row-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid rgba(26,43,60,0.12);
  border-radius: var(--radius-md);
  background: #fff;
  color: rgba(26,43,60,0.45);
  cursor: pointer;
  transition: all 120ms ease;
}
.row-action-btn svg {
  width: 0.9rem;
  height: 0.9rem;
}
.row-action-btn:hover {
  background: #f5f6f8;
  color: var(--navy);
  border-color: rgba(26,43,60,0.2);
}
.row-action-btn.delete:hover {
  color: #c0392b;
  border-color: rgba(192,57,43,0.25);
  background: rgba(192,57,43,0.04);
}
.row-action-btn.refresh {
  border: none;
  background: transparent;
}
.row-action-btn.refresh:hover {
  background: rgba(26,43,60,0.06);
  color: var(--navy);
}

/* ================================================================
   FILE TYPE BADGES
   ================================================================ */
.file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.file-icon.pdf     { background: #fde8e6; color: #962d22; }
.file-icon.png     { background: #eef1f4; color: #5a6b78; }
.file-icon.jpg     { background: rgba(197,160,89,0.08); color: #C5A059; }
.file-icon.generic { background: #edf2f4; color: var(--ink-soft); }

/* ================================================================
   ROW ACTIONS
   ================================================================ */
.actions-cell,
.row-actions {
  display: inline-flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

/* Legacy btn-inline kept for backwards compat */
.btn-inline {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.28rem 0.6rem;
  font-size: 0.79rem;
  font-weight: 600;
  background: #ffffff;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 130ms ease, color 130ms ease, border-color 130ms ease;
}

.btn-inline:hover:not(:disabled) {
  background: var(--bg-subtle);
  color: var(--ink);
  transform: none;
  box-shadow: none;
  filter: none;
}

.btn-inline.download {
  border-color: #cdd9e1;
  color: var(--accent-2);
}

.btn-inline.download:hover:not(:disabled) {
  background: var(--accent-light);
  border-color: var(--accent);
}

.btn-inline.delete {
  border-color: #f5c6c1;
  color: var(--error);
}

.btn-inline.delete:hover:not(:disabled) {
  background: var(--error-light);
}

.btn-inline.icon-only {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}

.btn-inline.icon-only svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.btn-inline.icon-only.is-loading {
  position: relative;
  color: transparent;
}

.btn-inline.icon-only.is-loading::after {
  content: "";
  position: absolute;
  width: 0.8rem;
  height: 0.8rem;
  border: 2px solid #cdd9e1;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

/* ================================================================
   PREVIEW CELL
   ================================================================ */
.preview-cell {
  width: 100%;
  cursor: zoom-in;
}

.preview-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.3rem;
}

.preview-doc-id {
  display: inline-block;
  margin: 0 0 0.4rem;
  font-family: "Inter", sans-serif;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #B8904A;
  background: rgba(197,160,89,0.12);
  padding: 0.14rem 0.5rem;
  border-radius: 6px;
}

.preview-timestamp {
  margin: 0.25rem 0 0.4rem;
  font-size: 0.77rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.row-preview-box {
  width: 100%;
  max-width: 100%;
}

.row-preview-loading,
.row-preview-empty {
  width: 100%;
  max-width: 31.5rem;
  aspect-ratio: 1 / 1.414;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f7fbfc;
  color: var(--ink-muted);
  display: grid;
  place-items: center;
  font-size: 0.83rem;
  text-align: center;
  font-weight: 500;
}

/* ── Zoom button overlay on preview ── */
.row-preview-box-wrap {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 0.6rem;
}

/* Magnify-glass button – bottom-right corner of the preview */
.preview-zoom-btn {
  position: absolute;
  bottom: 0.45rem;
  right: 0.45rem;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,0.72);
  background: rgba(15, 43, 54, 0.58);
  color: #fff;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 130ms ease, transform 120ms ease, box-shadow 120ms ease;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.22);
  transform: none;
  filter: none;
}

.preview-zoom-btn:hover:not(:disabled) {
  background: rgba(26, 43, 60, 0.82);
  border-color: rgba(255,255,255,0.9);
  transform: scale(1.08);
  box-shadow: 0 3px 10px rgba(0,0,0,0.32);
  filter: none;
}

.preview-zoom-btn svg {
  width: 1rem;
  height: 1rem;
  stroke: #fff;
  fill: none;
}

.row-preview-frame {
  /* Füllt die volle Spaltenbreite (60%), A4-Proportion = volle Seite, nicht geschnitten */
  width: 100%;
  max-width: 100%;
  aspect-ratio: 210 / 297;
  display: block;
  border: 1px solid rgba(26,43,60,0.08);
  border-radius: var(--radius-md);
  background: #ffffff;
}

.row-preview-image {
  width: 100%;
  max-width: 100%;
  max-height: clamp(400px, 65vh, 900px);
  object-fit: contain;
  border: 1px solid rgba(26,43,60,0.12);
  border-radius: var(--radius-sm);
  background: #ffffff;
  pointer-events: none;   /* images don't need interaction */
  object-fit: contain;
  display: block;
}

.preview-filename {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--navy);
  word-break: break-word;
  line-height: 1.3;
}

.preview-meta-row {
  margin-top: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.preview-size {
  font-size: 0.75rem;
  color: rgba(26,43,60,0.45);
}

/* preview-doctype removed from left side — doc type shown on analysis side only */

/* ================================================================
   ANALYSIS RESULTS
   ================================================================ */
.analysis-error {
  font-size: 0.76rem;
  color: var(--error);
  font-style: italic;
  line-height: 1.35;
  padding-left: 0.55rem;
  border-left: 2px solid #f5c6c1;
}

.analysis-cell {
  width: 100%;
  min-width: 0;
  padding-left: 0.75rem;
}

.analysis-cell-top {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.analysis-box {
  min-height: 0;
  display: flex;
  width: 100%;
}

.analysis-box .qa-grid {
  gap: 0.3rem;
}

.analysis-box .qa-field {
  grid-template-columns: minmax(4.7rem, auto) minmax(0, 1fr);
}

.analysis-box .qa-mentions {
  margin-top: 0.1rem;
}

.analysis-box .qa-persons-grid {
  grid-template-columns: 1fr;
  gap: 0.7rem;
}

.analysis-box .qa-person-col {
  gap: 0.45rem;
}

/* Legacy loading state */
.analysis-loading {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #f8fbfc;
  padding: 0.9rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.analysis-loading .spinner { display: inline-block; }
.analysis-loading-text { font-size: 0.82rem; color: var(--ink-soft); line-height: 1.4; }

/* ================================================================
   AI SCANNING – Premium loading state
   ================================================================ */
/* ── Manipulationsmuster (per-file detection) ── */
.qa-mod-manipulation {
  margin-top: 0.8rem;
  padding: 0.8rem 1rem;
  background: rgba(213, 83, 83, 0.04);
  border-left: 3px solid #C0392B;
  border-radius: 0 8px 8px 0;
}

.qa-mod-manipulation-title {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #C0392B;
  margin-bottom: 0.5rem;
}

.qa-mod-manipulation-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.qa-mod-manipulation-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.76rem;
  line-height: 1.4;
}

.qa-mod-manipulation-badge {
  flex-shrink: 0;
  padding: 0.15rem 0.5rem;
  background: rgba(213, 83, 83, 0.1);
  color: #a93226;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.qa-mod-manipulation-beleg {
  color: #4A5568;
  font-style: italic;
}

/* ================================================================
   AI SCANNING – Gold Equalizer
   ================================================================ */
/* ── Gold Equalizer KI Loading ── */
.ai-scanning-gold {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  border-radius: var(--radius-lg, 12px);
  background: transparent;
}

.ai-gold-bars {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 5px;
  height: 90px;
  margin-bottom: 1.5rem;
}

.ai-gold-bars span {
  width: 6px;
  border-radius: 3px;
  background: linear-gradient(to top, #C5A059, #e8c97a);
  box-shadow: 0 0 8px rgba(197, 160, 89, 0.3);
  animation: goldEq 1.1s ease-in-out infinite;
}

.ai-gold-bars span:nth-child(1)  { animation-delay: 0s; }
.ai-gold-bars span:nth-child(2)  { animation-delay: 0.08s; }
.ai-gold-bars span:nth-child(3)  { animation-delay: 0.16s; }
.ai-gold-bars span:nth-child(4)  { animation-delay: 0.24s; }
.ai-gold-bars span:nth-child(5)  { animation-delay: 0.32s; }
.ai-gold-bars span:nth-child(6)  { animation-delay: 0.40s; }
.ai-gold-bars span:nth-child(7)  { animation-delay: 0.48s; }
.ai-gold-bars span:nth-child(8)  { animation-delay: 0.56s; }
.ai-gold-bars span:nth-child(9)  { animation-delay: 0.64s; }
.ai-gold-bars span:nth-child(10) { animation-delay: 0.72s; }
.ai-gold-bars span:nth-child(11) { animation-delay: 0.80s; }
.ai-gold-bars span:nth-child(12) { animation-delay: 0.88s; }
.ai-gold-bars span:nth-child(13) { animation-delay: 0.96s; }
.ai-gold-bars span:nth-child(14) { animation-delay: 1.04s; }
.ai-gold-bars span:nth-child(15) { animation-delay: 0.60s; }

@keyframes goldEq {
  0%, 100% { height: 6px; opacity: 0.25; }
  50% { height: 80px; opacity: 1; }
}

.ai-gold-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--navy, #1A2B3C);
}

.ai-gold-sub {
  margin: 0.3rem 0 0;
  font-size: 0.72rem;
  color: rgba(26, 43, 60, 0.4);
  letter-spacing: 0.01em;
}

.analysis-glass {
  border: 1px solid #cdd9e1;
  border-radius: 12px;
  padding: 0.85rem;
  background: linear-gradient(135deg, rgba(241, 248, 251, 0.96), rgba(236, 246, 249, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  width: 100%;
  max-width: none;
  margin-left: 0;
  min-height: clamp(24rem, 38vw, 32rem);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
}


.analysis-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  position: relative;
  z-index: 1;
}

.analysis-section {
  border: 1px solid #deeaef;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  padding: 0.6rem 0.65rem;
  margin-top: 0.55rem;
  position: relative;
  z-index: 1;
}

.analysis-section:first-child,
.analysis-grid .analysis-section {
  margin-top: 0;
}

.analysis-label {
  margin: 0 0 0.25rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5a6b78;
  font-weight: 700;
}

.analysis-label-keywords {
  display: inline;
  margin-left: 0.45rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: #1A2B3C;
  text-transform: none;
  letter-spacing: normal;
}

.analysis-value {
  margin: 0;
  color: #1A2B3C;
  font-size: 0.92rem;
  line-height: 1.35;
}

.analysis-value.muted {
  color: var(--ink-muted);
  font-style: italic;
}

.analysis-title {
  font-weight: 700;
}

.analysis-doctype {
  font-weight: 700;
  color: #1A2B3C;
}

.analysis-people {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.analysis-people li {
  border: 1px solid #cdd9e1;
  background: #f4fbfd;
  color: #1A2B3C;
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.analysis-people li.is-protected {
  border-color: #1A2B3C;
  background: #e4f4f5;
  color: #1A2B3C;
  font-weight: 700;
}

.analysis-score-box {
  border-color: #cdd9e1;
  background: linear-gradient(135deg, #eaf6f9, #e1f1f5);
}

.analysis-score {
  margin: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
}

.analysis-score-label {
  font-size: 0.84rem;
  color: #5a6b78;
  font-weight: 700;
}

.analysis-score-value {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--accent-2);
  font-weight: 800;
}

.analysis-mention-box {
  border-color: #cdd9e1;
  background: rgba(255, 255, 255, 0.78);
}

.analysis-mention-line {
  margin: 0;
  font-size: 0.92rem;
  color: #1A2B3C;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.analysis-sub-label {
  margin-top: 0.6rem;
}

.analysis-mention-values {
  font-weight: 700;
  color: #1A2B3C;
  min-width: 4.2rem;
}

.analysis-dot-track {
  display: inline-flex;
  align-items: center;
  gap: 0.16rem;
  flex-wrap: wrap;
  row-gap: 0.22rem;
  max-inline-size: 24rem;
}

.analysis-dot-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
}

.analysis-dot-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1A2B3C;
}

.analysis-dot {
  width: 1.2rem;
  height: 0.22rem;
  border-radius: 999px;
  display: inline-block;
  border: 1px solid transparent;
}

.analysis-dot.is-positive {
  background: #B8904A;
  border-color: #B8904A;
}

.analysis-dot.is-negative {
  background: #C0392B;
  border-color: #a93226;
}

.analysis-dot-empty {
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-weight: 600;
}

.analysis-dot-overflow,
.analysis-dot-total {
  font-size: 0.74rem;
  color: #5a6b78;
  font-weight: 700;
}

.analysis-hint {
  margin: 0;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  background: #f0f8fa;
  color: var(--ink-soft);
  font-size: 0.81rem;
  line-height: 1.4;
}

/* ================================================================
   PREVIEW MODAL
   ================================================================ */
.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
}

.preview-modal.hidden { display: none; }

.preview-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 28, 42, 0.55);
  backdrop-filter: blur(3px);
}

.preview-modal-dialog {
  position: relative;
  width: min(95vw, 1400px);
  height: min(93vh, 960px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: #ffffff;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(10, 28, 42, 0.28);
}

.preview-modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.preview-modal-title {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
  font-weight: 600;
}

.preview-modal-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.zoom-level {
  min-width: 3.5rem;
  text-align: center;
  font-weight: 700;
  color: var(--ink);
  font-size: 0.88rem;
}

.preview-modal-viewport {
  overflow: auto;
  background: #fafbfc;
  padding: 1.25rem;
}

.preview-modal-content { transform-origin: top left; }

.preview-modal-image {
  display: block;
  max-width: 100%;
  max-height: calc(93vh - 7rem);
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}

.preview-modal-frame {
  width: min(1200px, calc(95vw - 2.5rem));
  height: min(1600px, calc(93vh - 7rem));
  border: 0;
  background: #ffffff;
}

/* ================================================================
   FOOTER
   ================================================================ */
.dashboard-footer {
  margin-top: 3.5rem;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dashboard-footer a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.dashboard-footer a:hover { color: var(--accent-2); }

.footer-sep { opacity: 0.5; }

/* ================================================================
   ANIMATIONS
   ================================================================ */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes aiPulse {
  0%, 100% { height: 3px;  opacity: 0.35; }
  50%       { height: 17px; opacity: 1;    }
}

/* ================================================================
   PRINT STYLES  (@media print + body.printing class)
   Both rule-sets are intentionally identical so that:
   – native browser print (Ctrl+P) and
   – html2pdf capture (body.printing class added via JS)
   produce the same clean A4 output.
   ================================================================ */

/* ── Shared helpers ── */
.print-hide { display: none !important; }

/* ── @media print ── */
@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body { background: #fff !important; margin: 0 !important; }

  /* Hide all non-report UI */
  .topbar,
  .filter-section,
  .case-persons-row,
  #deleteCaseBtn,
  #listMessage,
  #undoBar,
  #multiDeleteBar,
  .preview-modal,
  .dashboard-footer,
  .files-card table,
  .list-header-row > .icon-btn,
  button { display: none !important; }

  .page  { padding: 0 !important; max-width: 100% !important; margin: 0 !important; }
  .card  { box-shadow: none !important; border: none !important; padding: 0 !important; margin: 0 !important; }
  .files-card { overflow: visible !important; }

  #analysisReportBar {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    background: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0.5rem !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }

  #analysisReportBar * {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .analysis-report-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .tactic-table-wrap  { overflow: hidden !important; }
  .tactic-table thead tr,
  .tactic-table tbody tr { grid-template-columns: 22% 28% 50% !important; }
  .tactic-table th,
  .tactic-table td {
    font-size: 0.67rem !important;
    padding: 0.28rem 0.4rem !important;
    word-break: break-word !important;
  }
  .tactic-table.akteure-tbl { font-size: 0.72rem !important; }
  .tactic-table.akteure-tbl thead tr,
  .tactic-table.akteure-tbl tbody tr { grid-template-columns: 30% 30% 40% !important; }
  .tactic-analysis-body{ font-size: 0.73rem !important; line-height: 1.45 !important; }
  .party-split-num,
  .file-count-num      { font-size: 1.35rem !important; }
}

/* ── body.printing (applied via JS before html2pdf capture) ── */
body.printing * {
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

body.printing .topbar,
body.printing .filter-section,
body.printing .case-persons-row,
body.printing #deleteCaseBtn,
body.printing #listMessage,
body.printing #undoBar,
body.printing #multiDeleteBar,
body.printing .preview-modal,
body.printing .dashboard-footer,
body.printing .files-card table,
body.printing .list-header-row > .icon-btn,
body.printing button { display: none !important; }

body.printing .page {
  padding: 0 !important;
  max-width: none !important;
  margin: 0 !important;
}

body.printing .card {
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

body.printing .files-card { overflow: visible !important; }

body.printing #analysisReportBar {
  width: 740px !important;
  max-width: 740px !important;
  overflow: hidden !important;
  background: #ffffff !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0.5rem !important;
  margin: 0 !important;
}

body.printing #analysisReportBar * {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* ── PDF-Export: gesamter KI-Report (Sektionen 1–8, ohne "Ihre Files") ── */
.pdf-report-head { display: none; }
body.printing .pdf-report-head {
  display: flex !important;
  align-items: center;
  gap: 0.9rem;
  padding: 0 0 0.85rem;
  margin: 0 0 1rem;
  border-bottom: 2px solid #C5A059;
}
body.printing .pdf-report-logo { height: 2rem !important; width: auto !important; }
body.printing .pdf-report-titles { display: flex; flex-direction: column; gap: 0.1rem; }
body.printing .pdf-report-case {
  font-family: "Poppins", sans-serif; font-weight: 700; font-size: 1.15rem; color: #1A2B3C;
}
body.printing .pdf-report-sub {
  font-size: 0.7rem; color: #64748b; letter-spacing: 0.04em;
}
body.printing #kiReportArea {
  width: 740px !important;
  max-width: 740px !important;
  margin: 0 !important;
}
body.printing #kiReportArea * {
  max-width: 100% !important;
  box-sizing: border-box !important;
}
/* teamSection ist kompakt → darf als Einheit zusammenbleiben */
body.printing #kiReportArea #teamSection {
  margin: 0 0 0.8rem !important;
  break-inside: avoid;
  page-break-inside: avoid;
}
/* WICHTIG: forensic-section ist oft höher als eine A4-Seite. Mit break-inside:avoid
   würde html2pdf sie am Stück platzieren und dann blind in Seitenhöhe zerschneiden —
   genau das schnitt die Karten mitten im Text ab. Daher: Sektion DARF umbrechen,
   nur ihre Kinder-Atome (.forensic-pattern usw.) bleiben unzerschnitten. */
body.printing #kiReportArea .forensic-section {
  margin: 0 0 0.8rem !important;
  break-inside: auto !important;
  page-break-inside: auto !important;
}

body.printing .analysis-report-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

/* overflow muss sichtbar sein, sonst wird die auf die Folgeseite laufende
   Tabelle vertikal abgeschnitten */
body.printing .tactic-table-wrap { overflow: visible !important; }

/* Nur kompakte Einheiten zusammenhalten — NICHT die (oft seitenhohe) .tactic-section
   und NICHT die Tabellen-Wraps (grosse Tabellen duerfen umbrechen) */
body.printing .tactic-counsel-item,
body.printing .tactic-analysis-box,
body.printing .tactic-legal-text,
body.printing .analysis-report-card {
  break-inside: avoid !important;
  page-break-inside: avoid !important;
}

/* Grosse Tabellen (Personen/Akteure, Taktik): Wrap + Tabelle DUERFEN umbrechen,
   aber sauber — eine einzelne Zeile wird nie mitten durchgeschnitten, und der
   Kopf bleibt bei der ersten Zeile. */
body.printing .tactic-table-wrap,
body.printing .akteure-table-container,
body.printing .tactic-table,
body.printing .tactic-table tbody {
  break-inside: auto !important;
  page-break-inside: auto !important;
}
body.printing .tactic-table tr,
body.printing .tactic-table thead,
body.printing .tactic-table thead tr {
  break-inside: avoid !important;
  page-break-inside: avoid !important;
}
body.printing .tactic-table thead,
body.printing .tactic-table thead tr {
  break-after: avoid !important;
  page-break-after: avoid !important;
}

/* tactic-section darf umbrechen (Container > Seitenhöhe), Kinder bleiben Atome */
body.printing .tactic-section {
  break-inside: auto !important;
  page-break-inside: auto !important;
  break-before: auto;
  page-break-before: auto;
}

/* Saubere Seitenumbrüche: Master-Scan- + Anwalts-Match-Einheiten nie zerschneiden.
   Nur kompakte Atome (passen sicher auf eine Seite) — KEINE seitenhohen Container. */
body.printing .forensic-contradiction,
body.printing .forensic-pattern,
body.printing .forensic-offen,
body.printing .forensic-finding,
body.printing .forensic-fazit,
body.printing .forensic-gesamtfall-para,
body.printing .lmf-donut-wrap,
body.printing .lm-empfehlung,
body.printing .lm-profile,
body.printing .law-match-feature .lm-legend li {
  break-inside: avoid !important;
  page-break-inside: avoid !important;
}
/* Donut/Pie-Chart: im Print-Modus auf sinnvolle Breite begrenzen.
   min(500px, 96vw) wäre bei 740px Render-Breite = 710px → nur Sektor sichtbar.
   SVG braucht overflow:visible damit Leader-Lines ausserhalb des viewBox sichtbar sind. */
body.printing .lm-donut--big {
  width: 360px !important;
  max-width: 360px !important;
  height: auto !important;
  overflow: visible !important;
}
body.printing .lmf-donut-wrap {
  justify-content: flex-start !important;
  overflow: visible !important;
}
/* SVG-Elemente dürfen nicht geclipt werden (Leader-Lines ausserhalb viewBox) */
body.printing .lmf-donut-wrap svg,
body.printing .lmf-donut-wrap svg * {
  overflow: visible !important;
}
/* Gesamtfall: Container darf umbrechen, Kopf bleibt beim ersten Absatz */
body.printing .forensic-gesamtfall {
  break-inside: auto !important;
  page-break-inside: auto !important;
}
/* Etwas Luft, damit auf eine neue Seite geschobene Atome nicht am Rand kleben */
body.printing .forensic-pattern,
body.printing .forensic-finding,
body.printing .forensic-contradiction,
body.printing .forensic-gesamtfall-para { margin-top: 0 !important; }
/* Überschriften nie allein am Seitenende — bleiben beim folgenden Inhalt */
body.printing .forensic-contradictions-title,
body.printing .forensic-patterns-title,
body.printing .forensic-findings-title,
body.printing .forensic-gesamtfall-header,
body.printing .forensic-gesamtfall-title,
body.printing .qa-mod-title,
body.printing .pdf-section-title {
  break-after: avoid !important;
  page-break-after: avoid !important;
  break-inside: avoid !important;
  page-break-inside: avoid !important;
}
/* Aktions-Spalte (Scan-Button/Promo) + leere Platzhalter raus aus PDF */
body.printing .forensic-header-actions,
body.printing .lmf-empty,
body.printing .lmf-loading,
body.printing .dl-loader,
body.printing .pdf-skip { display: none !important; }

body.printing .tactic-table thead tr,
body.printing .tactic-table tbody tr {
  grid-template-columns: 22% 28% 50% !important;
}

body.printing .tactic-table th,
body.printing .tactic-table td {
  font-size: 0.67rem !important;
  padding: 0.28rem 0.4rem !important;
  word-break: break-word !important;
}

body.printing .tactic-table.akteure-tbl { font-size: 0.72rem !important; }
body.printing .tactic-table.akteure-tbl thead tr,
body.printing .tactic-table.akteure-tbl tbody tr { grid-template-columns: 30% 30% 40% !important; }
body.printing .tactic-analysis-body { font-size: 0.73rem !important; line-height: 1.45 !important; }

body.printing .party-split-num,
body.printing .file-count-num       { font-size: 1.35rem !important; }

body.printing .analysis-report-head-actions { display: none !important; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 860px) {
  .page   { padding: 1.75rem 1.5rem 4rem; }
  .card   { padding: 1.5rem; }
  .files-card { padding: 1.5rem 1.2rem 1.2rem !important; }
  .forensic-section { padding: 1.2rem; }
  .files-panel { padding: 1.2rem; }
  .topbar {
    padding: 0 1.5rem;
    margin-top: -1.75rem;
  }

  .filter-row { grid-template-columns: 1fr 1fr; }
  .filter-actions { grid-column: 1 / -1; }
  .analysis-report-meta { grid-template-columns: 1fr; }
  .analysis-report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .analysis-grid {
    grid-template-columns: 1fr;
  }

  .preview-cell { width: auto; }
  .row-preview-box,
  .row-preview-loading,
  .row-preview-empty,
  .row-preview-frame,
  .row-preview-image { width: 100%; }
  .row-preview-frame { height: auto; }
}

@media (max-width: 600px) {
  .page   { padding: 1.25rem 1rem 3rem; }
  .card   { padding: 1.25rem; }
  .files-card { padding: 1.25rem 1rem 1rem !important; }
  .forensic-section { padding: 1rem; }
  .files-panel { padding: 1rem; }
  .topbar {
    padding: 0 1rem;
    height: 3.2rem;
    margin-top: -1.25rem;
  }

  .grid           { grid-template-columns: 1fr; max-width: none; }
  .open-case-grid { grid-template-columns: 1fr; max-width: none; }
  .filter-row     { grid-template-columns: 1fr; }
  .analysis-report-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .analysis-report-hint { text-align: left; }
  .analysis-report-grid { grid-template-columns: 1fr; }
  .qa-topline {
    flex-direction: column;
  }
  .qa-chip-row {
    justify-content: flex-start;
  }
  .qa-evidence-grid,
  .qa-focus-list {
    grid-template-columns: 1fr;
  }
  .filter-actions {
    grid-column: auto;
    flex-direction: column;
    align-items: stretch;
  }

  #exportPdfReportBtn,
  #toggleMultiDeleteBtn,
  .filter-actions #goToUploadBtn {
    width: 100%;
    min-width: 0;
  }

  #goToUploadBtn {
    min-width: 0;
  }

  .case-persons-row {
    grid-template-columns: 1fr;
  }

  .analysis-cell {
    min-width: 0;
  }

  .analysis-glass {
    min-height: 0;
  }

  #createCaseBtn  { width: 100%; }

  table { font-size: 0.85rem; }

  .header-logo { height: 1.8rem; }
}

/* ================================================================
   PARTY COMPARISON BOXES – enhanced 2-column layout
   ================================================================ */
.qa-persons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.qa-person-col {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 1.5px solid #cdd9e1;
  background: rgba(255,255,255,0.72);
}

/* Protected = subtle grey */
.qa-person-col:first-child {
  border-color: #d1dde3;
  background: #f8f9fa;
}

/* Opposing = subtle grey */
.qa-person-col:last-child {
  border-color: #d1dde3;
  background: #f8f9fa;
}

.qa-person-col-label {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed rgba(0,0,0,0.08);
  margin-bottom: 0.1rem;
}

.qa-person-role {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-soft);
}

.qa-person-col:first-child .qa-person-role { color: #1A2B3C; }
.qa-person-col:last-child  .qa-person-role { color: #1A2B3C; }

.qa-person-keywords {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

/* Dot track – bigger, clearer bars */
.qa-dot {
  width: 1.4rem;
  height: 0.26rem;
  border-radius: 999px;
  display: inline-block;
  border: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.qa-dot.is-positive {
  background: linear-gradient(90deg, #B8904A, #B8904A);
}

.qa-dot.is-negative {
  background: linear-gradient(90deg, #C0392B, #a93226);
}

.qa-dot-track {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: wrap;
  row-gap: 0.25rem;
}

.qa-dot-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.qa-dot-count {
  font-size: 0.78rem;
  font-weight: 800;
  color: #1A2B3C;
  min-width: 0.9rem;
}

.qa-badge-row-label {
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 3.6rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

/* KI Report summary cards – stronger visual hierarchy */
.analysis-report-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  border: 1.5px solid #d9e7ec;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(15,43,54,0.06);
  transition: box-shadow 150ms ease;
}

.analysis-report-card:hover {
  box-shadow: 0 4px 16px rgba(15,43,54,0.1);
}

.analysis-report-card-label {
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #5a6b78;
}

.analysis-report-card-value {
  font-size: 1.25rem;
  line-height: 1.1;
  font-weight: 800;
  color: #1A2B3C;
  letter-spacing: -0.01em;
}

.analysis-report-card-detail {
  font-size: 0.74rem;
  line-height: 1.4;
  color: #5a6b78;
}

/* All 3 cards share the same neutral white/cyan style */
.analysis-report-card.is-protected,
.analysis-report-grid .analysis-report-card:nth-child(2) {
  border-color: #d9e7ec;
  background: rgba(255, 255, 255, 0.9);
}
.analysis-report-grid .analysis-report-card:nth-child(2) .analysis-report-card-value {
  color: #1A2B3C;
}

.analysis-report-card.is-opposing,
.analysis-report-grid .analysis-report-card:nth-child(3) {
  border-color: #d9e7ec;
  background: rgba(255, 255, 255, 0.9);
}
.analysis-report-grid .analysis-report-card:nth-child(3) .analysis-report-card-value {
  color: #1A2B3C;
}

/* Dot bars in analysis-box (files page) also use the bigger dots */
.analysis-dot {
  width: 1.4rem;
  height: 0.26rem;
  border-radius: 999px;
  display: inline-block;
  border: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}

.analysis-dot.is-positive {
  background: linear-gradient(90deg, #B8904A, #B8904A);
}

.analysis-dot.is-negative {
  background: linear-gradient(90deg, #C0392B, #a93226);
}

/* ================================================================
   PARTY STAT BLOCKS – big number display (Pos/Neg per document)
   ================================================================ */
.qa-stat-row {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.25rem;
}

.qa-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  padding: 0.7rem 0.5rem 0.6rem;
  border-radius: 12px;
  min-width: 0;
}

.qa-stat.is-positive {
  background: rgba(22,163,74,0.04);
  border: 1px solid rgba(22,163,74,0.15);
}

.qa-stat.is-negative {
  background: rgba(220,38,38,0.03);
  border: 1px solid rgba(220,38,38,0.15);
}

.qa-stat-num {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.qa-stat.is-positive .qa-stat-num { color: #B8904A; }
.qa-stat.is-negative .qa-stat-num { color: #dc2626; }

.qa-stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.06rem;
}

.qa-stat.is-positive .qa-stat-label { color: #B8904A; }
.qa-stat.is-negative .qa-stat-label { color: #dc2626; }

/* ================================================================
   KI REPORT PARTY CARDS – split Positiv / Negativ with big numbers
   ================================================================ */
.analysis-report-card.is-party {
  border-color: #d9e7ec;
  background: rgba(255, 255, 255, 0.9);
}

.party-split {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.4rem;
}

.party-split-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  padding: 0.65rem 0.4rem 0.55rem;
  border-radius: 10px;
  min-width: 0;
}

.party-split-item.is-positive {
  background: rgba(22,163,74,0.04);
  border: 1px solid rgba(22,163,74,0.15);
}

.party-split-item.is-negative {
  background: rgba(220,38,38,0.03);
  border: 1px solid rgba(220,38,38,0.15);
}

.party-split-num {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.party-split-item.is-positive .party-split-num { color: #B8904A; }
.party-split-item.is-negative .party-split-num { color: #dc2626; }

.party-split-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 0.04rem;
}

.party-split-item.is-positive .party-split-label { color: #B8904A; }
.party-split-item.is-negative .party-split-label { color: #dc2626; }

/* ================================================================
   CASE FIELD EDIT – inline pencil icon + input
   ================================================================ */
.case-field-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.4rem;
  width: 100%;
}

.case-field-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.case-edit-btn {
  flex-shrink: 0;
  width: 1.45rem;
  height: 1.45rem;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  padding: 0;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 140ms ease, color 140ms ease;
  margin-top: 0.1rem;
  box-shadow: none;
  filter: none;
  transform: none;
}

.case-person-field:hover .case-edit-btn { opacity: 1; }
.case-edit-btn:hover { color: var(--accent); opacity: 1 !important; transform: none !important; box-shadow: none !important; filter: none !important; }
.case-edit-btn svg { width: 0.78rem; height: 0.78rem; stroke: currentColor; }

.case-edit-input {
  width: 100%;
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  padding: 0.22rem 0.52rem;
  font: inherit;
  font-size: 0.82rem;
  color: var(--ink);
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(26,43,60,0.12);
}

select.case-edit-input {
  padding-right: 1.8rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 0.75rem) calc(50% - 0.05rem),
    calc(100% - 0.5rem) calc(50% - 0.05rem);
  background-size: 0.35rem 0.35rem;
  background-repeat: no-repeat;
  appearance: none;
  cursor: pointer;
}

.case-edit-actions {
  display: flex;
  gap: 0.22rem;
  flex-shrink: 0;
  align-items: center;
  margin-top: 0.1rem;
}

.case-save-btn,
.case-cancel-btn {
  width: 1.5rem;
  height: 1.5rem;
  border: 0;
  border-radius: 5px;
  padding: 0;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: none;
  box-shadow: none;
  filter: none;
}

.case-save-btn { background: var(--ok-light); color: var(--ok); }
.case-save-btn:hover { background: #f3ecdb; transform: none !important; box-shadow: none !important; }
.case-cancel-btn { background: var(--error-light); color: var(--error); }
.case-cancel-btn:hover { background: #fbd8d4; transform: none !important; box-shadow: none !important; }

/* ================================================================
   MODERN FILE ANALYSIS CARD  (qa-modern)
   ================================================================ */
.qa-modern {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.qa-mod-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(26,43,60,0.06);
  margin-bottom: 0.8rem;
}

.qa-mod-eyebrow {
  margin: 0 0 0.15rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-2);
}

.qa-mod-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.35;
}

.qa-mod-doctype {
  flex-shrink: 0;
  display: inline-flex;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: var(--navy);
  color: #F8F9FA;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.qa-mod-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.8rem;
}

.qa-mod-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.06rem;
}

.qa-mod-meta-label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(26,43,60,0.4);
}

.qa-mod-meta-value {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--navy);
  line-height: 1.35;
}

.qa-mod-persons {
  padding: 0.6rem 0;
  border-top: 1px solid rgba(26,43,60,0.06);
  border-bottom: 1px solid rgba(26,43,60,0.06);
  margin-bottom: 0.8rem;
}

.qa-mod-persons-count {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0.04rem 0.42rem;
  border-radius: 999px;
  background: rgba(197,160,89,0.15);
  color: #B8904A;
  font-size: 0.6rem;
  font-weight: 800;
  vertical-align: middle;
}
.qa-mod-persons-list {
  display: flex;
  flex-direction: column;
  margin-top: 0.45rem;
  border: 1px solid rgba(26,43,60,0.1);
  border-radius: 9px;
  overflow: hidden;
}
.qa-mod-person-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
  border-bottom: 1px solid rgba(26,43,60,0.06);
}
.qa-mod-person-row:last-child { border-bottom: none; }
.qa-mod-person-row:nth-child(even) { background: rgba(26,43,60,0.025); }
.qa-mod-person-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: #C5A059;
  flex-shrink: 0;
}

/* Verdict */
.qa-mod-verdict {
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  background: #f8f9fa;
  margin-bottom: 0.8rem;
}

.qa-mod-verdict-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.qa-mod-verdict-label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(26,43,60,0.4);
}

.qa-mod-verdict-badge {
  display: inline-flex;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.qa-mod-verdict-badge--negative {
  background: rgba(220,38,38,0.08);
  color: #b91c1c;
  border: 1px solid rgba(220,38,38,0.2);
}
.qa-mod-verdict-badge--positive {
  background: rgba(22,163,74,0.08);
  color: #B8904A;
  border: 1px solid rgba(22,163,74,0.2);
}
.qa-mod-verdict-badge--neutral {
  background: rgba(26,43,60,0.06);
  color: var(--navy);
  border: 1px solid rgba(26,43,60,0.12);
}

.qa-mod-verdict-text {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.55;
  color: rgba(26,43,60,0.7);
}

/* Party stats */
.qa-mod-stats {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.qa-mod-stat-col {
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  background: #f8f9fa;
}

.qa-mod-stat-role {
  display: block;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(26,43,60,0.4);
}

.qa-mod-stat-name {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy);
  margin-top: 0.1rem;
  margin-bottom: 0.45rem;
  line-height: 1.3;
}

.qa-mod-stat-nums {
  display: flex;
  gap: 0.5rem;
}

.qa-mod-stat-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.08rem;
  padding: 0.5rem 0.3rem;
  border-radius: var(--radius-md);
}

.qa-mod-stat-box.is-positive {
  background: rgba(22,163,74,0.04);
  border: 1px solid rgba(22,163,74,0.12);
}
.qa-mod-stat-box.is-negative {
  background: rgba(220,38,38,0.03);
  border: 1px solid rgba(220,38,38,0.12);
}

.qa-mod-stat-num {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.qa-mod-stat-box.is-positive .qa-mod-stat-num { color: #B8904A; }
.qa-mod-stat-box.is-negative .qa-mod-stat-num { color: #dc2626; }

.qa-mod-stat-label {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.qa-mod-stat-box.is-positive .qa-mod-stat-label { color: rgba(22,163,74,0.7); }
.qa-mod-stat-box.is-negative .qa-mod-stat-label { color: rgba(220,38,38,0.7); }

/* ================================================================
   FORENSISCHER BERICHT – legacy layout (kept for compat)
   ================================================================ */
.forensic-report {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.forensic-report-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.forensic-head-left {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.forensic-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
  font-family: inherit;
}

.forensic-subtitle {
  font-size: 0.72rem;
  color: rgba(26,43,60,0.5);
  font-family: inherit;
}

.forensic-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.38rem 0.85rem;
}

.forensic-field {
  display: flex;
  flex-direction: column;
  gap: 0.04rem;
}

.forensic-field.is-full { grid-column: 1 / -1; }

.forensic-field-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(26,43,60,0.45);
  font-family: inherit;
}

.forensic-field-value {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--navy);
  line-height: 1.4;
  font-family: inherit;
}

.forensic-persons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.55rem 0;
  border-top: 1px solid rgba(26,43,60,0.06);
  border-bottom: none;
}

.forensic-person-chip {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #f5f6f8;
  border: 1px solid rgba(26,43,60,0.1);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--navy);
  font-family: inherit;
}

.forensic-fazit {
  padding: 0.55rem 0.68rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #f0f8fa, #e8f3f6);
  border: 1px solid #cdd9e1;
  font-size: 0.81rem;
  line-height: 1.52;
  color: #1A2B3C;
  font-family: "Inter", system-ui, sans-serif;
}

.forensic-fazit-label {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1A2B3C;
  margin-bottom: 0.22rem;
  display: block;
  font-family: "Inter", system-ui, sans-serif;
}

.forensic-verdict-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.3rem 0;
}

/* ================================================================
   EINORDNUNG BOX – Opposing Party Tactic Analysis
   ================================================================ */
/* ═══════════════════════════════════════════════
   TACTIC ANALYSIS BOX  (redesigned: table layout)
   ═══════════════════════════════════════════════ */
.tactic-analysis-box {
  margin-top: 0.68rem;
  margin-bottom: 2rem;
  padding: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.tactic-analysis-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tactic-analysis-eyebrow {
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-2);
}

.tactic-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #5a6b78, #1A2B3C);
  flex-shrink: 0;
}

.tactic-icon svg {
  width: 0.85rem;
  height: 0.85rem;
  fill: #fff;
}

.tactic-analysis-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.tactic-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.tactic-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(26, 43, 60, 0.07);
  border: 1px solid rgba(26, 43, 60, 0.18);
  color: var(--navy);
}

.tactic-tag.is-critical {
  background: rgba(192, 57, 43, 0.1);
  border-color: rgba(192, 57, 43, 0.3);
  color: #8b1a0f;
}

.tactic-tag.is-warning {
  background: rgba(211, 84, 0, 0.1);
  border-color: rgba(211, 84, 0, 0.28);
  color: #1A2B3C;
}

.tactic-analysis-body {
  font-size: 0.81rem;
  line-height: 1.6;
  color: #1A2B3C;
  font-weight: 400;
}

.tactic-analysis-body strong {
  font-weight: 700;
  color: var(--navy);
}

.tactic-method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.38rem;
}

.tactic-method-item {
  display: flex;
  flex-direction: column;
  gap: 0.06rem;
  padding: 0.4rem 0.52rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(139,63,168,0.15);
}

.tactic-method-label {
  font-size: 0.63rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #5a6b78;
}

.tactic-method-value {
  font-size: 0.78rem;
  font-weight: 600;
  color: #1A2B3C;
  line-height: 1.35;
}

.tactic-legal-note {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: rgba(192, 57, 43, 0.07);
  border: 1px solid rgba(192, 57, 43, 0.2);
}

.tactic-legal-icon {
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.tactic-legal-text {
  font-size: 0.77rem;
  line-height: 1.5;
  color: #5a1010;
  font-weight: 500;
}

/* ================================================================
   AKTEURE BOX – All Persons / Actors with Color-Coded Sentiment
   ================================================================ */
.akteure-box {
  margin-top: 1.5rem;
  padding: 0;
  border-radius: 0;
  border: none;
  background: linear-gradient(135deg, #f5fafd, #edf4fa);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

/* New simplified header (title + legend on one line) */
.akteure-head-simple {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.akteure-title-simple {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
}

/* ── Akteure title row with refresh button ── */
.akteure-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.akteure-title-row .tactic-section-title,
.akteure-title-row .tactic-section-subtitle {
  margin-bottom: 0;
}

.akteure-refresh-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}

.akteure-timestamp {
  font-size: 0.65rem;
  color: rgba(26,43,60,0.45);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.akteure-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(26,43,60,0.18);
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, #fff, #f5f6f8);
  color: var(--navy);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 150ms ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.akteure-refresh-btn:hover {
  background: linear-gradient(150deg, var(--navy), #243447);
  color: #F8F9FA;
  border-color: var(--navy);
}

.akteure-refresh-btn:hover svg {
  stroke: var(--gold);
}

.akteure-refresh-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.akteure-refresh-btn svg {
  width: 1rem;
  height: 1rem;
  stroke: var(--navy);
  transition: stroke 150ms ease;
}

@keyframes akteure-spin {
  to { transform: rotate(360deg); }
}

.akteure-refresh-spin,
.ki-btn-spin {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  animation: akteure-spin 0.8s linear infinite;
}

/* ── Unified KI Action Buttons (App-wide) ── */
.ki-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(26,43,60,0.18);
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, #fff, #f5f6f8);
  color: var(--navy);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 150ms ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.ki-action-btn:hover {
  background: linear-gradient(150deg, var(--navy), #243447);
  color: #F8F9FA;
  border-color: var(--navy);
}
.ki-action-btn:hover svg { stroke: var(--gold); }
.ki-action-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
.ki-action-btn svg {
  width: 1rem;
  height: 1rem;
  stroke: var(--navy);
  transition: stroke 150ms ease;
}

/* Tabular persons layout – matches tactic-table (Section 2) styling */
.akteure-table-container {
  border-radius: 10px;
  border: 1px solid rgba(26,43,60,0.14);
  overflow: hidden;
  background: rgba(255,255,255,0.9);
  width: 100%;
}

/* ── Personen-Tabelle (Tabelle 5) — 30 / 30 / 40 column split ── */
.tactic-table.akteure-tbl thead tr,
.tactic-table.akteure-tbl tbody tr {
  grid-template-columns: 30% 30% 40%;
}

.tactic-table.akteure-tbl td:first-child {
  font-weight: 600;
  color: #1A2B3C;
}
.tactic-table.akteure-tbl td:nth-child(2) {
  color: #5a6b78;
}
.tactic-table.akteure-tbl td:nth-child(3) {
  color: #5a6a7a;
  font-size: 0.76rem;
}


/* Sentiment dots — hidden inside tables for clean text-only look */
.tactic-table .akteure-sentiment-dot,
.tactic-table .akteure-legend-dot {
  display: none !important;
}

.akteure-sentiment-dot {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

.akteure-sentiment-dot.is-positive { background: linear-gradient(135deg, #B8904A, #B8904A); }
.akteure-sentiment-dot.is-negative { background: linear-gradient(135deg, #C0392B, #a93226); }
.akteure-sentiment-dot.is-neutral  { background: linear-gradient(135deg, #5a6b78, #5a6b78); }

/* Legacy – kept for backwards compat */
.akteure-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.akteure-eyebrow {
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5a6b78;
}

.akteure-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #1A2B3C;
  letter-spacing: -0.01em;
}

.akteure-legend {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.akteure-legend-item {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.69rem;
  font-weight: 600;
  color: #5a6b78;
}

.akteure-legend-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.akteure-legend-dot.is-positive { background: #B8904A; }
.akteure-legend-dot.is-negative { background: #d25b4a; }
.akteure-legend-dot.is-neutral  { background: #5a6b78; }

.akteure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.42rem;
}

.akteure-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.62rem;
  border-radius: 10px;
  border: 1px solid #cdd9e1;
  background: rgba(255,255,255,0.82);
  transition: box-shadow 120ms ease;
}

.akteure-item:hover {
  box-shadow: 0 2px 8px rgba(15,43,54,0.1);
}

.akteure-item.is-positive {
  border-color: #f3ecdb;
  background: linear-gradient(135deg, #f5fdf8, #eaf8f0);
}

.akteure-item.is-negative {
  border-color: #f5bcb8;
  background: linear-gradient(135deg, #fff8f7, #fdecea);
}

.akteure-item.is-neutral {
  border-color: #cdd9e1;
  background: rgba(255,255,255,0.82);
}

.akteure-avatar {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.akteure-item.is-positive .akteure-avatar { background: linear-gradient(135deg, #B8904A, #B8904A); }
.akteure-item.is-negative .akteure-avatar { background: linear-gradient(135deg, #d25b4a, #a93226); }
.akteure-item.is-neutral  .akteure-avatar { background: linear-gradient(135deg, #5a6b78, #5a6b78); }

.akteure-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.06rem;
}

.akteure-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1A2B3C;
  line-height: 1.25;
  word-break: break-word;
}

.akteure-role {
  font-size: 0.67rem;
  font-weight: 600;
  color: #5a6b78;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.akteure-sentiment {
  font-size: 0.69rem;
  font-weight: 700;
  margin-top: 0.12rem;
  padding: 0.1rem 0.42rem;
  border-radius: 999px;
  align-self: flex-start;
}

.akteure-item.is-positive .akteure-sentiment {
  background: rgba(46, 158, 101, 0.15);
  color: #B8904A;
  border: 1px solid rgba(46,158,101,0.25);
}

.akteure-item.is-negative .akteure-sentiment {
  background: rgba(210, 91, 74, 0.15);
  color: #8b1a0f;
  border: 1px solid rgba(210,91,74,0.25);
}

.akteure-item.is-neutral .akteure-sentiment {
  background: rgba(90, 138, 154, 0.12);
  color: #1A2B3C;
  border: 1px solid rgba(90,138,154,0.2);
}

.akteure-empty {
  font-size: 0.8rem;
  color: #5a6b78;
  font-style: italic;
  text-align: center;
  padding: 0.6rem;
}

/* ================================================================
   TACTIC BOX — new table-based layout
   ================================================================ */

/* Eyebrow + profile title replace the old head/title/icon */
.tactic-analysis-eyebrow {
  margin: 0 0 0.18rem;
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-2);
}

.tactic-analysis-profile-title {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.tactic-analysis-body {
  font-size: 0.81rem;
  line-height: 1.62;
  color: #1A2B3C;
  font-weight: 400;
  margin-bottom: 0.55rem;
}

.tactic-analysis-body strong {
  font-weight: 700;
  color: var(--navy);
}

/* ── Report header ── */
.tactic-report-header {
  margin-bottom: 2rem;
  padding-bottom: 1.2rem;
  border-bottom: 2px solid rgba(197,160,89,0.3);
}

/* ── Numbered sections ── */
.tactic-section {
  display: flex;
  gap: 1.2rem;
  margin-bottom: 2.2rem;
  align-items: flex-start;
}

.tactic-section-number {
  flex-shrink: 0;
  width: 2.1rem;
  height: 2.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(197,160,89,0.07);
  border: 2px solid rgba(197,160,89,0.5);
  color: #C5A059;
  font-family: "JetBrains Mono", "SF Mono", Menlo, monospace;
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 0.1rem;
}

.tactic-section-content {
  flex: 1;
  min-width: 0;
}

.tactic-section-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.tactic-section-meta {
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(26,43,60,0.45);
  letter-spacing: 0;
}

.tactic-section-subtitle {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  color: rgba(26,43,60,0.45);
}

/* ── Legal text ── */
.tactic-legal-text {
  font-size: 0.84rem;
  line-height: 1.65;
  color: #1A2B3C;
  padding: 1rem 1.2rem;
  background: rgba(26,43,60,0.03);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--gold);
}

.tactic-legal-text em {
  font-style: normal;
  font-weight: 700;
  color: var(--navy);
}

/* ── Counsel advice grid ── */
.tactic-counsel-grid {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.tactic-counsel-item {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  background: rgba(26,43,60,0.025);
  border-radius: var(--radius-md);
  transition: background 120ms ease;
}

.tactic-counsel-item:hover {
  background: rgba(26,43,60,0.05);
}

.tactic-counsel-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.tactic-counsel-label {
  margin: 0 0 0.2rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy);
}

.tactic-counsel-text {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #1A2B3C;
}

.tactic-counsel-text strong {
  font-weight: 700;
  color: var(--navy);
}

/* ── Tactic table ── */
.tactic-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid rgba(26,43,60,0.14);
  background: rgba(255,255,255,0.9);
  width: 100%;
}

/* Grid-based table layout: all rows share identical column tracks */
.tactic-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  display: block;
  font-family: var(--font, "Inter"), system-ui, sans-serif;
}

.tactic-table col { display: none; }

.tactic-table thead {
  display: block;
  width: 100%;
  background: #1A2B3C;
  border-bottom: 3px solid var(--gold, #C5A059);
}

.tactic-table tbody {
  display: block;
  width: 100%;
}

/* Each row becomes a grid row with fixed column tracks */
.tactic-table thead tr,
.tactic-table tbody tr {
  display: grid;
  grid-template-columns: 22% 28% 50%;
  align-items: stretch;
  width: 100%;
}

/* ── Header cells ── */
.tactic-table thead tr {
  background: transparent;
  border: none;
}

.tactic-table th {
  padding: 12px 15px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #FFFFFF;
  border: none;
  text-align: left;
  background: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
}

/* ── Data cells ── */
.tactic-table td {
  padding: 12px 15px;
  border-bottom: 1px solid rgba(26,43,60,0.07);
  line-height: 1.45;
  color: #1a2b3c;
  font-size: 0.78rem;
  background: transparent;
  word-break: break-word;
  display: flex;
  align-items: flex-start;
  min-width: 0;
  text-align: left;
}

.tactic-table tbody tr:last-child td {
  border-bottom: none;
}

/* DOC-ID column: left-aligned like all other columns */
.tactic-table th:last-child,
.tactic-table td:last-child {
  justify-content: flex-start;
  text-align: left;
}

/* ── Alternate row colors (zebra striping) ── */
.tactic-table tbody tr:nth-child(odd) {
  background: rgba(255,255,255,0.65);
}
.tactic-table tbody tr:nth-child(even) {
  background: rgba(26,43,60,0.04);
}

.tactic-table .tactic-row-present {
  transition: background 0.15s ease;
}

.tactic-table .tactic-row-present:hover {
  background: rgba(197,160,89,0.08);
}

.tactic-table .tactic-row-absent {
  opacity: 0.5;
}

.tactic-table tbody tr:hover td {
  background: transparent;
}

/* ── Badge – pill shape with colored border ── */
.tactic-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: middle;
  margin-right: 0.25rem;
  white-space: nowrap;
  line-height: 1.3;
}

.tactic-badge.is-found {
  background: rgba(192,57,43,0.12);
  color: #8b1a0f;
  border: 1px solid rgba(192,57,43,0.28);
}

.tactic-badge.is-none {
  background: rgba(90,130,150,0.1);
  color: #5a6b78;
  border: 1px solid rgba(90,130,150,0.22);
}

/* ── Legacy legal assessment block (kept for backwards compat) ── */
.tactic-legal-assessment { display: none; }

/* ── Compact dossier-level tactic table (top report area) ── */
#analysisReportTactics .tactic-analysis-box {
  margin-top: 0.55rem;
  padding: 0;
  gap: 1rem;
  background: transparent;
  border: none;
  box-shadow: none;
}

#analysisReportTactics .tactic-analysis-eyebrow {
  font-size: 0.63rem;
  margin-bottom: 0.12rem;
}

#analysisReportTactics .tactic-analysis-profile-title {
  font-size: 0.95rem;
  margin: 0 0 0.35rem;
}

#analysisReportTactics .tactic-analysis-body {
  font-size: 0.81rem;
  line-height: 1.55;
  margin-bottom: 0.45rem;
}

#analysisReportTactics .tactic-table th {
  padding: 0.7rem 0.9rem;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
  color: #F8F9FA;
  background: transparent;
  border: none;
}

#analysisReportTactics .tactic-table td {
  padding: 0.7rem 0.9rem;
  font-size: 0.76rem;
  line-height: 1.45;
  vertical-align: middle;
  height: auto;
}

#analysisReportTactics .tactic-table tr {
  height: auto;
  min-height: 0;
}

/* table-layout not needed – layout is now CSS Grid */

/* Standalone card style for dossier-level sections (3-7) */
#analysisReportTactics .tactic-section,
#analysisReportAkteure .tactic-section {
  gap: 1.3rem;
  margin-bottom: 0;
  padding: 1.8rem 1.9rem;
  border-radius: 14px;
  border: 1px solid rgba(26,43,60,0.08);
  background: #fff;
  box-shadow: 0 1px 3px rgba(26,43,60,0.04);
  align-items: flex-start;
}
#analysisReportTactics .tactic-section + .tactic-section,
#analysisReportAkteure .tactic-section + .tactic-section {
  margin-top: 1.4rem;
}
/* Grosser Gold-Ring-Badge auch im Report-Kontext (gleich wie Karte 8/9) */
#analysisReportTactics .tactic-section-number,
#analysisReportAkteure .tactic-section-number {
  width: 3.2rem;
  height: 3.2rem;
  font-size: 1rem;
  font-weight: 700;
}
#analysisReportTactics .tactic-section-title,
#analysisReportAkteure .tactic-section-title { font-size: 1.55rem; font-weight: 600; }
/* Luft zwischen Kicker/Titel und dem Inhalt darunter */
#analysisReportTactics .tactic-section-title,
#analysisReportAkteure .tactic-section-title { margin-bottom: 0.7rem; }
#analysisReportTactics .tactic-section-subtitle,
#analysisReportAkteure .tactic-section-subtitle { font-size: 0.72rem; margin-bottom: 0.5rem; }

#analysisReportTactics .tactic-report-header { display: none; }
#analysisReportTactics .tactic-analysis-eyebrow { display: none; }
#analysisReportTactics .tactic-analysis-profile-title { display: none; }
#analysisReportTactics .tactic-legal-text { font-size: 0.76rem; padding: 0.7rem 0.9rem; }
#analysisReportTactics .tactic-counsel-item { padding: 0.6rem 0.8rem; }
#analysisReportTactics .tactic-counsel-label { font-size: 0.78rem; }
#analysisReportTactics .tactic-counsel-text { font-size: 0.74rem; }

/* ================================================================
   ANZAHL FILES CARD – same design as party cards
   ================================================================ */
.analysis-report-card.is-file-count {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(26,43,60,0.1);
  background: #fff;
  box-shadow: none;
}

.file-count-split {
  display: flex;
  margin-top: 0.3rem;
}

.file-count-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  padding: 0.65rem 0.4rem 0.55rem;
  border-radius: 10px;
  background: rgba(26,43,60,0.03);
  border: 1px solid rgba(26,43,60,0.1);
}

.file-count-num {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--navy);
}

.file-count-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 0.04rem;
  color: rgba(26,43,60,0.5);
}

/* ================================================================
   PROTECTED PERSON DOT – dark teal
   ================================================================ */
.akteure-sentiment-dot.is-protected {
  background: linear-gradient(135deg, #1A2B3C, #1A2B3C);
  box-shadow: 0 1px 4px rgba(26,43,60,0.35);
}

.akteure-legend-dot.is-protected {
  background: #1A2B3C;
}

/* ================================================================
   UNKNOWN / NO-DATA DOT – türkis/cyan
   Shown when KI has insufficient data to determine sentiment.
   Visually distinct from both "protected" (dark teal) and "neutral"
   (grey): uses a bright cyan/türkis gradient.
   ================================================================ */
.akteure-sentiment-dot.is-unknown {
  background: linear-gradient(135deg, #5a6b78, #5a6b78);
  box-shadow: 0 1px 4px rgba(8, 145, 178, 0.32);
}

.akteure-legend-dot.is-unknown {
  background: #5a6b78;
}

/* ================================================================
   TACTIC TABLE – KI cell: badge on top, text below
   ================================================================ */
.tactic-ki-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.22rem;
}

.tactic-evidence-text {
  font-size: 0.74rem;
  line-height: 1.4;
  color: #1A2B3C;
  font-weight: 400;
}

.tactic-row-present .tactic-evidence-text {
  color: var(--navy);
}

.tactic-row-absent .tactic-evidence-text {
  color: #7a6a8a;
  font-style: italic;
}

/* ================================================================
   TACTIC TABLE – DOC-ID column styling
   ================================================================ */
.tactic-doc-id-cell {
  white-space: normal;
  min-width: 0;
  word-break: break-word;
  text-align: left;
  justify-content: flex-start;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.15rem;
}

.tactic-doc-ids {
  display: inline;
  white-space: normal;
  word-break: break-all;
  line-height: 1.55;
  font-size: 0.72rem;
  font-weight: 500;
  font-family: var(--font-mono, "SF Mono", "Consolas", monospace);
  color: var(--navy);
  letter-spacing: 0.01em;
  text-align: left;
  background: none;
  border-radius: 0;
  padding: 0;
}

#analysisReportTactics .tactic-doc-ids {
  font-size: 0.76rem;
}

/* ================================================================
   TACTIC TABLE – row state overrides
   ================================================================ */
.tactic-table .tactic-row-present td {
  background: transparent;
}

.tactic-table .tactic-row-absent td {
  background: transparent;
  opacity: 0.7;
}

.tactic-td-tactic {
  display: flex !important;
  flex-direction: column;
  gap: 0.12rem;
  font-weight: 700;
  color: #1A2B3C;
  font-size: 0.8rem;
  align-items: flex-start !important;
  justify-content: flex-start !important;
}

.tactic-tactic-name {
  font-weight: 700;
  color: #1A2B3C;
  line-height: 1.35;
}

.tactic-td-article {
  font-size: 0.68rem;
  color: #5a6b78;
  font-style: italic;
  font-weight: 500;
  line-height: 1.3;
}

/* Present row: left accent bar */
.tactic-row-present td:first-child {
  border-left: 3px solid rgba(197,160,89,0.5);
  padding-left: calc(1.1rem - 3px);
}

/* Absent row: lighter left bar */
.tactic-row-absent td:first-child {
  border-left: 3px solid rgba(139,63,168,0.12);
  padding-left: calc(0.9rem - 3px);
}

/* KI text left-aligned, full height */
.tactic-td-ki {
  align-items: flex-start !important;
  justify-content: flex-start !important;
  font-size: 0.78rem;
  color: #1A2B3C;
  line-height: 1.5;
}

.tactic-row-absent .tactic-td-ki {
  color: #7a6a8a;
  font-style: italic;
}

/* Evidence badge now lives inside tactic-td-tactic */
.tactic-td-tactic .tactic-ev-badge {
  margin-top: 0.35rem;
}

/* Legacy evidenz column cell (kept for compat) */
.tactic-td-ev {
  align-items: flex-start !important;
  justify-content: flex-start !important;
  padding-top: 0.65rem;
}

/* ── Evidence verdict badges ── */
.tactic-ev-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: default;
}

.tactic-ev-dot {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Belegt – green */
.tactic-ev-proven {
  background: rgba(29,122,62,0.11);
  color: #B8904A;
  border: 1px solid rgba(29,122,62,0.3);
}
.tactic-ev-proven .tactic-ev-dot { background: #C5A059; }

/* Indiziert – amber */
.tactic-ev-indiz {
  background: rgba(180,80,0,0.10);
  color: #6b3800;
  border: 1px solid rgba(180,80,0,0.28);
}
.tactic-ev-indiz .tactic-ev-dot { background: #B8904A; }

/* Tendenz – orange-brown */
.tactic-ev-trend {
  background: rgba(140,80,0,0.10);
  color: #5a3500;
  border: 1px solid rgba(140,80,0,0.22);
}
.tactic-ev-trend .tactic-ev-dot { background: #a06000; }

/* Nicht belegt – grey */
.tactic-ev-none {
  background: rgba(80,80,100,0.07);
  color: #505068;
  border: 1px solid rgba(80,80,100,0.16);
}
.tactic-ev-none .tactic-ev-dot { background: #909090; }

/* ── Per-document evidence box ── */
.doc-evidence-box {
  margin-top: 0.75rem;
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1.5px solid #cdd9e1;
  background: rgba(255,255,255,0.75);
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.doc-ev-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(26,43,60,0.45);
}

.doc-ev-verdict {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy);
}

.doc-ev-text {
  margin: 0.1rem 0 0;
  font-size: 0.78rem;
  line-height: 1.58;
  color: #2d3a45;
}

/* Tone variants */
.doc-evidence-box.doc-ev-negative {
  border-color: rgba(192,57,43,0.28);
  background: linear-gradient(135deg, rgba(255,248,247,0.95), rgba(253,240,238,0.9));
}
.doc-evidence-box.doc-ev-negative .doc-ev-verdict { color: #b84434; }

.doc-evidence-box.doc-ev-positive {
  border-color: rgba(29,122,62,0.28);
  background: linear-gradient(135deg, rgba(244,253,247,0.95), rgba(232,248,238,0.9));
}
.doc-evidence-box.doc-ev-positive .doc-ev-verdict { color: #C5A059; }

.doc-evidence-box.doc-ev-neutral {
  border-color: #cdd9e1;
  background: rgba(255,255,255,0.75);
}
.doc-evidence-box.doc-ev-neutral .doc-ev-verdict { color: #1A2B3C; }

/* Compact variant inside report summary */
#analysisReportTactics .tactic-ki-cell {
  gap: 0.14rem;
}

#analysisReportTactics .tactic-evidence-text {
  font-size: 0.66rem;
  line-height: 1.3;
}

/* ================================================================
   FILES PANEL – unified toolbar + table wrapper
   ================================================================ */
.files-panel {
  background: rgba(245,246,248,0.7);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(26,43,60,0.10);
  padding: 1.8rem;
  margin: 1.5rem 0 0;
}

.files-panel table {
  margin-top: 0;
}

/* ── Header: upload + search ── */
.fp-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

/* ── Big Search (Google-style) ── */
.fp-search-hero {
  display: flex;
  justify-content: center;
  padding: 1.5rem 0 1.8rem;
}

.fp-search-wrap-big {
  position: relative;
  width: 100%;
  max-width: 640px;
}

.fp-search-icon-big {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.4rem;
  height: 1.4rem;
  color: rgba(26,43,60,0.4);
  pointer-events: none;
}

.fp-search-big {
  width: 100%;
  padding: 1.1rem 1.4rem 1.1rem 3.4rem;
  border: 2px solid rgba(26,43,60,0.15);
  border-radius: 100px;
  background: #fff;
  font-size: 1.1rem;
  font-family: inherit;
  color: var(--navy);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: all 200ms ease;
}
.fp-search-big:hover {
  border-color: rgba(26,43,60,0.25);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.fp-search-big:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 4px 24px rgba(197,160,89,0.15), 0 0 0 3px rgba(197,160,89,0.08);
}
.fp-search-big::placeholder {
  color: rgba(26,43,60,0.38);
  font-size: 1rem;
}

/* Legacy search (keep for other pages) */
.fp-search-wrap {
  flex: 1;
  position: relative;
  min-width: 14rem;
}

.fp-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.05rem;
  height: 1.05rem;
  color: rgba(26,43,60,0.35);
  pointer-events: none;
}

.fp-search {
  width: 100%;
  padding: 0.7rem 0.85rem 0.7rem 2.6rem;
  border: 1px solid rgba(26,43,60,0.12);
  border-radius: var(--radius-md);
  background: #fff;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--navy);
}
.fp-search:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(197,160,89,0.12);
}
.fp-search::placeholder {
  color: rgba(26,43,60,0.38);
}

/* ── Filters row ── */
.fp-filters-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}

.fp-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.8rem;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, var(--navy), #243447);
  color: #F8F9FA;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 3px 12px rgba(26,43,60,0.2);
  flex-shrink: 0;
}
.fp-upload-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 20px rgba(26,43,60,0.28);
}
.fp-upload-btn svg {
  width: 1.05rem;
  height: 1.05rem;
  stroke: var(--gold);
}

.fp-filters {
  display: flex;
  align-items: flex-end;
  gap: 0.8rem;
  flex-wrap: wrap;
  flex: 1;
}

.fp-filter {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.fp-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(26,43,60,0.55);
}

.fp-input {
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(26,43,60,0.15);
  border-radius: var(--radius-md);
  background: #fff;
  font-size: 0.84rem;
  font-family: inherit;
  color: var(--navy);
  min-width: 6.5rem;
}
.fp-input:focus {
  outline: none;
  border-color: var(--gold);
}

select.fp-input {
  cursor: pointer;
  padding-right: 1.8rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%231A2B3C' opacity='.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
}

/* ── Bar: sort + actions ── */
.fp-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(26,43,60,0.06);
}

.fp-sort {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.fp-sort-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(26,43,60,0.55);
}

.fp-sort-group {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.fp-sort-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--navy);
  margin-right: 0.25rem;
}

.fp-sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: rgba(26,43,60,0.35);
  cursor: pointer;
  transition: all 100ms ease;
}
.fp-sort-btn svg {
  width: 0.85rem;
  height: 0.85rem;
}
.fp-sort-btn:hover {
  background: rgba(26,43,60,0.08);
  color: var(--navy);
}
.fp-sort-btn.fp-sort-btn--active,
.fp-sort-btn.sort-dir-btn--active {
  background: var(--navy);
  color: #F8F9FA;
  border-radius: var(--radius-sm);
}

/* ── Action buttons ── */
.fp-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.fp-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.3rem;
  border: none;
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease;
}
.fp-action-btn svg {
  width: 0.9rem;
  height: 0.9rem;
  flex-shrink: 0;
}
.fp-action-btn:hover {
  background: rgba(26,43,60,0.06);
}

.fp-action--danger {
  color: #b91c1c;
}
.fp-action--danger:hover {
  background: rgba(185,28,28,0.06);
}

.fp-action--navy {
  background: var(--navy);
  color: #F8F9FA;
}
.fp-action--navy:hover {
  background: #243447;
}
.fp-action--navy svg {
  stroke: var(--gold);
}

/* Legacy .files-toolbar kept */
.files-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin: 1.5rem 0 1.8rem;
}

/* Upload CTA */
.toolbar-upload {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.toolbar-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.6rem;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, var(--navy), #243447);
  color: #F8F9FA;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 3px 12px rgba(26,43,60,0.2);
}
.toolbar-upload-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 20px rgba(26,43,60,0.28);
}
.toolbar-upload-btn svg {
  width: 1rem;
  height: 1rem;
  stroke: var(--gold);
}

.toolbar-upload-hint {
  font-size: 0.72rem;
  color: rgba(26,43,60,0.4);
}

/* Filter row */
.toolbar-filters {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.toolbar-filter-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.toolbar-filter-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(26,43,60,0.4);
}

.toolbar-input {
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(26,43,60,0.12);
  border-radius: var(--radius-md);
  background: #fff;
  font-size: 0.82rem;
  font-family: inherit;
  color: var(--navy);
  transition: border-color 120ms ease;
  min-width: 6rem;
}
.toolbar-input:focus {
  outline: none;
  border-color: var(--gold);
}

select.toolbar-input {
  cursor: pointer;
  padding-right: 1.8rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%231A2B3C' opacity='.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
}

/* Sort */
.toolbar-sort {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  margin-left: auto;
}

.toolbar-sort-group {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.toolbar-sort-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(26,43,60,0.5);
  margin-right: 0.15rem;
}

.toolbar-sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: rgba(26,43,60,0.3);
  cursor: pointer;
  transition: all 100ms ease;
}
.toolbar-sort-btn svg {
  width: 0.75rem;
  height: 0.75rem;
}
.toolbar-sort-btn:hover {
  background: rgba(26,43,60,0.06);
  color: var(--navy);
}
.toolbar-sort-btn.sort-dir-btn--active {
  background: rgba(26,43,60,0.08);
  color: var(--navy);
}

/* Action buttons */
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.toolbar-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius-md);
  background: #f5f6f8;
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease;
}
.toolbar-action-btn svg {
  width: 0.85rem;
  height: 0.85rem;
  flex-shrink: 0;
}
.toolbar-action-btn:hover {
  background: rgba(26,43,60,0.08);
}

.toolbar-action-btn.is-danger {
  color: #c0392b;
}
.toolbar-action-btn.is-danger:hover {
  background: rgba(192,57,43,0.06);
}

.toolbar-action-btn.is-primary {
  background: var(--navy);
  color: #F8F9FA;
}
.toolbar-action-btn.is-primary:hover {
  background: #243447;
}
.toolbar-action-btn.is-primary svg {
  stroke: var(--gold);
}

/* Legacy filter-section kept for CSS references */
.filter-section {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 1.2rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* ── Row 1: Filter inputs ── */
.filter-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.65rem;
  align-items: flex-end;
  padding: 0.85rem 1rem 0.75rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.filter-label {
  display: flex;
  flex-direction: row;        /* override global label { flex-direction: column } */
  align-items: center;
  gap: 0.26rem;
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
  cursor: default;
}

.filter-label svg {
  width: 0.8rem;
  height: 0.8rem;
  flex-shrink: 0;
  opacity: 0.55;
}

/* Use .field-input inside filter-section with tighter style */
.filter-section .field-input {
  padding: 0.55rem 0.85rem;
  font-size: 0.86rem;
  border-color: var(--border);
  background: #fff;
}

.filter-section select.field-input {
  padding-right: 2rem;
  background-position:
    calc(100% - 0.85rem) calc(50% - 0.05rem),
    calc(100% - 0.62rem) calc(50% - 0.05rem);
}

/* ── Row 2: Sort Bar ── */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding: 0.52rem 1rem;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.55);
}

.sort-bar-label {
  font-size: 0.67rem;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  white-space: nowrap;
  flex-shrink: 0;
}

.sort-pills {
  display: flex;
  gap: 0.32rem;
  flex-wrap: wrap;
}

.sort-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  padding: 0.5rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.81rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
  transform: none;
  box-shadow: none;
  filter: none;
}

.sort-pill:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-2);
  background: var(--accent-light);
  transform: none;
  box-shadow: none;
  filter: none;
}

.sort-pill.sort-pill--active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-2);
  font-weight: 700;
}

.sort-dir {
  font-size: 0.7rem;
  font-weight: 800;
  opacity: 0.85;
  min-width: 0.6rem;
  display: inline-block;
}

/* ── Row 3: Actions ── */
.filter-section .filter-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  padding: 0.62rem 1rem;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.72);
  /* reset legacy grid behaviour */
  grid-column: auto;
}

/* Base filter-btn override for filter-section context */
.filter-section .filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  padding: 0.5rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.81rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0.01em;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
  /* Kill legacy overrides */
  min-width: 0 !important;
  background-image: none;
}

.filter-section .filter-btn svg {
  width: 0.88rem;
  height: 0.88rem;
  flex-shrink: 0;
  stroke-width: 2.2;
}

.filter-section .filter-btn:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  filter: none;
  background: var(--bg-subtle);
  border-color: #cdd9e1;
  color: var(--ink);
}

/* Danger – Mehrere löschen (leftmost) */
.filter-section .filter-btn--danger {
  border-color: #f5c6c1;
  color: var(--error);
  background: #fff8f7;
}
.filter-section .filter-btn--danger:hover:not(:disabled) {
  background: var(--error-light);
  border-color: #f0a09a;
  color: var(--error);
}
.filter-section .filter-btn--danger.active {
  background: var(--error-light);
  border-color: var(--error);
  color: var(--error);
  font-weight: 800;
}

/* Override legacy ID rule (#exportPdfReportBtn) which has higher specificity */
.filter-section #exportPdfReportBtn {
  background: linear-gradient(145deg, #f7fbfc, #eef4f8);
  border-color: #cdd9e1;
  color: #1A2B3C;
  background-image: none;
}
.filter-section #exportPdfReportBtn:hover:not(:disabled) {
  background: #e4f0f5;
  border-color: #cdd9e1;
  color: #1A2B3C;
  transform: none;
  box-shadow: none;
  filter: none;
}

/* PDF KI-Report */
.filter-section .filter-btn--report {
  border-color: #cdd9e1;
  color: #1A2B3C;
  background: linear-gradient(145deg, #f7fbfc, #eef4f8);
}
.filter-section .filter-btn--report:hover:not(:disabled) {
  background: #e4f0f5;
  border-color: #cdd9e1;
  color: #1A2B3C;
  transform: none;
  box-shadow: none;
  filter: none;
}

/* PDF Files Download */
.filter-section .filter-btn--files {
  border-color: #cdd9e1;
  color: #1A2B3C;
  background: linear-gradient(145deg, #f7fafd, #eef3fb);
}
.filter-section .filter-btn--files:hover:not(:disabled) {
  background: #e4ecf8;
  border-color: #cdd9e1;
  color: #1A2B3C;
  transform: none;
  box-shadow: none;
  filter: none;
}
.filter-section .filter-btn--files:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Upload – primary teal, flush right */
.filter-section .filter-btn--upload {
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
  color: #fff;
  border: 0;
  padding: 0.52rem 1.05rem;
  margin-left: auto;
  background-image: none;
}
.filter-section .filter-btn--upload:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(26,43,60,0.26);
  filter: saturate(1.08);
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
  border: 0;
}

/* ── Sort groups: label + ASC/DESC icon-button pair ── */
.sort-groups {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.sort-group {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.28rem 0.38rem 0.28rem 0.7rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  transition: border-color 120ms ease;
}

.sort-group:focus-within {
  border-color: rgba(197,160,89,0.5);
}

.sort-group-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
  user-select: none;
}

/* Paired icon-button strip */
.sort-group-btns {
  display: inline-flex;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
}

/* Individual ASC / DESC icon button */
.sort-dir-btn {
  width: 1.95rem;
  height: 1.95rem;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  color: var(--ink-muted);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
  transform: none;
  box-shadow: none;
  filter: none;
}

.sort-dir-btn:not(:last-child) {
  border-right: 1px solid var(--border);
}

.sort-dir-btn svg {
  width: 0.9rem;
  height: 0.9rem;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
}

.sort-dir-btn:hover:not(:disabled):not(.sort-dir-btn--active) {
  background: var(--bg-subtle);
  color: var(--ink);
  transform: none;
  box-shadow: none;
  filter: none;
}

/* Active state – teal fill */
.sort-dir-btn--active {
  background: var(--accent-light);
  color: var(--accent);
}

.sort-dir-btn--active svg {
  stroke: var(--accent);
}

.sort-dir-btn--active:hover:not(:disabled) {
  background: var(--accent-light);
  color: var(--accent);
  transform: none;
  box-shadow: none;
  filter: none;
}

/* Responsive */
@media (max-width: 860px) {
  .filter-controls { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .filter-controls { grid-template-columns: 1fr; }
  .filter-section .filter-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-section .filter-btn--upload { margin-left: 0; }
  .sort-bar { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  .sort-groups { gap: 0.4rem; }
  .sort-group { padding: 0.24rem 0.32rem 0.24rem 0.56rem; }
}

/* ================================================================
   UPLOAD HERO BUTTON – files.html prominent CTA (pill style)
   ================================================================ */
/* ── Section heading above upload hero button ── */
.upload-section-title {
  margin: 2.5rem 0 0.7rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(26,43,60,0.4);
  text-align: center;
}

.upload-hero-wrap {
  display: flex;
  justify-content: center;
  margin: 0 0 2.8rem;
  padding: 0.5rem 0;
}
.upload-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  width: auto;
  max-width: 36rem;
  padding: 1rem 2.5rem 1rem 1.5rem;
  background: linear-gradient(150deg, var(--navy), #243447);
  border: none;
  border-radius: var(--radius-lg);
  color: #fff;
  cursor: pointer;
  text-align: left;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 4px 18px rgba(26,43,60,.2);
}
.upload-hero-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(26,43,60,.3);
}
.upload-hero-btn:active { transform: translateY(0); }
.upload-hero-btn-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  background: rgba(255,255,255,.20);
  border-radius: 50%;
}
.upload-hero-btn-icon svg {
  width: 1.15rem;
  height: 1.15rem;
  stroke: #fff;
}
.upload-hero-btn-text {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}
.upload-hero-btn-label {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: #fff;
}
.upload-hero-btn-sub {
  font-size: 0.7rem;
  font-weight: 400;
  color: rgba(255,255,255,.80);
  letter-spacing: .01em;
}

/* ================================================================
   UPLOAD CARD – upload.html card layout
   ================================================================ */
.upload-card {
  padding: 1.6rem 1.8rem 1.8rem;
}
.upload-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
}

.upload-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  background: var(--navy, #1A2B3C);
  color: #F8F9FA;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  transition: background 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.upload-back-btn:hover {
  background: #243b50;
}

.upload-back-btn svg {
  flex-shrink: 0;
}

.upload-cancel-btn {
  display: inline-flex;
  align-items: center;
  margin-top: 0.8rem;
  padding: 0.5rem 1.1rem;
  background: transparent;
  color: #C0392B;
  border: 1px solid rgba(213, 83, 83, 0.3);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.upload-cancel-btn:hover {
  background: rgba(213, 83, 83, 0.08);
  border-color: rgba(213, 83, 83, 0.5);
}
.upload-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.35rem;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.upload-case-banner {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-2);
  letter-spacing: .02em;
  margin: 0 0 0.15rem;
}
.upload-workspace-hint {
  font-size: 0.78rem;
  color: #4A5568;
  margin: 0;
}

/* ================================================================
   AI DISCLAIMER – persistent banner on analysis pages
   ================================================================ */
.ai-disclaimer {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  max-width: 1200px;
  margin: 0.4rem auto 1.2rem;
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  background: linear-gradient(180deg, #fef8e9, #fbf0d1);
  border: 1px solid #ecd599;
  box-shadow: 0 1px 2px rgba(167,118,24,0.06);
}
.ai-disclaimer-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  color: #a77618;
  border: 1px solid #ecd599;
}
.ai-disclaimer-icon svg { width: 1.1rem; height: 1.1rem; }
.ai-disclaimer p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: #5c4410;
}
.ai-disclaimer strong { color: #3d2b04; font-weight: 700; }

/* ================================================================
   UPLOAD PRE-FLIGHT HINTS – anonymisation + AI-disclaimer
   ================================================================ */
.upload-hints {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0.85rem;
  margin: 1.1rem 0 1.4rem;
}
.upload-hint {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.95rem 1.05rem;
  border-radius: 12px;
  border: 1px solid #dbe9f0;
  background: linear-gradient(180deg, #f7fbfd, #eff6fa);
  box-shadow: 0 1px 2px rgba(18,42,62,0.04);
}
.upload-hint--redact {
  border-color: #cdd9e1;
  background: linear-gradient(180deg, #f3fafd, #e8f4f9);
}
.upload-hint--ai {
  border-color: #f1d9ad;
  background: linear-gradient(180deg, #fdf8ec, #faf0d6);
}
.upload-hint-icon {
  flex-shrink: 0;
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #fff;
  border: 1px solid rgba(18,42,62,0.06);
}
.upload-hint-icon svg { width: 1.15rem; height: 1.15rem; }
.upload-hint--redact .upload-hint-icon { color: #1A2B3C; }
.upload-hint--ai .upload-hint-icon { color: #a77618; }
.upload-hint-body { min-width: 0; }
.upload-hint-title {
  margin: 0 0 0.2rem;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: #1A2B3C;
}
.upload-hint-text {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.55;
  color: #1A2B3C;
}
.upload-hint-text strong { color: #1A2B3C; font-weight: 700; }
@media (max-width: 640px) {
  .upload-hints { grid-template-columns: 1fr; }
}

/* ================================================================
   DROPZONE HERO – big redesigned dropzone for upload.html
   ================================================================ */
.dropzone-hero {
  border: 2.5px dashed #cdd9e1;
  border-radius: 18px;
  background: #f4fafc;
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
  outline: none;
  margin-bottom: 1.2rem;
}
.dropzone-hero:hover,
.dropzone-hero:focus-visible,
.dropzone-hero.drag {
  border-color: var(--accent);
  background: #eaf5fa;
  box-shadow: 0 0 0 4px rgba(0,122,154,.09);
}
.dropzone-hero.paste-flash {
  border-color: var(--ok);
  background: #eafaf4;
}
.dropzone-hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2.8rem 2rem 2.2rem;
  text-align: center;
}
.dropzone-hero-icon {
  color: var(--accent);
  opacity: .55;
  margin-bottom: 0.3rem;
}
.dropzone-hero-icon svg {
  width: 3.8rem;
  height: 3.8rem;
}
.dropzone-hero-title {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0;
}
.dropzone-hero-sub {
  font-size: 0.88rem;
  color: #4A5568;
  margin: 0;
}
.dropzone-hero-hint {
  font-size: 0.75rem;
  color: #5a6b78;
  letter-spacing: .025em;
  margin: 0.3rem 0 0.6rem;
}
.dropzone-filetypes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.3rem 0.28rem;
  margin-top: 0.6rem;
  max-width: 560px;
}
.filetype-group-label {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #5a6b78;
  padding: 0 0.2rem;
  white-space: nowrap;
}
.filetype-group-sep {
  display: block;
  width: 100%;
  height: 0;
}
.filetype-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 0.18rem 0.52rem;
  border-radius: 5px;
  white-space: nowrap;
}
.filetype-badge.filetype-doc { background: #e3f0f7; color: var(--accent); }
.filetype-badge.filetype-img { background: rgba(197,160,89,0.08); color: #B8904A; }
.filetype-badge.filetype-vid { background: #fdf0e3; color: #b05c00; }
.filetype-badge.filetype-aud { background: #f3ecf9; color: #5a6b78; }

/* ================================================================
   VIDEO / AUDIO PREVIEW – row thumbnail + player
   ================================================================ */

/* FILE TYPE BADGES for video/audio */
.file-icon.video { background: #fdf0e3; color: #b05c00; }
.file-icon.audio { background: #f3ecf9; color: #5a6b78; }

/* ── Row preview: video thumbnail wrap ── */
.row-preview-video-wrap {
  position: relative;
  width: 100%;
  max-width: 31.5rem;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #1A2B3C;
  cursor: pointer;
}

/* Video element fills the wrap */
.row-preview-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #1A2B3C;
  border-radius: var(--radius-sm);
}

/* Play-button overlay (shown before user clicks) */
.row-preview-video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 28, 42, 0.38);
  border-radius: var(--radius-sm);
  pointer-events: none;
  transition: background 140ms ease;
}

.row-preview-video-wrap:hover .row-preview-video-overlay {
  background: rgba(10, 28, 42, 0.52);
}

.row-preview-play-icon {
  width: 3.2rem;
  height: 3.2rem;
  color: rgba(255, 255, 255, 0.88);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
  transition: transform 140ms ease, color 140ms ease;
}

.row-preview-video-wrap:hover .row-preview-play-icon {
  transform: scale(1.1);
  color: #ffffff;
}

/* Audio player inline */
.row-preview-audio {
  width: 100%;
  max-width: 31.5rem;
  display: block;
  margin: 0.5rem 0;
  border-radius: var(--radius-sm);
  accent-color: var(--accent);
}

/* ── Full-screen modal: video player ── */
.preview-modal-video {
  display: block;
  width: 100%;
  max-width: calc(95vw - 2.5rem);
  max-height: calc(93vh - 7rem);
  object-fit: contain;
  background: #1A2B3C;
  border-radius: 4px;
}

/* ── Full-screen modal: audio player ── */
.preview-modal-audio-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: 2.5rem 2rem;
  min-height: 14rem;
}

.preview-modal-audio {
  width: 100%;
  max-width: 32rem;
  accent-color: var(--accent);
}

.preview-modal-audio-name {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
  font-weight: 600;
  text-align: center;
}

/* ── Analysis panel note for video/audio files ── */
.analysis-media-note {
  margin: 0.5rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: #f5f8fa;
  border: 1px dashed #cdd9e1;
  font-size: 0.79rem;
  color: var(--ink-muted);
  font-style: italic;
  line-height: 1.45;
}

/* ================================================================
   FILTER SECTION + TABLE – seamless visual module
   The filter-section loses its bottom radius / border so the table
   directly below reads as one unified block.
   ================================================================ */
.files-card .filter-section {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: none;
  margin-bottom: 0;
}

/* Thin connector line between filter-section and table header */
.files-card table {
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-top: none;
  margin-top: 0;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.files-card table thead th {
  border-top: none;
  background: #1A2B3C;
  color: #FFFFFF;
}

/* ================================================================
   STAT CARDS GRID – strict equal-width 3-column layout
   All 3 cards (Files, Benachteiligte Person, Gegenpartei) must
   have identical width, height, border and colour.
   ================================================================ */
.analysis-report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: stretch;     /* ← equal height */
}

/* Force all 3 stat cards to the same neutral base style */
.analysis-report-grid > .analysis-report-card {
  border: 1.5px solid #d9e7ec !important;
  background: rgba(255, 255, 255, 0.9) !important;
  border-radius: 14px !important;
  padding: 0.85rem 0.9rem !important;
  box-shadow: 0 2px 8px rgba(15,43,54,0.06) !important;
}

/* ================================================================
   NEGATIVE NUMBERS – unified modern red everywhere
   ================================================================ */
.party-split-item.is-negative .party-split-num,
.qa-stat.is-negative .qa-stat-num,
.analysis-report-card.is-negative .analysis-report-card-value,
.analysis-report-meta-card.is-negative .analysis-report-meta-value {
  color: #dc2626 !important;
}

/* ================================================================
   PDF EXPORT – hide per-row action buttons inside #analysisReportBar
   Extends existing @media print and body.printing rules.
   ================================================================ */
@media print {
  .btn-inline,
  .row-actions,
  .analysis-cell-top,
  .upload-hero-wrap { display: none !important; }

  /* Prevent stat cards from overflowing in PDF */
  .analysis-report-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
  }
}

body.printing .btn-inline,
body.printing .row-actions,
body.printing .analysis-cell-top,
body.printing .upload-hero-wrap { display: none !important; }

/* ================================================================
   DOC-ID COLUMN – now shows per-tactic file numbers at dossier level
   ================================================================ */
#analysisReportTactics .tactic-table thead tr,
#analysisReportTactics .tactic-table tbody tr {
  grid-template-columns: 22% 28% 50% !important;
}

/* ================================================================
   MASTER-SCAN KI — Premium "Bugatti" Section
   ================================================================ */
.forensic-section.forensic-section--premium {
  position: relative;
  overflow: hidden;
  margin: 1.5rem 0 0;
  padding: 1.5rem 1.8rem;
  border-radius: var(--radius-lg);
  /* Hell wie alle anderen Karten (kein dunkler Hintergrund mehr, kein shine/glow). */
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(245,246,248,0.85));
  border: 1px solid rgba(26,43,60,0.10);
  box-shadow: none;
  isolation: isolate;
}

.forensic-section--premium .ms-shine,
.forensic-section--premium .ms-glow {
  display: none;
}

.forensic-section--premium .forensic-progress,
.forensic-section--premium .forensic-results {
  position: relative;
  z-index: 2;
}

.ms-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.ms-header-text {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

/* Badge — gold ring with number */
.ms-badge {
  position: relative;
  width: 3.2rem;
  height: 3.2rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ms-badge-num {
  position: relative;
  z-index: 2;
  font-family: "JetBrains Mono", "SF Mono", Menlo, monospace;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #c5a059;
}
.ms-badge-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(197,160,89,0.5);
}
.ms-badge::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: rgba(26,43,60,0.04);
}

/* Title block */
.ms-title-block {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}
.ms-kicker {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(197,160,89,0.82);
}
.ms-title {
  margin: 0;
  font-family: "IBM Plex Serif", Georgia, serif;
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--navy);
  line-height: 1.1;
}

.ms-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
/* Master-Scan: Button-Reihe + Tarif-Zeile direkt darunter (rechts unter dem Button,
   nicht links unter der Kartennummer). Compound-Selektor schlägt .forensic-header-actions. */
.forensic-header-actions.ms-actions {
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}
.ms-actions-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.forensic-header-actions.ms-actions .ki-scan-rate { text-align: right; margin-top: 0; }
/* Section 9: Tarif-Zeile direkt unter dem "Files hochladen"-Button */
.fp-upload-col { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; }

/* Files-Pagination (Section 9) */
.files-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.1rem 0 0.25rem;
  flex-wrap: wrap;
}
.files-pagination.hidden { display: none; }
.files-page-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 1.05rem;
  border-radius: var(--radius-md, 8px);
  border: 1px solid rgba(26,43,60,0.18);
  background: #fff;
  color: var(--navy, #1A2B3C);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.files-page-btn:hover:not(:disabled) { background: rgba(197,160,89,0.1); border-color: var(--gold, #C5A059); }
.files-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.files-page-btn--all { border-color: rgba(197,160,89,0.6); color: #B8904A; }
.files-page-btn--all:hover:not(:disabled) { background: rgba(197,160,89,0.14); border-color: var(--gold, #C5A059); }
.files-page-info { font-size: 0.84rem; color: rgba(26,43,60,0.7); font-variant-numeric: tabular-nums; }

/* ── Ansicht-Reiter pro Fall: KI-Analyse / Files ── */
/* ── Teammitglieder im Fall-Kopf (ohne Nummer, auf beiden Reitern) ── */
.case-team {
  margin: 0 0 1.25rem;
  padding: 1rem 1.25rem 1.1rem;
  background: #fff;
  border: 1px solid rgba(26,43,60,0.10);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15,30,43,0.04);
}
.case-team-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.75rem;
  flex-wrap: wrap;
}
.case-team-title {
  margin: 0;
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy, #1A2B3C);
  letter-spacing: -0.01em;
}

.case-view-tabs {
  display: flex;
  gap: 0.4rem;
  margin: 0 0 1.5rem;
  padding: 0.4rem;
  background: rgba(26,43,60,0.06);
  border: 1px solid rgba(26,43,60,0.08);
  border-radius: 16px;
  flex-wrap: wrap;
}
.case-view-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex: 1 1 0;
  padding: 0.95rem 1.8rem;
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 1.06rem;
  font-weight: 600;
  color: rgba(26,43,60,0.55);
  text-decoration: none;
  border-radius: 12px;
  transition: color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.case-view-tab svg {
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
}
.case-view-tab:hover { color: var(--navy, #1A2B3C); }
.case-view-tab.is-active {
  color: #fff;
  background: var(--navy, #1A2B3C);
  box-shadow: 0 2px 8px rgba(26,43,60,0.18);
}
.case-view-tab.is-active svg { stroke: var(--gold, #C5A059); }

/* ── Leerer Fall: grosser "Files hochladen"-CTA in der Files-Tabelle ── */
.files-empty-cell { padding: 0 !important; border: none !important; background: none !important; }
.files-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 3rem 1.5rem 3.2rem;
}
.files-empty-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold, #C5A059);
  background: rgba(197,160,89,0.1);
  border: 1px solid rgba(197,160,89,0.28);
  border-radius: 18px;
  margin-bottom: 0.4rem;
}
.files-empty-icon svg { width: 36px; height: 36px; }
.files-empty-title {
  margin: 0;
  font-family: "IBM Plex Serif", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--navy, #1A2B3C);
}
.files-empty-text {
  margin: 0;
  max-width: 30rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(26,43,60,0.6);
}
.files-empty-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.9rem;
  padding: 0.9rem 1.9rem;
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  color: #fff;
  background: var(--navy, #1A2B3C);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(26,43,60,0.22);
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.files-empty-btn svg { width: 1.25rem; height: 1.25rem; stroke: var(--gold, #C5A059); }
.files-empty-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26,43,60,0.3);
  background: var(--navy-2, #243447);
}
.files-empty-rate {
  margin: 0.7rem 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(26,43,60,0.5);
}

/* ── Master-Scan Lauf-Fenster (Modal mit Loader + Abbrechen) ── */
.scan-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15,30,43,0.72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.scan-modal.hidden { display: none; }
.scan-modal-card {
  background: #fff;
  border-radius: 16px;
  padding: 2.4rem 2.6rem;
  text-align: center;
  width: 360px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(15,30,43,0.4);
}
.scan-modal-loader {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scan-modal-loader .dmski-pulse-ring {
  position: absolute;
  inset: 0;
  border: 3px solid rgba(197,160,89,0.5);
  border-radius: 50%;
  animation: scanPulse 1.6s ease-out infinite;
}
.scan-modal-logo { width: 52px; height: auto; position: relative; z-index: 2; }
@keyframes scanPulse {
  0% { transform: scale(0.8); opacity: 0.9; }
  70%, 100% { transform: scale(1.3); opacity: 0; }
}
.scan-modal-title {
  margin: 0 0 0.4rem;
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy, #1A2B3C);
}
.scan-modal-progress {
  margin: 0 0 1.5rem;
  font-size: 0.88rem;
  color: rgba(26,43,60,0.6);
  line-height: 1.5;
  min-height: 1.3rem;
}

/* Launch button — flat gold */
.ms-launch-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1.5rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #C5A059, #B8904A);
  color: var(--navy);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  overflow: hidden;
  transition: all 200ms ease;
  box-shadow: 0 4px 16px rgba(197,160,89,0.25);
}
.ms-launch-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(197,160,89,0.3);
}
.ms-launch-btn:active { transform: translateY(0); }
.ms-launch-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.ms-launch-icon {
  display: inline-flex;
  width: 1.05rem;
  height: 1.05rem;
  color: var(--navy);
  filter: drop-shadow(0 1px 0 rgba(255,255,255,0.3));
}
.ms-launch-icon svg { width: 100%; height: 100%; }
.ms-launch-label {
  position: relative;
  z-index: 1;
}
.ms-launch-sheen { display: none; }

/* Cancel button variant inside premium */
.forensic-section--premium .ki-action-btn--cancel {
  background: rgba(192,57,43,0.08);
  border: 1px solid rgba(192,57,43,0.35);
  color: #C0392B;
}
.forensic-section--premium .ki-action-btn--cancel:hover {
  background: rgba(192,57,43,0.15);
}

/* Progress bar (helle Karte) */
.forensic-section--premium .forensic-progress-bar {
  background: rgba(26,43,60,0.08);
  border: 1px solid rgba(197,160,89,0.25);
}
.forensic-section--premium .forensic-progress-fill {
  background: var(--gold);
}
.forensic-section--premium .forensic-progress-text {
  color: rgba(26,43,60,0.7);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}

.forensic-section--premium .forensic-results {
  margin-top: 1.4rem;
  padding: 1.3rem 1.4rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(26,43,60,0.08);
}

/* Mobile tweaks */
@media (max-width: 640px) {
  .forensic-section--premium {
    padding: 1.4rem 1.3rem 1.3rem;
  }
  .ms-title { font-size: 1.3rem; }
  .ms-badge { width: 2.6rem; height: 2.6rem; }
  .ms-badge-num { font-size: 0.85rem; }
  .ms-launch-btn {
    padding: 0.82rem 1.25rem;
    font-size: 0.76rem;
    width: 100%;
    justify-content: center;
  }
  .ms-actions { width: 100%; }
}

/* ================================================================
   KI-SCAN BUTTON (unified for File, Personen, all KI actions)
   ================================================================ */
/* Unified dominant KI-Aktion-Button — gleicher Stil fuer File / Personen / Master-Scan.
   Gold-Gradient + Navy-Icon/Text: funktioniert auf hellem BG und auf der dunklen Master-Scan-Sektion. */
.ki-scan-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.82rem 1.5rem;
  width: 21rem;
  max-width: 100%;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #C5A059, #B8904A);
  color: #1A2B3C;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 200ms ease;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(197,160,89,0.32);
}
.ki-scan-btn:hover {
  background: linear-gradient(135deg, #d4af6a, #C5A059);
  box-shadow: 0 8px 26px rgba(197,160,89,0.45);
  transform: translateY(-1px);
}
.ki-scan-btn:active { transform: translateY(0); }
.ki-scan-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.ki-scan-btn.is-loading {
  pointer-events: none;
  opacity: 0.7;
}
.ki-scan-btn svg {
  width: 1.2rem;
  height: 1.2rem;
  flex-shrink: 0;
  stroke: #1A2B3C;
}
.ki-btn-spin { animation: spin 800ms linear infinite; }
.ki-scan-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.2rem;
}
.ki-scan-cost {
  display: inline-flex;
  padding: 0.16rem 0.6rem;
  border-radius: 99px;
  background: rgba(26,43,60,0.92);
  color: #C5A059;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.ki-scan-bal {
  /* Guthaben ("X verfügbar") ausgeblendet — steht bereits in der Sidebar */
  display: none;
}
.ki-scan-cost:empty,
.ki-scan-bal:empty { display: none; }
.ki-scan-rate {
  margin-top: 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(26,43,60,0.5);
  letter-spacing: 0.01em;
}
.ki-scan-rate:empty { display: none; }
.forensic-section--premium .ki-scan-rate { color: rgba(26,43,60,0.5); }

/* ── Page Hero Credits Badge ── */
.page-hero-credits {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  margin-left: auto;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  background: rgba(197,160,89,0.1);
  border: 1px solid rgba(197,160,89,0.3);
  text-decoration: none;
  transition: all 200ms ease;
  flex-shrink: 0;
}
.page-hero-credits:hover {
  background: rgba(197,160,89,0.18);
  border-color: rgba(197,160,89,0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(197,160,89,0.15);
}
.page-hero-credits-num {
  font-size: 1.2rem;
  font-weight: 800;
  color: #C5A059;
  line-height: 1;
}
.page-hero-credits-label {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
  line-height: 1;
}

@media (max-width: 640px) {
  .page-hero-credits { padding: 0.4rem 0.7rem; }
  .page-hero-credits-num { font-size: 1rem; }
}

/* ── Master-Scan credit meta (same pattern as ki-scan-meta) ── */
.ms-launch-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.25rem;
  position: relative;
  z-index: 1;
}
.ms-launch-meta:empty { display: none; }
.ms-launch-meta .ki-scan-cost {
  background: rgba(26,43,60,0.4);
  color: var(--gold);
}
.ms-launch-meta .ki-scan-bal {
  background: rgba(26,43,60,0.25);
  color: rgba(26,43,60,0.6);
}


/* ── Credit insufficient overlay in modals ── */
.credit-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  background: rgba(26,43,60,0.06);
  border: 1px solid rgba(26,43,60,0.12);
  font-size: 0.85rem;
}
.credit-info-row.is-insufficient {
  border-color: rgba(220,38,38,0.25);
  background: rgba(220,38,38,0.05);
}
.credit-info-needed { font-weight: 700; color: #1A2B3C; }
.credit-info-row.is-insufficient .credit-info-needed { color: #dc2626; }
.credit-info-available { color: rgba(26,43,60,0.5); font-size: 0.8rem; font-weight: 600; }
@media (max-width: 640px) {
  .credit-info-row { flex-direction: column; align-items: stretch; gap: 0.5rem; }
}

/* ================================================================
   FORENSIC SCAN SECTION
   ================================================================ */
.forensic-section {
  margin: 1.5rem 0 0;
  padding: 1.5rem 1.8rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(26,43,60,0.10);
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(245,246,248,0.85));
}

.forensic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem; /* Luft zwischen Header (Badge/Titel) und Karteninhalt */
}

/* Section badge (number circle) */
/* ── Einheitliche Karten-Header (alle Karten exakt wie Karte 8/9) ── */
/* Grosser Gold-Ring-Badge */
.forensic-section-badge,
.tactic-section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  background: rgba(197,160,89,0.06);
  border: 2px solid rgba(197,160,89,0.5);
  color: #C5A059;
  font-family: "JetBrains Mono", "SF Mono", Menlo, monospace;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  margin-top: 0;
}
/* Grosser Serif-Titel (= ms-title) */
.forensic-title,
.tactic-section-title {
  margin: 0;
  font-family: "IBM Plex Serif", Georgia, serif;
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--navy);
  line-height: 1.1;
}
/* Kleiner goldener Kicker oben (= ms-kicker) */
.section-kicker {
  margin: 0 0 0.12rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(197,160,89,0.82);
}
.forensic-title-block { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.forensic-header-text { align-items: center; gap: 1.1rem; }
.tactic-section { gap: 1.1rem; }
/* Meta-Zusatz im Titel klein halten (nicht im Serif-Grossformat) */
.tactic-section-title .tactic-section-meta {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0;
  color: rgba(26,43,60,0.55);
}

.forensic-header-text {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.forensic-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.forensic-eyebrow {
  display: none;
}

.forensic-title {
  margin: 0;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
}

.forensic-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: rgba(26,43,60,0.55);
}

.forensic-scan-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 2rem;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, var(--navy), #243447);
  color: #F8F9FA;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 4px 16px rgba(26,43,60,0.25);
  flex-shrink: 0;
}

.forensic-scan-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(26,43,60,0.35);
}

.forensic-scan-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  background: #6b7a8a;
}

.forensic-cancel-btn {
  padding: 0.55rem 1.2rem;
  border: 1px solid rgba(192,57,43,0.3);
  border-radius: var(--radius-md);
  background: transparent;
  color: #c0392b;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 120ms ease;
  margin-top: 0.5rem;
}

.forensic-cancel-btn:hover {
  background: rgba(192,57,43,0.08);
  border-color: #c0392b;
}

.forensic-scan-btn svg {
  width: 1.3rem;
  height: 1.3rem;
  stroke: var(--gold);
}

/* Progress */
.forensic-progress {
  margin-top: 1.2rem;
}

.forensic-progress-bar {
  height: 6px;
  background: rgba(26,43,60,0.08);
  border-radius: 3px;
  overflow: hidden;
}

.forensic-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  border-radius: 3px;
  transition: width 300ms ease;
}

.forensic-progress-text {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: rgba(26,43,60,0.6);
}

/* Results */
.forensic-results {
  margin-top: 1.5rem;
}

.forensic-score-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.forensic-score-card {
  flex: 1;
  min-width: 10rem;
  padding: 1rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(26,43,60,0.1);
  background: #f8f9fa;
  text-align: center;
}

.forensic-score-card-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(26,43,60,0.5);
  margin-bottom: 0.35rem;
}

.forensic-score-card-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  color: var(--navy);
}

.forensic-score-card-value.is-kritisch { color: #c0392b; }
.forensic-score-card-value.is-hoch { color: #B8904A; }
.forensic-score-card-value.is-mittel { color: #b8904a; }
.forensic-score-card-value.is-niedrig { color: var(--emerald); }

.forensic-risk-badge {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.forensic-risk-badge.is-kritisch { background: rgba(192,57,43,0.12); color: #c0392b; border: 1px solid rgba(192,57,43,0.3); }
.forensic-risk-badge.is-hoch { background: rgba(211,84,0,0.1); color: #B8904A; border: 1px solid rgba(211,84,0,0.25); }
.forensic-risk-badge.is-mittel { background: rgba(184,144,74,0.1); color: #96700a; border: 1px solid rgba(184,144,74,0.25); }
.forensic-risk-badge.is-niedrig { background: rgba(22,101,52,0.08); color: var(--emerald); border: 1px solid rgba(22,101,52,0.2); }

.forensic-fazit {
  margin: 1rem 0;
  padding: 1rem 1.2rem;
  border-left: 3px solid var(--gold);
  background: rgba(197,160,89,0.05);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--navy);
}

/* ── Gesamtfall-Analyse Box ── */
.forensic-gesamtfall {
  margin: 1.8rem 0 0.5rem;
  padding: 1.4rem 1.6rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(26,43,60,0.12);
  background: linear-gradient(135deg, rgba(255,255,255,0.97), rgba(248,249,252,0.95));
}

.forensic-gesamtfall.is-critical {
  border: 2px solid rgba(192,57,43,0.35);
  background: linear-gradient(135deg, rgba(255,250,248,0.98), rgba(255,243,240,0.95));
  box-shadow: 0 2px 16px rgba(192,57,43,0.08);
}

.forensic-gesamtfall-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(26,43,60,0.08);
}

.forensic-gesamtfall.is-critical .forensic-gesamtfall-header {
  border-bottom-color: rgba(192,57,43,0.15);
}

.forensic-gesamtfall-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.forensic-gesamtfall-title {
  margin: 0;
  font-family: "IBM Plex Serif", serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy);
}

.forensic-gesamtfall.is-critical .forensic-gesamtfall-title {
  color: #8b1a0f;
}

.forensic-gesamtfall-subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(26,43,60,0.45);
}

.forensic-gesamtfall.is-critical .forensic-gesamtfall-subtitle {
  color: rgba(192,57,43,0.55);
}

.forensic-gesamtfall-body {
  font-size: 0.84rem;
  line-height: 1.7;
  color: #1a2b3c;
  white-space: pre-line;
}
.forensic-gesamtfall-para {
  margin: 0 0 0.8rem;
  white-space: normal;
}
.forensic-gesamtfall-para:last-child { margin-bottom: 0; }

.forensic-gesamtfall.is-critical .forensic-gesamtfall-body {
  color: #3a1010;
}

.forensic-gesamtfall-disclaimer {
  margin: 1rem 0 0;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(26,43,60,0.06);
  font-size: 0.62rem;
  font-style: italic;
  color: rgba(26,43,60,0.35);
}

/* ── Anwalts-Match (Rechtsgebiete-Verteilung) ── */
.law-match .forensic-gesamtfall-icon { font-size: 1.3rem; }
.lm-chart-row {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}
.lm-donut {
  width: 150px;
  height: 150px;
  flex-shrink: 0;
}
/* Anwalts-Match Feature-Karte (Karte 9): grosser, zentraler Donut */
.law-match-feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
.lmf-donut-wrap { display: flex; justify-content: center; width: 100%; overflow: visible; }
.lm-donut--big { width: min(500px, 96vw); height: auto; overflow: visible; }
.lm-leader { font: 600 1.9px "Inter", system-ui, sans-serif; fill: #243447; }
.lmf-legend { width: 100%; max-width: 680px; }
.law-match-feature .lm-empfehlung,
.law-match-feature .forensic-gesamtfall-disclaimer { width: 100%; max-width: 680px; }
.lmf-empty {
  text-align: center;
  color: rgba(26,43,60,0.55);
  font-size: 0.9rem;
  line-height: 1.6;
  padding: 1.4rem 1rem;
  margin: 0;
}
.lmf-loading {
  text-align: center;
  color: var(--navy, #1A2B3C);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 2.2rem 1rem;
}

/* ── Live-Loader für KI-Karten: forensischer Scan + Phasen + echte mm:ss-Uhr ── */
.dl-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.15rem;
  flex-wrap: wrap;
  padding: 2rem 1rem;
}
.dl-doc {
  position: relative;
  width: 48px;
  height: 56px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 5px;
}
.dl-doc-svg { display: block; width: 48px; height: 56px; }
.dl-scan {
  position: absolute;
  left: 4px; right: 4px; top: 3px;
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(180deg, transparent, rgba(197,160,89,0.55), transparent);
  animation: dlScan 1.9s cubic-bezier(.5,0,.5,1) infinite;
}
.dl-info { min-width: 200px; max-width: 320px; text-align: left; }
.dl-label { font-size: 0.95rem; font-weight: 700; color: var(--navy, #1A2B3C); margin-bottom: 0.2rem; }
.dl-phase {
  font-size: 0.82rem;
  font-weight: 600;
  color: #9a7530;
  min-height: 1.15em;
  margin-bottom: 0.55rem;
  transition: opacity 0.22s ease;
}
.dl-track {
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(26,43,60,0.08);
  margin-bottom: 0.5rem;
}
.dl-fill {
  display: block;
  height: 100%;
  width: 38%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold, #C5A059), var(--gold-2, #B8904A));
  animation: dlSlide 1.4s ease-in-out infinite;
}
.dl-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--ink-muted, #8899AA);
}
.dl-clock { width: 0.9rem; height: 0.9rem; color: var(--gold, #C5A059); flex-shrink: 0; }
.dl-timer { color: var(--navy, #1A2B3C); font-weight: 600; }
.dl-sep { opacity: 0.5; }
@keyframes dlScan {
  0% { transform: translateY(0); opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { transform: translateY(43px); opacity: 0; }
}
@keyframes dlSlide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
@media (prefers-reduced-motion: reduce) {
  .dl-scan, .dl-fill { animation: none; }
  .dl-fill { width: 100%; opacity: 0.5; }
}
.lm-donut-pct {
  font: 700 7px/1 "Poppins", sans-serif;
  fill: var(--navy);
  text-anchor: middle;
}
.lm-donut-lbl {
  font: 600 2.7px/1 "Inter", sans-serif;
  fill: rgba(26,43,60,0.5);
  text-anchor: middle;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── Karte 5: Vergleichsfälle (OpenCaseLaw) ── */
.caselaw-feature { display: flex; flex-direction: column; gap: 1rem; }

/* ═══ Karte 6: Fristen-Radar ═══ */
.frist-feature { display:flex; flex-direction:column; gap:1rem; }
.frist-list { display:flex; flex-direction:column; gap:0.7rem; }
.frist-row { border:1px solid rgba(26,43,60,0.1); border-left-width:3px; border-radius:10px; padding:0.8rem 1rem; background:#fff; }
.frist-row.frist-kritisch { border-left-color:#C0392B; }
.frist-row.frist-bald { border-left-color:#C5A059; }
.frist-row.frist-info { border-left-color:#8899AA; }
.frist-row-top { display:flex; align-items:center; gap:0.55rem; flex-wrap:wrap; margin-bottom:0.4rem; }
.frist-badge { font-size:0.64rem; font-weight:700; text-transform:uppercase; letter-spacing:0.04em; padding:0.18rem 0.5rem; border-radius:999px; }
.frist-badge-kritisch { background:rgba(192,57,43,0.12); color:#C0392B; }
.frist-badge-bald { background:rgba(197,160,89,0.18); color:#9a7530; }
.frist-badge-info { background:rgba(26,43,60,0.08); color:#4A5568; }
.frist-event { font-weight:700; color:#1A2B3C; font-size:0.95rem; }
.frist-date { color:#8899AA; font-size:0.82rem; }
.frist-meta { display:flex; flex-wrap:wrap; gap:0.5rem 0.9rem; align-items:center; font-size:0.86rem; color:#4A5568; }
.frist-rg { font-family:"JetBrains Mono",monospace; font-size:0.78rem; color:#9a7530; background:rgba(197,160,89,0.1); padding:0.1rem 0.4rem; border-radius:5px; }
.frist-ablauf { color:#1A2B3C; }
.frist-hint { margin:0.5rem 0 0; font-size:0.86rem; color:#4A5568; line-height:1.5; }
.frist-src { display:block; margin-top:0.35rem; font-size:0.74rem; color:#8899AA; }

/* ═══ Karte 7: Beweis-Matrix ═══ */
.bm-feature { display:flex; flex-direction:column; gap:1rem; }
.bm-list { display:flex; flex-direction:column; gap:0.8rem; }
.bm-card { border:1px solid rgba(26,43,60,0.1); border-radius:10px; padding:0.9rem 1rem; background:#fff; }
.bm-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:0.6rem; margin-bottom:0.3rem; }
.bm-claim { font-weight:700; color:#1A2B3C; font-size:0.95rem; line-height:1.4; }
.bm-strength { flex-shrink:0; font-size:0.64rem; font-weight:700; text-transform:uppercase; letter-spacing:0.04em; padding:0.18rem 0.5rem; border-radius:999px; }
.bm-strength-stark { background:rgba(197,160,89,0.18); color:#9a7530; }
.bm-strength-mittel { background:rgba(26,43,60,0.1); color:#243447; }
.bm-strength-schwach { background:rgba(192,57,43,0.1); color:#C0392B; }
.bm-strength-offen { background:rgba(136,153,170,0.15); color:#5a6b7a; }
.bm-party { font-size:0.8rem; color:#8899AA; margin-bottom:0.55rem; }
.bm-cols { display:grid; grid-template-columns:1fr 1fr; gap:0.7rem; }
@media (max-width:640px){ .bm-cols { grid-template-columns:1fr; } }
.bm-col { border-radius:8px; padding:0.6rem 0.7rem; }
.bm-pro { background:rgba(197,160,89,0.07); }
.bm-con { background:rgba(192,57,43,0.05); }
.bm-col-label { display:block; font-size:0.68rem; font-weight:700; text-transform:uppercase; letter-spacing:0.05em; margin-bottom:0.35rem; }
.bm-pro .bm-col-label { color:#9a7530; }
.bm-con .bm-col-label { color:#C0392B; }
.bm-col ul { margin:0; padding-left:1rem; }
.bm-col li { font-size:0.85rem; color:#243447; line-height:1.45; margin-bottom:0.25rem; }
.bm-col li.bm-none { list-style:none; margin-left:-1rem; color:#8899AA; }
.bm-src { color:#8899AA; font-size:0.74rem; }
.bm-burden, .bm-gap { margin:0.55rem 0 0; font-size:0.85rem; color:#4A5568; line-height:1.5; }
.bm-gap { color:#C0392B; }

/* ═══ Karte 8: Hilfe-Radar ═══ */
.help-feature { display:flex; flex-direction:column; gap:1rem; }
.help-list { display:flex; flex-direction:column; gap:0.7rem; }
.help-card { border:1px solid rgba(26,43,60,0.1); border-left:3px solid #C5A059; border-radius:10px; padding:0.85rem 1rem; background:#fff; }
.help-card-head { display:flex; align-items:center; justify-content:space-between; gap:0.6rem; flex-wrap:wrap; margin-bottom:0.3rem; }
.help-name { font-weight:700; color:#1A2B3C; font-size:0.95rem; }
.help-persp { font-size:0.66rem; font-weight:700; text-transform:uppercase; letter-spacing:0.03em; color:#9a7530; background:rgba(197,160,89,0.12); padding:0.16rem 0.5rem; border-radius:999px; }
.help-why { margin:0 0 0.35rem; font-size:0.88rem; color:#243447; line-height:1.5; font-weight:600; }
.help-kurz { margin:0; font-size:0.85rem; color:#4A5568; line-height:1.5; }
.help-foot { display:flex; align-items:center; gap:0.9rem; flex-wrap:wrap; margin-top:0.5rem; }
.help-tel { font-weight:700; color:#1A2B3C; font-size:0.85rem; }
.help-link { color:#B8904A; font-weight:600; font-size:0.83rem; text-decoration:none; }
.help-link:hover { text-decoration:underline; }
.cl-frage { background: rgba(26,43,60,0.04); border-left: 3px solid #C5A059; border-radius: 8px; padding: 0.7rem 1rem; }
.cl-frage-label { display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #B8904A; margin-bottom: 0.2rem; }
.cl-frage p { margin: 0; font-size: 0.92rem; color: #1A2B3C; line-height: 1.5; }
.cl-tendenz { background: linear-gradient(135deg, #1A2B3C, #0F1E2B); border-radius: 12px; padding: 1.1rem 1.3rem; color: #fff; }
.cl-tendenz-stats { display: flex; gap: 1.6rem; margin-bottom: 0.7rem; }
.cl-stat { display: flex; flex-direction: column; line-height: 1.1; }
.cl-stat b { font-family: "Poppins", sans-serif; font-size: 1.55rem; font-weight: 700; }
.cl-stat span { font-size: 0.7rem; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.1rem; }
.cl-stat--pos b { color: #C5A059; }
.cl-stat--mid b { color: #cbd5da; }
.cl-stat--neg b { color: #e8897e; }
.cl-tendenz-head { margin: 0; font-size: 0.95rem; line-height: 1.55; color: rgba(255,255,255,0.92); }
.cl-tendenz-head strong { color: #C5A059; }
.cl-cases { display: flex; flex-direction: column; gap: 0.8rem; }
.cl-case { border: 1px solid rgba(26,43,60,0.1); border-radius: 10px; padding: 0.85rem 1rem; background: #fff; }
.cl-case-head { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; margin-bottom: 0.45rem; }
.cl-aus { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.2rem 0.55rem; border-radius: 999px; }
.cl-aus--gutgeheissen { background: rgba(197,160,89,0.16); color: #9a7530; }
.cl-aus--teilweise { background: rgba(26,43,60,0.1); color: #243447; }
.cl-aus--abgewiesen { background: rgba(192,57,43,0.1); color: #C0392B; }
.cl-aus--unklar { background: rgba(26,43,60,0.06); color: rgba(26,43,60,0.5); }
.cl-court { font-size: 0.82rem; font-weight: 600; color: #1A2B3C; }
.cl-leit { font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #B8904A; background: rgba(197,160,89,0.1); padding: 0.15rem 0.45rem; border-radius: 6px; }
.cl-rel { margin-left: auto; font-size: 0.72rem; color: rgba(26,43,60,0.45); font-weight: 600; }
.cl-kern { margin: 0 0 0.4rem; font-size: 0.88rem; line-height: 1.5; color: #1A2B3C; }
.cl-regeste { margin: 0 0 0.5rem; font-size: 0.8rem; line-height: 1.45; color: rgba(26,43,60,0.6); font-style: italic; }
.cl-case-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; border-top: 1px solid rgba(26,43,60,0.06); padding-top: 0.5rem; }
.cl-cite { font-size: 0.74rem; color: rgba(26,43,60,0.5); font-family: "IBM Plex Serif", serif; }
.cl-link { font-size: 0.78rem; font-weight: 600; color: #B8904A; text-decoration: none; white-space: nowrap; }
.cl-link:hover { text-decoration: underline; }
.lm-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 260px;
  min-width: 240px;
}
.lm-legend-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 0.35rem 0.6rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(26,43,60,0.06);
}
.lm-legend-item:last-child { border-bottom: none; }
.lm-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  align-self: center;
}
.lm-legend-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--navy);
}
.lm-legend-pct {
  font-family: "Poppins", sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  color: #B8904A;
}
.lm-legend-note {
  grid-column: 2 / 4;
  font-size: 0.72rem;
  line-height: 1.5;
  color: rgba(26,43,60,0.6);
}
.lm-empfehlung {
  margin-top: 0.4rem;
  padding: 1rem 1.2rem;
  background: rgba(197,160,89,0.07);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.lm-empfehlung-strat {
  margin: 0 0 0.35rem;
  font-family: "Poppins", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy);
}
.lm-empfehlung-text {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.65;
  color: #1a2b3c;
}
.lm-profiles {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.6rem;
}
.lm-profile {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.7rem 0.8rem;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(26,43,60,0.1);
  border-radius: var(--radius-md);
}
.lm-profile-icon {
  font-size: 1rem;
  line-height: 1.3;
  color: var(--gold);
  flex-shrink: 0;
}
.lm-profile-schwerpunkt {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--navy);
}
.lm-profile-zusatz {
  font-weight: 500;
  color: rgba(26,43,60,0.6);
}
.lm-profile-rolle {
  margin: 0.2rem 0 0;
  font-size: 0.76rem;
  line-height: 1.5;
  color: rgba(26,43,60,0.7);
}
@media (max-width: 560px) {
  .lm-donut { width: 120px; height: 120px; }
  .lm-chart-row { gap: 1rem; justify-content: center; }
}

/* Contradiction cards */
.forensic-contradictions-title,
.forensic-patterns-title,
.forensic-findings-title {
  margin: 1.5rem 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
}

.forensic-contradiction {
  margin-bottom: 1rem;
  border: 1px solid rgba(192,57,43,0.15);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.forensic-contradiction-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: rgba(192,57,43,0.04);
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(26,43,60,0.7);
}

.forensic-contradiction-body {
  padding: 0.8rem 1rem;
}

.forensic-contradiction-docs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: start;
}

.forensic-contradiction-doc {
  padding: 0.6rem 0.8rem;
  background: #f8f9fa;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  line-height: 1.5;
}

.forensic-contradiction-doc-name {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  color: rgba(26,43,60,0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}

.forensic-contradiction-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #c0392b;
  padding-top: 0.6rem;
}

.forensic-contradiction-analyse {
  margin-top: 0.7rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: rgba(26,43,60,0.75);
}

/* Pattern cards */
.forensic-pattern {
  margin-bottom: 0.75rem;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(26,43,60,0.1);
  border-radius: var(--radius-md);
  background: #fafbfc;
}

.forensic-pattern-type {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-2);
  margin-bottom: 0.3rem;
}

.forensic-pattern-analyse {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--navy);
}

.forensic-pattern-docs {
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: rgba(26,43,60,0.5);
}

/* Offene Vorgänge / fehlende Antworten — Fallprobleme (Error-Akzent #C0392B) */
.forensic-offen-title {
  margin: 1.5rem 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #c0392b;
}
.forensic-offen-intro {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: rgba(26,43,60,0.6);
}
.forensic-offen {
  margin-bottom: 0.75rem;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(192,57,43,0.22);
  border-left: 3px solid #c0392b;
  border-radius: var(--radius-md);
  background: rgba(192,57,43,0.035);
}
.forensic-offen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.forensic-offen-flag {
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #c0392b;
}
.forensic-offen-vorgang {
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--navy);
  margin-bottom: 0.45rem;
}
.forensic-offen-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  font-size: 0.76rem;
  color: rgba(26,43,60,0.7);
  margin-bottom: 0.35rem;
}
.forensic-offen-meta strong { color: rgba(26,43,60,0.55); font-weight: 700; }
.forensic-offen-erwartet {
  font-size: 0.8rem;
  line-height: 1.5;
  color: rgba(26,43,60,0.78);
  margin-bottom: 0.3rem;
}

/* Finding cards */
.forensic-finding {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(26,43,60,0.06);
  align-items: start;
}

.forensic-finding:last-child { border-bottom: none; }

.forensic-finding-type {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(26,43,60,0.06);
  color: rgba(26,43,60,0.6);
  white-space: nowrap;
}

.forensic-finding-content {
  min-width: 0;
}

.forensic-finding-stelle {
  font-size: 0.78rem;
  font-style: italic;
  color: rgba(26,43,60,0.6);
  margin-bottom: 0.2rem;
}

.forensic-finding-analyse {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--navy);
}

/* ══════════════════════════════════════════════
   CREDITS PAGE
   ══════════════════════════════════════════════ */
.credits-page {
  max-width: none;
  margin: 0;
  padding: 0 0 3rem;
}

/* Alert banners */
.credit-alert {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
  font-size: .92rem;
  font-weight: 500;
}
.credit-alert-success {
  background: rgba(52,208,88,.08);
  border: 1px solid rgba(52,208,88,.25);
  color: #B8904A;
}
.credit-alert-warn {
  background: rgba(255,107,107,.08);
  border: 1px solid rgba(255,107,107,.25);
  color: #b33;
}

/* Balance card */
.credit-balance-card {
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  border-radius: 16px;
  padding: 2px;
  margin-bottom: 2.5rem;
}
.credit-balance-inner {
  background: linear-gradient(135deg, var(--navy), var(--navy-3));
  border-radius: 15px;
  padding: 2.5rem 2rem;
  text-align: center;
  border: 1px solid rgba(197,160,89,.15);
}
.credit-balance-label {
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--gold);
  margin-bottom: .5rem;
}
.credit-balance-number {
  font-family: "JetBrains Mono", monospace;
  font-size: 3.5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  margin-bottom: .3rem;
}
.credit-balance-sub {
  font-size: .85rem;
  color: rgba(255,255,255,.5);
}

/* Explainer */
.credit-explainer {
  background: #fff;
  border: 1px solid rgba(26,43,60,.08);
  border-radius: var(--radius-md);
  padding: 2rem;
  margin-bottom: 2.5rem;
}
.credit-explainer h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1rem;
}
.credit-explainer p {
  font-size: .92rem;
  color: rgba(26,43,60,.7);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}
.credit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.credit-table th {
  text-align: left;
  padding: .65rem .8rem;
  background: var(--navy-glass);
  color: var(--navy);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 2px solid rgba(26,43,60,.1);
}
.credit-table td {
  padding: .65rem .8rem;
  border-bottom: 1px solid rgba(26,43,60,.06);
  color: var(--navy);
}
.credit-table tfoot td {
  font-weight: 700;
  border-top: 2px solid var(--gold);
  border-bottom: none;
  color: var(--navy);
}

/* ── Credit-Rechner ──────────────────────────────────────────────────
   Freie Seitenzahl statt fixer Pakete. Drei Zonen: Eingabe links,
   Ergebnis rechts, Kaufknopf darunter. Auf schmalen Schirmen stapeln
   sie in derselben Reihenfolge, damit der Preis direkt unter der Zahl
   steht, die ihn erzeugt. */
.credit-calc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.75rem 2.5rem;
  align-items: start;
  padding: 1.75rem;
  background: var(--navy-glass);
  border: 1px solid rgba(26,43,60,.08);
  border-radius: var(--radius-md);
}
.credit-calc-input label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: .55rem;
}
.credit-calc-field {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 10px);
  padding: .6rem .9rem;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.credit-calc-field:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-light);
}
.credit-calc-field.is-invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px var(--error-light);
}
.credit-calc-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.credit-calc-field input::-webkit-outer-spin-button,
.credit-calc-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.credit-calc-unit {
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink-muted);
}
.credit-calc-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  margin: 1rem 0 .5rem;
  border-radius: 2px;
  background: linear-gradient(to right, var(--gold) 0 var(--fill, 10%), rgba(26,43,60,.14) var(--fill, 10%) 100%);
  cursor: pointer;
}
.credit-calc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--navy);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(26,43,60,.35);
  cursor: grab;
}
.credit-calc-range::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--navy);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(26,43,60,.35);
  cursor: grab;
}
.credit-calc-range:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.credit-calc-hint {
  font-size: .8rem;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.5;
}
.credit-calc-hint.is-error { color: var(--error); }

.credit-calc-out {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  align-content: start;
}
.credit-calc-figure {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding-left: 1rem;
  border-left: 1px solid rgba(26,43,60,.12);
}
.credit-calc-figure-discount { border-left-color: var(--gold-border); }
.credit-calc-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink-muted);
}
.credit-calc-price,
.credit-calc-discount {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.credit-calc-discount { color: var(--gold-2); }
.credit-calc-sub {
  font-size: .82rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.credit-calc-action {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .9rem 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(26,43,60,.08);
}
.credit-calc-btn {
  flex: 0 0 auto;
  padding: .85rem 1.6rem;
  border: 0;
  border-radius: var(--radius-sm, 10px);
  background: var(--gold);
  color: var(--navy-3);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}
.credit-calc-btn:hover { background: var(--gold-2); }
.credit-calc-btn:active { transform: translateY(1px); }
.credit-calc-btn:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }
.credit-calc-btn[disabled] { opacity: .5; cursor: not-allowed; }
.credit-calc-note {
  flex: 1 1 16rem;
  margin: 0;
  font-size: .8rem;
  line-height: 1.55;
  color: var(--ink-muted);
}

.credit-tiers { margin-top: 1.5rem; }
.credit-tiers > summary {
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-soft);
  padding: .4rem 0;
}
.credit-tiers > summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.credit-tiers[open] > summary { margin-bottom: .9rem; }
.credit-tiers .credit-table td { font-variant-numeric: tabular-nums; }
.credit-tiers .credit-explainer-note { margin-top: .9rem; }

@media (max-width: 720px) {
  .credit-calc { grid-template-columns: minmax(0, 1fr); padding: 1.25rem; gap: 1.5rem; }
  .credit-calc-figure { padding-left: .85rem; }
  .credit-calc-price, .credit-calc-discount, .credit-calc-field input { font-size: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .credit-calc-field, .credit-calc-btn { transition: none; }
}

/* Section title */
.credit-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1.5rem;
}

/* Packages grid */
.credit-packages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.credit-pkg {
  position: relative;
  background: #fff;
  border: 1px solid rgba(26,43,60,.1);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all 220ms ease;
  /* Flex, damit die Buttons trotz unterschiedlich hoher Karten
     (Rabatt-Badge nur bei Paketen ab 50 Seiten) auf einer Linie sitzen. */
  display: flex;
  flex-direction: column;
}
.credit-pkg .credit-pkg-btn { margin-top: auto; }
.credit-pkg:hover {
  border-color: rgba(197,160,89,.3);
  box-shadow: 0 8px 32px rgba(0,0,0,.06);
  transform: translateY(-2px);
}
.credit-pkg-popular {
  border-color: var(--gold);
  box-shadow: 0 4px 24px rgba(197,160,89,.12);
}
.credit-pkg-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: var(--navy);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .3rem 1rem;
  border-radius: 100px;
}
.credit-pkg-credits {
  font-family: "JetBrains Mono", monospace;
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}
.credit-pkg-credits-label {
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(26,43,60,.5);
  margin-bottom: .9rem;
}
.credit-pkg-price {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: .2rem;
}
.credit-pkg-per {
  font-size: .82rem;
  color: rgba(26,43,60,.5);
  margin-bottom: .9rem;
}
.credit-pkg-btn {
  width: 100%;
  padding: .85rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: var(--navy);
  font-family: inherit;
  font-size: .92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 200ms ease;
}
.credit-pkg-btn:hover {
  box-shadow: 0 4px 20px rgba(197,160,89,.3);
  transform: translateY(-1px);
}
.credit-pkg-btn:disabled {
  opacity: .6;
  cursor: wait;
}
.credit-pkg-loading {
  grid-column: 1 / -1;
  text-align: center;
  color: rgba(26,43,60,.4);
  padding: 2rem;
}
.credit-pkg-scope {
  font-size: .8rem;
  line-height: 1.45;
  color: rgba(26,43,60,.55);
  margin: 0 0 1.3rem;
  font-weight: 500;
  min-height: 2.3em;
}
.credit-pkg-discount {
  display: inline-block;
  padding: .38rem 1rem;
  border-radius: 100px;
  background: rgba(197,160,89,.14);
  border: 1px solid rgba(197,160,89,.35);
  color: #B8904A;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .01em;
  margin: 0 0 1rem;
}
.credit-pkg-free {
  border-color: rgba(197,160,89,.3);
  background: rgba(197,160,89,.04);
}
.credit-pkg-badge-free {
  background: linear-gradient(135deg, #C5A059, #B8904A);
  color: #fff;
}
.credit-pkg-btn-free {
  background: linear-gradient(135deg, #C5A059, #B8904A) !important;
  color: #fff !important;
  border-color: #B8904A !important;
}
.credit-pkg-btn-free:hover {
  box-shadow: 0 4px 16px rgba(52,208,88,.3);
}

/* Passendes Paket zur Fehlmenge aus der Credit-Vorabprüfung (?benoetigt=).
   Trägt eine Karte beide Auszeichnungen (Beliebt + Passend), rendert
   renderPackages() in credits.html nur noch "Passend" – deshalb genügt
   hier dieselbe zentrierte Position wie .credit-pkg-badge, es gibt nie
   zwei Badges auf einer Karte gleichzeitig. */
.credit-pkg-suggested {
  border: 2px solid var(--gold);
  box-shadow: 0 4px 24px rgba(197,160,89,.18);
}
.credit-pkg-badge-suggested {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: var(--gold);
  border: 1px solid var(--gold);
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .28rem .8rem;
  border-radius: 100px;
  white-space: nowrap;
}

/* Transaction history */
.credit-history {
  background: #fff;
  border: 1px solid rgba(26,43,60,.08);
  border-radius: var(--radius-md);
  padding: 2rem;
}
.credit-history h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1rem;
}
.credit-tx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
.credit-tx-table th {
  text-align: left;
  padding: .55rem .6rem;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: rgba(26,43,60,.5);
  border-bottom: 1px solid rgba(26,43,60,.1);
}
.credit-tx-table td {
  padding: .55rem .6rem;
  border-bottom: 1px solid rgba(26,43,60,.05);
  color: var(--navy);
}
.tx-positive { color: #B8904A; font-weight: 600; }
.tx-negative { color: #b33; font-weight: 600; }
.credit-tx-empty, .credit-tx-loading {
  text-align: center;
  color: rgba(26,43,60,.4);
  padding: 1rem;
  font-size: .88rem;
}

/* No-credits alert (used in files.js) */
.no-credits-alert {
  background: linear-gradient(135deg, rgba(197,160,89,.08), rgba(197,160,89,.03));
  border: 1px solid rgba(197,160,89,.25);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.no-credits-alert p {
  flex: 1;
  margin: 0;
  font-size: .9rem;
  color: var(--navy);
}
.no-credits-alert a {
  padding: .6rem 1.2rem;
  background: var(--gold);
  color: var(--navy);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: .85rem;
  text-decoration: none;
  white-space: nowrap;
}

/* ══════════════════════════════════════════════
   ADMIN CREDITS PAGE
   ══════════════════════════════════════════════ */
.admin-credits-page {
  max-width: none;
  margin: 0;
  padding: 0 0 3rem;
}
.admin-credits-settings {
  background: #fff;
  border: 1px solid rgba(26,43,60,.08);
  border-radius: var(--radius-md);
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.admin-credits-settings label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--navy);
}
.admin-credits-settings input {
  width: 6rem;
  padding: .5rem .8rem;
  border: 1px solid rgba(26,43,60,.15);
  border-radius: var(--radius-sm);
  font-size: .92rem;
  font-family: "JetBrains Mono", monospace;
}
.admin-credits-settings button {
  padding: .55rem 1.2rem;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
}
.admin-credits-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(26,43,60,.08);
}
.admin-credits-table th {
  text-align: left;
  padding: .7rem .8rem;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: rgba(26,43,60,.55);
  background: var(--navy-glass);
  border-bottom: 1px solid rgba(26,43,60,.1);
}
.admin-credits-table td {
  padding: .65rem .8rem;
  border-bottom: 1px solid rgba(26,43,60,.05);
  color: var(--navy);
}
.admin-grant-btn {
  padding: .3rem .7rem;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
}

/* Credit-Vorabpruefung nach dem Upload */
.credit-preflight {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  border-radius: 10px;
  background: #243447;
  border-left: 4px solid #C5A059;
  color: #fff;
}
.credit-preflight.is-short { border-left-color: #C0392B; }
.credit-preflight h4 { margin: 0 0 .5rem; font-family: Poppins, sans-serif; font-size: 1.05rem; }
.credit-preflight p { margin: 0 0 1rem; line-height: 1.55; opacity: .92; }
.credit-preflight .cp-amount { color: #C5A059; font-weight: 600; }
.credit-preflight.is-short .cp-amount { color: #C0392B; }

.doc-badge-pending {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  letter-spacing: .02em;
  background: rgba(197, 160, 89, .16);
  color: #C5A059;
  border: 1px solid rgba(197, 160, 89, .38);
}

.doc-badge-failed {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  letter-spacing: .02em;
  background: rgba(192, 57, 43, .14);
  color: #C0392B;
  border: 1px solid rgba(192, 57, 43, .38);
}

/* Nur abgelegt / nicht lesbar (2026-10-03): sachlich, Navy, kein Fehler */
.doc-badge-info {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  letter-spacing: .02em;
  background: rgba(26, 43, 60, .06);
  color: #243447;
  border: 1px solid rgba(26, 43, 60, .22);
}

/* Neustart einer fehlgeschlagenen Einzelanalyse (neben dem Fehl-Badge) */
.row-retry-btn {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  letter-spacing: .02em;
  background: transparent;
  color: #C5A059;
  border: 1px solid rgba(197, 160, 89, .55);
  cursor: pointer;
  font-family: inherit;
}
.row-retry-btn:hover { background: rgba(197, 160, 89, .16); }

/* Trenn-Dialog fuer Sammel-PDFs (Inhalt des dmskiModal-Bodys) */
.sd-sub { margin: 0 0 .85rem; opacity: .82; line-height: 1.5; }
.sd-warn {
  margin: 0 0 1.1rem;
  font-weight: 700;
  color: #C0392B;
  line-height: 1.5;
}
.sd-cov { margin: 0 0 .75rem; font-size: .88rem; opacity: .78; }
.split-list { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.split-list li {
  display: flex; gap: 1rem; align-items: baseline;
  padding: .7rem .9rem; border-radius: 8px;
  background: #0F1E2B; border: 1px solid rgba(197, 160, 89, .22);
}
.split-list li + li { margin-top: .5rem; }
.split-list .sl-pages { color: #C5A059; font-variant-numeric: tabular-nums; white-space: nowrap; }
.split-list .sl-typ { font-weight: 600; }
.split-list .sl-meta { display: block; font-size: .82rem; opacity: .7; margin-top: .15rem; }

/* 2026-09-05: erklärender Zusatz im Feld-Label (Fallname) */
.field-label-hint { font-weight: 400; color: #64748b; font-size: 0.85em; }
/* 2026-09-05: Einleitung auf der Upload-Seite */
.upload-intro { margin: .35rem 0 0; color: #5a6b78; font-size: .95rem; line-height: 1.55; max-width: 60ch; }
/* 2026-09-05: Schnellwahl-Chips im Credit-Rechner */
.credit-calc-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0 .2rem; }
.credit-calc-chips button {
  font: inherit; font-size: .85rem; font-weight: 600; color: #1A2B3C;
  background: #fff; border: 1px solid #d8dee6; border-radius: 999px;
  padding: .3rem .8rem; cursor: pointer; transition: all 150ms ease;
  font-variant-numeric: tabular-nums;
}
.credit-calc-chips button:hover { border-color: #C5A059; }
.credit-calc-chips button[aria-pressed="true"] { background: #C5A059; border-color: #C5A059; color: #1A2B3C; }

/* ── Karte 4b: Anwaltssuche im Umkreis (seit 2026-09-06) ─────────────────── */
/* Angebotsblock Karte 5: hell wie alle Karten (seit 2026-09-07, Wunsch Arthur), Knopf steht im Kartenkopf */
.as-offer { margin-top: 1.4rem; padding: 1.1rem 1.25rem 1.2rem; border-radius: 12px; background: rgba(26,43,60,0.03); color: #1A2B3C; border: 1px solid rgba(26,43,60,0.1); border-top: 3px solid #C5A059; }
.as-offer-title { margin: 0 0 0.3rem; font-family: Poppins, sans-serif; font-weight: 600; font-size: 1.02rem; color: #1A2B3C; }
.as-offer-lead { margin: 0 0 1rem; font-size: 0.9rem; line-height: 1.55; color: #4a5866; }
.as-checks-label { margin: 0 0 0.55rem; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: #B8904A; }
.as-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.6rem; margin-bottom: 0.9rem; }
.as-check { display: flex; flex-direction: row; align-items: center; gap: 0.8rem; text-align: left; letter-spacing: 0; padding: 0.75rem 0.9rem; border-radius: 10px; border: 1px solid rgba(26,43,60,0.14); background: #fff; cursor: pointer; transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease; }
.as-check:hover { border-color: rgba(197,160,89,0.6); }
.as-check:has(input:checked) { border-color: #C5A059; background: rgba(197,160,89,0.1); box-shadow: inset 0 0 0 1px #C5A059; }
.as-check:has(input:focus-visible) { outline: 2px solid #C5A059; outline-offset: 2px; }
.as-check input { flex: 0 0 auto; width: 1.35rem; height: 1.35rem; margin: 0; accent-color: #B8904A; cursor: pointer; }
.as-check-body { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.as-check-name { font-weight: 600; font-size: 0.92rem; color: #1A2B3C; line-height: 1.3; overflow-wrap: anywhere; }
.as-check-pct { color: #4a5866; font-variant-numeric: tabular-nums; font-size: 0.78rem; }
.as-check:has(input:checked) .as-check-pct { color: #B8904A; font-weight: 600; }
.as-offer-foot { margin: 0; font-size: 0.82rem; color: #4a5866; }
.as-offer-actions { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.as-offer-actions .ki-scan-rate { margin: 0; }
.as-feature { margin-top: 1.2rem; }
.as-kicker { margin: 0 0 0.6rem; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #B8904A; }
.as-statement { margin-bottom: 0.9rem; }
.as-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.as-item { border: 1px solid rgba(26,43,60,0.1); border-radius: 10px; padding: 0.8rem 0.95rem; background: #fff; }
.as-head { display: flex; gap: 0.7rem; align-items: flex-start; }
.as-num { flex: 0 0 1.6rem; height: 1.6rem; border-radius: 50%; background: #1A2B3C; color: #C5A059; font-size: 0.8rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.as-name { margin: 0; font-weight: 600; color: #1A2B3C; }
.as-meta { margin: 0.1rem 0 0; font-size: 0.82rem; color: #4a5866; }
.as-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.55rem 0 0 2.3rem; }
.as-tag { font-size: 0.74rem; padding: 0.15rem 0.5rem; border-radius: 999px; background: rgba(197,160,89,0.16); color: #B8904A; border: 1px solid rgba(197,160,89,0.38); }
.as-tag--muted { background: rgba(26,43,60,0.06); color: #4a5866; border-color: rgba(26,43,60,0.12); }
.as-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0.5rem 0 0 2.3rem; }
.as-link { font-size: 0.8rem; font-weight: 600; color: #B8904A; text-decoration: none; white-space: nowrap; }
.as-link:hover { text-decoration: underline; }
body.printing .as-offer { display: none; }

/* ── Ordner in der Files-Liste (2026-09-06) ─────────────────────── */
.ordner-row td {
  padding: 1.1rem 0.9rem 0.45rem;
  border-bottom: 1px solid rgba(197,160,89,0.28);
  background: transparent;
}
.ordner-row .ordner-name {
  font-family: "Poppins", "Inter", sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #C5A059;
}
.ordner-row .ordner-count { margin-left: 0.7rem; font-size: 0.8rem; color: rgba(255,255,255,0.6); font-variant-numeric: tabular-nums; }
.ordner-row .ordner-hint { display: block; margin-top: 0.25rem; font-size: 0.78rem; color: rgba(255,255,255,0.55); }
.ordner-pick { display: inline-flex; align-items: center; }
.ordner-select {
  font: inherit; font-size: 0.78rem; font-weight: 600;
  color: #C5A059;
  background: rgba(197,160,89,0.1);
  border: 1px solid rgba(197,160,89,0.35);
  border-radius: 999px;
  padding: 0.15rem 1.5rem 0.15rem 0.6rem;
  cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23C5A059'><path fill-rule='evenodd' d='M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z' clip-rule='evenodd'/></svg>");
  background-repeat: no-repeat; background-position: right 0.45rem center; background-size: 0.85rem;
}
.ordner-select:hover, .ordner-select:focus-visible { border-color: #C5A059; outline: none; }
.ordner-select option { color: #1A2B3C; background: #fff; }
.ordner-pick--static { font-size: 0.78rem; color: #C5A059; }

/* ── Master-Scan veraltet: neue Files seit dem letzten Lauf ─────── */
.ms-stale-hint {
  margin: 0.9rem 0 1rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid rgba(197,160,89,0.45);
  border-radius: 10px;
  background: rgba(197,160,89,0.1);
  /* Karten sind seit 2026-09-07 hell: Navy-Text, sonst wäre der Hinweis weiss auf weiss. */
  color: #1A2B3C;
  font-size: 0.92rem;
  line-height: 1.55;
}
.ms-stale-hint strong { color: #C5A059; }
.ms-stale-hint a { color: #C5A059; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ── Knopf ohne ausreichendes Guthaben: gesperrt, Klick erklärt ─── */
button.is-credit-short {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.35);
}
button.is-credit-short .ki-scan-cost { color: #C0392B; }

/* ── Ort-Abfrage in der Fachanwalt-Recherche ────────────────────── */
.as-ort-label { display: block; margin: 0.8rem 0 0.3rem; font-size: 0.85rem; font-weight: 600; text-align: left; }
.as-ort-input {
  width: 100%; font: inherit; padding: 0.6rem 0.75rem;
  border: 1px solid rgba(26,43,60,0.3); border-radius: 8px; color: #1A2B3C; background: #fff;
}
.as-ort-input:focus { outline: 2px solid #C5A059; outline-offset: 1px; border-color: #C5A059; }

/* ================================================================
   DASHBOARD 2026-09-07: Ersteinstieg «Fall anlegen», Fallliste, Utility-Leiste
   ================================================================ */

/* ── Utility-Leiste oben im Inhaltsbereich (nav.js) ── */
.app-utilbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  margin: -.6rem 0 1.1rem;
  font-family: "Inter", sans-serif;
}
.ub-actions { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.ub-account { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
/* Primäraktion der Seite: gross, gold, links (Dashboard «Neuen Fall anlegen», Fallseiten «Unterlagen hochladen»). */
.ub-primary {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .8rem 1.35rem;
  border: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, var(--gold), var(--gold-2));
  color: #fff;
  font-family: "Poppins", "Inter", sans-serif;
  font-size: .98rem;
  font-weight: 600;
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(197,160,89,.28);
  transition: transform .15s ease, box-shadow .15s ease;
}
.ub-primary svg { width: 1.15rem; height: 1.15rem; flex-shrink: 0; }
.ub-primary:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(197,160,89,.38); }
.ub-primary:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.app-utilbar.has-primary { margin-top: 0; margin-bottom: 1.4rem; }
.ub-user {
  display: inline-flex;
  align-items: baseline;
  gap: .45rem;
  color: var(--ink-soft);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  padding: .4rem .6rem;
  border-radius: var(--radius-md);
}
.ub-user:hover { color: var(--ink); background: rgba(26,43,60,.05); }
.ub-role { color: var(--ink-muted); font-weight: 500; font-size: .74rem; }
.ub-logout {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--ink-soft);
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.ub-logout svg { width: 1rem; height: 1rem; }
.ub-logout:hover { color: var(--ink); border-color: rgba(26,43,60,.35); background: var(--bg-subtle); }
.ub-logout:focus-visible, .ub-user:focus-visible, .case-row-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
@media (max-width: 768px) {
  .app-utilbar { margin: 0 0 .9rem; }
  .app-utilbar { justify-content: space-between; }
  .ub-user { padding-left: 0; }
  .ub-logout span { display: none; }   /* nur das Symbol */
  .ub-logout { padding: .45rem .55rem; }
  .ub-primary { padding: .7rem 1rem; font-size: .9rem; }
}
@media (max-width: 480px) {
  .app-utilbar.has-primary { flex-wrap: wrap; }
  .ub-actions { order: 2; width: 100%; }
  .ub-primary { width: 100%; justify-content: center; }
  .ub-account { order: 1; width: 100%; justify-content: space-between; }
}

/* ── Dashboard: eine Spalte, Lesebreite ── */
.dash-stack {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.dash-stack .card { margin-bottom: 0; }
.dash-stack .card-new-case { border-top: 3px solid var(--gold); padding: 1.7rem 1.9rem 1.6rem; }
.dash-stack .card-open-case { border-top: 1px solid var(--border); }
.card-title--lg { font-size: 1.35rem; margin-bottom: .35rem; }
.card-header-row--between { justify-content: space-between; align-items: flex-start; }
.cases-count {
  flex-shrink: 0;
  font-size: .75rem;
  font-weight: 600;
  color: var(--ink-muted);
  padding: .25rem .6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
}

/* ── Drei Schritte beim ersten Besuch ── */
.dash-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .6rem;
}
.dash-step {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .8rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--ink-muted);
}
.dash-step.is-current {
  border-color: rgba(197,160,89,.55);
  background: rgba(197,160,89,.06);
  color: var(--ink);
}
.dash-step-num {
  flex-shrink: 0;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 1.5px solid currentColor;
}
.dash-step.is-current .dash-step-num { background: var(--gold); border-color: var(--gold); color: #fff; }
.dash-step-text { display: flex; flex-direction: column; gap: .1rem; line-height: 1.3; }
.dash-step-text strong { font-size: .84rem; font-weight: 600; }
.dash-step-text small { font-size: .74rem; color: var(--ink-muted); }
@media (max-width: 600px) {
  .dash-steps { grid-template-columns: 1fr; gap: .4rem; }
  .dash-step:not(.is-current) .dash-step-text small { display: none; }
}

/* ── Formular-Gruppen ── */
.field-set {
  border: 0;
  margin: .35rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .6rem;
  min-width: 0;
}
.field-set-title {
  padding: 0;
  margin: 0;
  font-family: "Poppins", "Inter", sans-serif;
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: .5rem;
}
.field-set-opt, .field-label-hint {
  font-family: "Inter", sans-serif;
  font-size: .74rem;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 0;
}
.field-set-note {
  margin: -.25rem 0 .1rem;
  font-size: .8rem;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 62ch;
}
.field-set .field-row { margin-top: .1rem; }
.dash-stack .field-label { font-size: .84rem; color: var(--ink); }
.dash-stack .field-help { color: var(--ink-soft); }
.dash-stack .field-input { font-size: .95rem; padding: .74rem .95rem; }
.dash-stack .field-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(197,160,89,.22); }
.dash-stack .field-input::placeholder { color: #94A3B2; }
.btn-lg { padding: .95rem 1.5rem; font-size: 1rem; margin-top: .9rem; }
.dash-stack .message:empty { display: none; }
.dash-stack .message { margin: .6rem 0 0; font-size: .86rem; }

/* ── Fallliste ── */
.case-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.case-row + .case-row { border-top: 1px solid var(--border); }
.case-row-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem .5rem;
  margin: 0 -.5rem;
  width: calc(100% + 1rem);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  font: inherit;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  transition: background .15s ease;
}
.case-row-btn:hover { background: rgba(197,160,89,.07); }
.case-row-main { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.case-row-name {
  font-family: "Poppins", "Inter", sans-serif;
  font-size: .98rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.case-row-parties { font-size: .82rem; color: var(--ink-soft); }
.case-row-meta { font-size: .76rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
/* «Fall öffnen» ist die Hauptaktion des Dashboards (Arthur, 2026-09-08): als goldener Knopf, nicht als Textlink. */
.case-row-action {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .7rem 1.15rem;
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, var(--gold), var(--gold-2));
  color: #fff;
  font-family: "Poppins", "Inter", sans-serif;
  font-size: .92rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(197,160,89,.28);
  transition: transform .15s ease, box-shadow .15s ease;
}
.case-row-btn:hover .case-row-action { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(197,160,89,.38); }
/* Das hidden-Attribut muss gegen display-Regeln (.dash-steps, .ub-logout) gewinnen. */
[hidden] { display: none !important; }
.case-row-action svg { width: .95rem; height: .95rem; transition: transform .15s ease; }
.case-row-btn:hover .case-row-action svg { transform: translateX(2px); }
.case-list-status { margin: .5rem 0 0; font-size: .84rem; color: var(--error); }
.case-list-empty { padding: .5rem 0 0; font-size: .86rem; line-height: 1.55; color: var(--ink-soft); }
.case-list-empty p { margin: 0 0 .5rem; }
.case-list-empty-title { font-weight: 700; color: var(--error); }
.case-list-empty a { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 480px) {
  .case-row-btn { align-items: flex-start; flex-wrap: wrap; }
  .case-row-action { width: 100%; justify-content: center; margin-top: .5rem; }
  .case-row-name { white-space: normal; }
}


/* ================================================================
   TABELLEN 2026-09-07: Zebra und Hover auf allen App-Tabellen (Arthur)
   ================================================================ */
body.has-sidebar table tbody tr:nth-child(even) > td { background-color: rgba(26,43,60,.03); }
body.has-sidebar table tbody tr:hover > td { background-color: rgba(197,160,89,.10); }
body.has-sidebar table tbody tr { transition: background-color .12s ease; }
body.has-sidebar table tbody tr:hover { background-color: rgba(197,160,89,.10); }
body.has-sidebar table tbody tr:nth-child(even) { background-color: rgba(26,43,60,.03); }


/* Zahlenspalten (Arthur 2026-09-07): rechtsbündig, Tabellenziffern, Credits ganze Zahlen */
body.has-sidebar table th.num, body.has-sidebar table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.admin-cases-files, .ac-table td.ac-files, .ac-table td:nth-child(6) { text-align: right; font-variant-numeric: tabular-nums; }


/* ================================================================
   REFERENZ-TABELLE .dm-table (2026-09-07, Vorlage: Benutzer-Tabelle)
   Weisse Karte, ruhiger Kopf, mehrzeilige Zellen, Zahlen rechts,
   Zebra + Hover aus der globalen Regel. Neue Tabellen: class="dm-table".
   ================================================================ */
body.has-sidebar table.dm-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .88rem;
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(26,43,60,.08);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(26,43,60,.04);
  table-layout: auto;
}
body.has-sidebar table.dm-table thead th {
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: rgba(26,43,60,.45);
  padding: .7rem .7rem;
  background: rgba(26,43,60,.02);
  border-bottom: 1px solid rgba(26,43,60,.08);
  white-space: nowrap;
}
body.has-sidebar table.dm-table tbody td {
  padding: .7rem .7rem;
  border-bottom: 1px solid rgba(26,43,60,.04);
  color: var(--ink);
  vertical-align: top;
  line-height: 1.4;
  font-weight: 400;
}
body.has-sidebar table.dm-table tbody tr:last-child td { border-bottom: none; }
body.has-sidebar table.dm-table td strong { font-weight: 600; }
/* Gestapelte Zelle: Hauptzeile, darunter Nebenzeile (Uhrzeit, E-Mail, Zusatz) */
.dm-stack { display: flex; flex-direction: column; gap: .1rem; line-height: 1.35; }
.dm-sub { font-size: .76rem; color: var(--ink-muted); }
body.has-sidebar table.dm-table th.num, body.has-sidebar table.dm-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
/* Aktionen als Icon-Raster, zwei Spalten */
body.has-sidebar table.dm-table .dm-actions { display: grid; grid-template-columns: repeat(2, 2rem); gap: .25rem; justify-content: end; align-content: start; margin-left: auto; }

/* ── Credits-Seite: Guthaben-Karte zuoberst (2026-09-07) ── */
.credit-stand {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem 2.5rem;
  align-items: center;
  padding: 1.6rem 1.9rem;
  margin-bottom: 1.5rem;
  border-top: 3px solid var(--gold);
}
.credit-stand-label { margin: 0 0 .25rem; font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.credit-stand-number {
  margin: 0;
  display: flex; align-items: baseline; gap: .5rem;
  font-family: "Poppins", "Inter", sans-serif;
  font-size: 2.6rem; font-weight: 700; line-height: 1; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.credit-stand-unit { font-size: 1rem; font-weight: 600; color: var(--gold-2); }
.credit-stand-sub { margin: .5rem 0 0; font-size: .82rem; color: var(--ink-muted); }
.credit-stand-stats { display: flex; gap: 1.75rem; margin: 0; }
.credit-stand-stats div { display: flex; flex-direction: column; gap: .15rem; min-width: 5.5rem; }
.credit-stand-stats dt { font-size: .74rem; font-weight: 600; color: var(--ink-muted); }
.credit-stand-stats dd { margin: 0; font-size: 1.05rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .credit-stand { grid-template-columns: 1fr; }
  .credit-stand-stats { gap: 1.25rem; }
}


/* ── KI-Analyse 2026-09-07: Karten ohne Kicker, Knöpfe rechts, kein Glanz ── */
.section-kicker, .ms-kicker { display: none; }
.forensic-header-actions.ms-actions { max-width: 24rem; margin-left: auto; }
.forensic-header-actions.ms-actions .ms-actions-row { width: 100%; justify-content: flex-end; }
.forensic-header-actions.ms-actions .ki-scan-rate { text-align: right; }
.ms-shine, .ms-glow { display: none !important; }

/* ── Fall-Kopf hell (Arthur 2026-09-07): wie die übrigen Karten, Navy-Text, Gold-Oberkante ── */
.case-cover { border-top: 3px solid var(--gold); border-radius: 14px; box-shadow: 0 1px 3px rgba(26,43,60,.04); border-color: var(--border); }
.case-cover-band { background: #fff; border-bottom: 1px solid var(--border); padding: 1.35rem 1.6rem 1.15rem; }
.case-cover-name { color: var(--ink); font-size: 1.35rem; }
.case-cover-id { color: var(--ink-soft); background: var(--bg-subtle); border: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.case-cover-delete { border-color: var(--border); background: #fff; color: var(--ink-soft); }
.case-cover-delete:hover { background: #fff; border-color: var(--error); color: var(--error); }
.case-cover-chip { background: var(--bg-subtle); border: 1px solid var(--border); }
.case-cover-chip .cc-k { color: var(--ink-muted); }
.case-cover-chip .cc-v { color: var(--ink); font-weight: 600; }
.case-cover .case-person-field { border-left: 0; }
.case-cover .case-person-field.is-protected, .case-cover .case-person-field.is-opposing { border-left: 0; }
.case-cover .case-person-field.is-protected .case-person-label::before,
.case-cover .case-person-field.is-opposing .case-person-label::before {
  content: ""; display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; margin-right: .4rem; vertical-align: middle;
}
.case-cover .case-person-field.is-protected .case-person-label::before { background: var(--gold); }
.case-cover .case-person-field.is-opposing .case-person-label::before { background: var(--error); opacity: .7; }


/* ── Fallseiten 2026-09-07: Upload als Hauptaktion im Kopf, «Nächster Schritt», Team unten ── */
.case-cover-chip--link { text-decoration: none; cursor: pointer; border-color: rgba(197,160,89,.55) !important; }
.case-cover-chip--link:hover { background: rgba(197,160,89,.12) !important; }
.case-cover-chip--link .cc-v { color: var(--gold-2) !important; }

/* ── Fall löschen: ganz unten, gross und rot (2026-09-08) ── */
.case-delete-zone {
  margin: 2.5rem 0 1rem;
  padding: 1.5rem 1.8rem 1.7rem;
  border: 1px solid rgba(192,57,43,.35);
  border-top: 3px solid var(--error);
  border-radius: 14px;
  background: #fff;
}
.case-delete-title { margin: 0 0 .35rem; font-family: "Poppins", sans-serif; font-size: 1.15rem; color: var(--error); }
.case-delete-text { margin: 0 0 1.1rem; font-size: .92rem; line-height: 1.55; color: var(--ink-soft); max-width: 60ch; }
.btn-danger-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  width: 100%;
  padding: 1rem 1.5rem;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--error);
  color: #fff;
  font-family: "Poppins", "Inter", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(192,57,43,.28);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-danger-lg svg { width: 1.25rem; height: 1.25rem; }
.btn-danger-lg:hover:not(:disabled) { filter: brightness(.92); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(192,57,43,.38); }
.btn-danger-lg:disabled { opacity: .6; cursor: not-allowed; }
body.printing .case-delete-zone { display: none !important; }

.case-cover-actions { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.case-cover-upload { padding: .62rem 1.05rem; font-size: .88rem; border-radius: var(--radius-md); white-space: nowrap; text-decoration: none; }
.case-cover-upload:hover { color: #fff; }
.case-next-step {
  display: grid; grid-template-columns: 1fr auto; gap: 1.5rem 2.5rem; align-items: center;
  padding: 1.8rem 2rem; margin: 0 0 1.5rem; border-top: 3px solid var(--gold);
}
.case-next-step-step { margin: 0 0 .3rem; font-size: .8rem; font-weight: 600; color: var(--gold-2); }
.case-next-step h2 { margin: 0 0 .5rem; font-family: "Poppins", "Inter", sans-serif; font-size: 1.35rem; font-weight: 700; color: var(--ink); }
.case-next-step p:last-child { margin: 0; font-size: .92rem; line-height: 1.55; color: var(--ink-soft); max-width: 58ch; }
.case-next-step-btn { text-decoration: none; padding: 1rem 1.6rem; font-size: 1rem; }
.case-next-step-btn:hover { color: #fff; }
.case-team { margin: 1.5rem 0 0; }
@media (max-width: 700px) {
  .case-next-step { grid-template-columns: 1fr; }
  .case-cover-headrow { flex-wrap: wrap; }
}


/* ================================================================
   UPLOAD-SEITE 2026-09-07: ein Knopf, ein Satz, Markenfarben
   ================================================================ */
.upload-card { padding: 1.7rem 1.9rem 1.8rem; border-top: 3px solid var(--gold); }
.upload-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; flex-wrap: wrap; }
.upload-head-text { min-width: 0; max-width: 62ch; }
.upload-step { margin: 0 0 .25rem; font-size: .8rem; font-weight: 600; color: var(--gold-2); }
.upload-card-title { margin: 0 0 .3rem; font-family: "Poppins", "Inter", sans-serif; font-size: 1.45rem; font-weight: 700; color: var(--ink); display: block; }
.upload-case-banner { margin: 0 0 .6rem; font-size: .9rem; font-weight: 600; color: var(--ink-soft); letter-spacing: 0; }
.upload-intro { margin: 0 0 .5rem; font-size: .92rem; line-height: 1.55; color: var(--ink-soft); }
.upload-model-info { margin: 0; font-size: .78rem; color: var(--ink-muted); }
.upload-back-btn { background: #fff; color: var(--ink-soft); border: 1px solid var(--border); border-radius: var(--radius-md); font-size: .84rem; padding: .55rem .9rem; }
.upload-back-btn:hover { background: var(--bg-subtle); color: var(--ink); }

.dropzone-hero { border: 2px dashed rgba(197,160,89,.6); border-radius: 14px; background: rgba(197,160,89,.04); margin-bottom: 1rem; }
.dropzone-hero:hover, .dropzone-hero:focus-visible, .dropzone-hero.drag { border-color: var(--gold); background: rgba(197,160,89,.09); box-shadow: 0 0 0 4px rgba(197,160,89,.18); }
.dropzone-hero.paste-flash { border-color: var(--gold-2); background: rgba(197,160,89,.14); }
.dropzone-hero-inner { padding: 2.4rem 1.5rem 2rem; gap: .35rem; }
.dropzone-hero-icon { color: var(--gold-2); opacity: 1; margin-bottom: .4rem; }
.dropzone-hero-icon svg { width: 3.2rem; height: 3.2rem; }
.dz-choose { pointer-events: none; padding: .95rem 1.8rem; font-size: 1.02rem; margin: .2rem 0 .4rem; }
.dropzone-hero-title { margin: 0; font-size: .95rem; font-weight: 500; color: var(--ink-soft); }
.dropzone-hero-sub { margin: .2rem 0 0; font-size: .84rem; color: var(--ink-muted); max-width: 52ch; line-height: 1.5; }
.dropzone-hero-cost { margin: .8rem 0 0; font-size: .82rem; color: var(--ink-soft); }
.dropzone-hero-cost strong { color: var(--gold-2); font-weight: 700; }

/* Format-Leiste direkt unter dem Uploader (2026-10-23): was angenommen wird, was nicht */
.upload-separat { margin: 0 0 1rem; padding: .8rem 1rem; border: 1px solid var(--gold-2); border-left: 4px solid var(--accent); border-radius: var(--radius-md); background: var(--accent-light); }
.upload-separat-title { margin: 0 0 .25rem; font-size: .95rem; font-weight: 700; color: var(--ink); }
.upload-separat-text { margin: 0; font-size: .86rem; line-height: 1.55; color: var(--ink-soft); }

.upload-formats { margin: 0 0 1rem; padding: .75rem .95rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; display: grid; gap: .5rem; }
.uf-row { display: grid; grid-template-columns: 9.5rem 1fr; gap: .75rem; align-items: baseline; }
.uf-row dt { margin: 0; font-size: .8rem; font-weight: 600; color: var(--ink); }
.uf-row dd { margin: 0; font-size: .84rem; line-height: 1.5; color: var(--ink-soft); }
.uf-no dt { color: var(--error); }
.uf-chip { display: inline-block; margin: 0 .3rem .2rem 0; padding: .1rem .5rem; border: 1px solid var(--gold-2); border-radius: 999px; font-size: .78rem; font-weight: 600; color: var(--ink); }
.uf-note { font-size: .8rem; color: var(--ink-muted); }
@media (max-width: 560px) { .uf-row { grid-template-columns: 1fr; gap: .15rem; } .uf-note { display: block; margin-top: .15rem; } }

.upload-details { margin: 0 0 1rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; }
.upload-details summary { cursor: pointer; padding: .7rem .95rem; font-size: .88rem; font-weight: 600; color: var(--ink); list-style: none; display: flex; align-items: center; gap: .5rem; }
.upload-details summary::-webkit-details-marker { display: none; }
.upload-details summary::before { content: ""; width: .45rem; height: .45rem; border-right: 2px solid var(--gold-2); border-bottom: 2px solid var(--gold-2); transform: rotate(-45deg); transition: transform .15s ease; flex-shrink: 0; }
.upload-details[open] summary::before { transform: rotate(45deg); }
.upload-details-body { padding: 0 .95rem .85rem; display: grid; gap: .45rem; }
.upload-details-body p { margin: 0; font-size: .84rem; line-height: 1.55; color: var(--ink-soft); }
.upload-details-body strong { color: var(--ink); font-weight: 600; }

.upload-hints { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: .75rem; margin: 0 0 1.1rem; }
.upload-hint, .upload-hint--redact, .upload-hint--ai { display: block; padding: .85rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-subtle); box-shadow: none; }
.upload-hint-title { font-size: .86rem; font-weight: 600; color: var(--ink); margin: 0 0 .2rem; }
.upload-hint-text { font-size: .82rem; line-height: 1.5; color: var(--ink-soft); }

/* Fallkopf: Stift neben dem Fallnamen (seit 2026-09-07) und Inline-Feld zum Umbenennen */
.case-cover-name .case-cover-edit { opacity: 0.55; width: 1.6rem; height: 1.6rem; margin-top: 0; color: inherit; }
.case-cover-name .case-cover-edit svg { width: 0.9rem; height: 0.9rem; }
.case-cover-name:hover .case-cover-edit, .case-cover-name .case-cover-edit:focus-visible { opacity: 1; }
.case-cover-name .case-cover-name-input {
  font-family: "Poppins", sans-serif; font-size: 1.15rem; font-weight: 600; color: var(--ink);
  min-width: 14rem; max-width: 100%; flex: 1 1 14rem; padding: 0.3rem 0.6rem;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
.case-cover-name .case-edit-actions { display: inline-flex; gap: 0.3rem; }
body.printing .case-cover-edit { display: none !important; }

/* ── Unterlagen-Wegweiser auf dem Dashboard (2026-09-08) ─────────────────────
   Erklärt vor dem ersten Upload, was DMSKI annimmt, was es damit macht und wo
   die Grenzen liegen. Ruhige Karte im Kartenstil, keine Farbsignale. */
.card-upload-guide .ug-list {
  margin: 1.1rem 0 0;
  display: grid;
  gap: 0;
}
.card-upload-guide .ug-row {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 0 1.25rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border);
}
.card-upload-guide .ug-row:first-child { border-top: 0; padding-top: 0.35rem; }
.card-upload-guide .ug-term {
  font-weight: 650;
  color: var(--navy);
  margin: 0;
}
.card-upload-guide .ug-desc {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
}
.card-upload-guide .ug-note {
  margin: 1.15rem 0 0;
  padding: 0.9rem 1rem;
  background: var(--navy-glass);
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  line-height: 1.6;
  color: var(--navy);
}
@media (max-width: 640px) {
  .card-upload-guide .ug-row { grid-template-columns: 1fr; gap: 0.2rem; }
}
