/* ============================================================
   STPS.OutputSolution — Design System
   Emerald admin look, light + dark, Inter + JetBrains Mono
   ============================================================ */

:root {
  /* Emerald primary (Tailwind emerald-600/500) */
  --color-primary:        #2e3862;
  --color-primary-hover:  #232b4d;
  --color-primary-soft:   #eef0f7;
  --color-primary-ring:   rgba(46, 56, 98, 0.22);
  --color-accent:         #ff6136;
  --color-accent-hover:   #f04a1f;
  --color-accent-soft:    #fff1ec;

  /* Surfaces — LIGHT */
  --color-bg-app:         #f8fafc;   /* slate-50 */
  --color-bg-subtle:      #f1f5f9;   /* slate-100 */
  --color-surface:        #ffffff;
  --color-surface-hover:  #f8fafc;
  --color-border:         #e2e8f0;   /* slate-200 */
  --color-border-strong:  #cbd5e1;   /* slate-300 */

  --color-text-primary:   #0f172a;   /* slate-900 */
  --color-text-secondary: #334155;   /* slate-700 */
  --color-text-muted:     #64748b;   /* slate-500 */
  --color-text-faint:     #94a3b8;   /* slate-400 */

  /* Semantic colors */
  --color-success:        #1e7d50;
  --color-success-bg:     #d8efe1;
  --color-success-text:   #0f5436;

  --color-warning:        #d97706;
  --color-warning-bg:     #fef3c7;
  --color-warning-text:   #92400e;

  --color-danger:         #dc2626;
  --color-danger-bg:      #fee2e2;
  --color-danger-text:    #991b1b;

  --color-info:           #2563eb;
  --color-info-bg:        #dbeafe;
  --color-info-text:      #1e40af;

  --color-neutral-bg:     #f1f5f9;
  --color-neutral-text:   #475569;

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);

  /* Radii */
  --radius-card:   12px;
  --radius-input:  8px;
  --radius-btn:    8px;
  --radius-pill:   9999px;

  /* Layout */
  --sidebar-w: 240px;
  --topbar-h:  64px;

  --font-ui:   'Poppins', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html[data-theme="dark"] {
  --color-primary:        #6e7aae;
  --color-primary-hover:  #8a96c4;
  --color-primary-soft:   rgba(110, 122, 174, 0.16);
  --color-primary-ring:   rgba(110, 122, 174, 0.32);
  --color-accent:         #ff8b69;
  --color-accent-hover:   #ffa787;
  --color-accent-soft:    rgba(255, 97, 54, 0.16);

  --color-bg-app:         #0a0f14;
  --color-bg-subtle:      #0f172a;
  --color-surface:        #111827;
  --color-surface-hover:  #1f2937;
  --color-border:         #1f2937;
  --color-border-strong:  #334155;

  --color-text-primary:   #f1f5f9;
  --color-text-secondary: #cbd5e1;
  --color-text-muted:     #94a3b8;
  --color-text-faint:     #64748b;

  --color-success:        #10b981;
  --color-success-bg:     rgba(16, 185, 129, 0.14);
  --color-success-text:   #6ee7b7;

  --color-warning:        #f59e0b;
  --color-warning-bg:     rgba(245, 158, 11, 0.14);
  --color-warning-text:   #fcd34d;

  --color-danger:         #ef4444;
  --color-danger-bg:      rgba(239, 68, 68, 0.14);
  --color-danger-text:    #fca5a5;

  --color-info:           #3b82f6;
  --color-info-bg:        rgba(59, 130, 246, 0.14);
  --color-info-text:      #93c5fd;

  --color-neutral-bg:     rgba(148, 163, 184, 0.12);
  --color-neutral-text:   #cbd5e1;

  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.45), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-primary);
  background: var(--color-bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
}

.mono { font-family: var(--font-mono); font-feature-settings: normal; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border-strong); border-radius: 10px; border: 2px solid var(--color-bg-app); }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-faint); }

/* ------------------------------------------------------------
   ds-card
   ------------------------------------------------------------ */
.ds-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-xs);
}
.ds-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ds-card-header h2, .ds-card-header h3 { margin: 0; font-size: 14px; font-weight: 600; color: var(--color-text-primary); letter-spacing: -0.005em; }
.ds-card-body { padding: 20px; }

/* ------------------------------------------------------------
   ds-btn
   ------------------------------------------------------------ */
.ds-btn {
  --btn-bg: var(--color-surface);
  --btn-fg: var(--color-text-primary);
  --btn-border: var(--color-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.05s;
  white-space: nowrap;
  user-select: none;
}
.ds-btn:hover:not(:disabled) { background: var(--color-surface-hover); }
.ds-btn:active:not(:disabled) { transform: translateY(0.5px); }
.ds-btn:focus-visible { outline: 2px solid var(--color-primary-ring); outline-offset: 2px; }
.ds-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.ds-btn-primary {
  --btn-bg: var(--color-primary);
  --btn-fg: #ffffff;
  --btn-border: var(--color-primary);
}
.ds-btn-primary:hover:not(:disabled) { --btn-bg: var(--color-primary-hover); --btn-border: var(--color-primary-hover); }

.ds-btn-ghost {
  --btn-bg: transparent;
  --btn-border: transparent;
  --btn-fg: var(--color-text-secondary);
}
.ds-btn-ghost:hover:not(:disabled) { background: var(--color-surface-hover); }

.ds-btn-danger {
  --btn-bg: var(--color-surface);
  --btn-fg: var(--color-danger);
  --btn-border: var(--color-border);
}
.ds-btn-danger:hover:not(:disabled) { --btn-bg: var(--color-danger-bg); --btn-border: var(--color-danger); }

/* Gefüllte Ja/Nein-Varianten für eindeutige Entscheidungs-Aktionen (z. B. Freigeben/Ablehnen). */
.ds-btn-success {
  --btn-bg: var(--color-success);
  --btn-fg: #ffffff;
  --btn-border: var(--color-success);
}
.ds-btn-success:hover:not(:disabled) {
  --btn-bg: color-mix(in oklab, var(--color-success) 86%, #000);
  --btn-border: color-mix(in oklab, var(--color-success) 86%, #000);
}

.ds-btn-danger-solid {
  --btn-bg: var(--color-danger);
  --btn-fg: #ffffff;
  --btn-border: var(--color-danger);
}
.ds-btn-danger-solid:hover:not(:disabled) {
  --btn-bg: color-mix(in oklab, var(--color-danger) 86%, #000);
  --btn-border: color-mix(in oklab, var(--color-danger) 86%, #000);
}

.ds-btn-lg { height: 42px; padding: 0 18px; font-size: 14px; }
.ds-btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.ds-btn-block { width: 100%; }

/* ------------------------------------------------------------
   ds-input, ds-label, ds-select
   ------------------------------------------------------------ */
.ds-label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0;
}
.ds-label-hint { color: var(--color-text-muted); font-weight: 400; }

.ds-input, .ds-select, .ds-textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--color-text-primary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  transition: border-color 0.12s, box-shadow 0.12s;
  outline: none;
}
.ds-textarea { height: auto; padding: 10px 12px; min-height: 80px; resize: vertical; line-height: 1.5; }
.ds-input:focus, .ds-select:focus, .ds-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-ring);
}
.ds-input::placeholder, .ds-textarea::placeholder { color: var(--color-text-faint); }
.ds-select { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
/* Kompakte Variante für dichte Filter-/Toolbar-Zeilen (z. B. Schreiben-Liste, Worker-Log). */
.ds-select-sm,
.ds-input-sm {
    font-size: 11.5px;
    padding: 2px 6px;
    height: 26px;
}

/* ------------------------------------------------------------
   ds-badge
   ------------------------------------------------------------ */
.ds-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  height: 22px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--radius-pill);
  background: var(--color-neutral-bg);
  color: var(--color-neutral-text);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.ds-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.ds-badge-success { background: var(--color-success-bg); color: var(--color-success-text); }
.ds-badge-warning { background: var(--color-warning-bg); color: var(--color-warning-text); }
.ds-badge-danger  { background: var(--color-danger-bg);  color: var(--color-danger-text); }
.ds-badge-info    { background: var(--color-info-bg);    color: var(--color-info-text); }

/* ------------------------------------------------------------
   ds-alert
   ------------------------------------------------------------ */
.ds-alert {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-input);
  background: var(--color-neutral-bg);
  color: var(--color-text-secondary);
  font-size: 13px;
  border: 1px solid transparent;
}
.ds-alert-info    { background: var(--color-info-bg);    color: var(--color-info-text); }
.ds-alert-warning { background: var(--color-warning-bg); color: var(--color-warning-text); }
.ds-alert-danger  { background: var(--color-danger-bg);  color: var(--color-danger-text); }
.ds-alert-success { background: var(--color-success-bg); color: var(--color-success-text); }

/* Sidebar-nav-Stile (.ds-nav-item, .ds-nav-icon) leben in NavItem.razor.css;
   .ds-nav-section in Sidebar.razor.css. */

/* ------------------------------------------------------------
   Tables
   ------------------------------------------------------------ */
.ds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ds-table thead th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
  white-space: nowrap;
}
.ds-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  vertical-align: middle;
}
.ds-table tbody tr { transition: background 0.1s; }
.ds-table tbody tr:hover { background: var(--color-surface-hover); cursor: pointer; }
.ds-table tbody tr:last-child td { border-bottom: 0; }
.ds-table .num { font-family: var(--font-mono); font-size: 12px; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.ds-table-filter-row th { padding: 6px 16px; background: var(--color-bg-subtle); border-bottom: 1px solid var(--color-border); }
.ds-table-filter-input {
  width: 100%; box-sizing: border-box;
  height: 28px; padding: 0 8px;
  font-size: 12px; font-family: inherit;
  border: 1px solid var(--color-border); border-radius: 6px;
  background: var(--color-surface); color: var(--color-text-primary);
  outline: none; transition: border-color 0.15s;
}
.ds-table-filter-input::placeholder { color: var(--color-text-muted); }
.ds-table-filter-input:focus { border-color: var(--color-primary); }
.ds-table-filter-select {
  width: 100%; box-sizing: border-box;
  height: 28px; padding: 0 24px 0 8px;
  font-size: 12px; font-family: inherit;
  border: 1px solid var(--color-border); border-radius: 6px;
  background: var(--color-surface); color: var(--color-text-primary);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
  outline: none; cursor: pointer; transition: border-color 0.15s;
}
.ds-table-filter-select:focus { border-color: var(--color-primary); }

/* Layout-Stile (.app-shell, .app-sidebar, .app-topbar, .app-content,
   .sidebar-brand) leben in MainLayout/Sidebar/Topbar.razor.css. */

.page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 32px 80px;
}
/* Volle Breite für Seiten, die den Platz brauchen (z. B. Aussendungs-Detail mit
   Liste + PDF-Vorschau). Padding der .page bleibt erhalten. */
.page-wide {
  max-width: none;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.page-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  margin: 0;
}
/* FocusOnNavigate (Routes.razor) setzt nach jeder Navigation den Fokus programmatisch
   auf die h1, damit Tastatur-/Screenreader-Nutzer am Hauptinhalt landen. Der Browser-
   Fokusrahmen stört dabei optisch; bei echter Tastaturnavigation (:focus-visible) bleibt
   er erhalten. */
.page-title:focus:not(:focus-visible) { outline: none; }
.page-subtitle {
  font-size: 13.5px;
  color: var(--color-text-muted);
  margin: 4px 0 0;
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
}
.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.stat-value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat-trend-up   { color: var(--color-success-text); }
.stat-trend-down { color: var(--color-danger-text); }

/* Dashboard KPI cards (farbig, mit Icon-Chip) */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.kpi-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
}
.kpi-card--info    { border-left-color: var(--color-info); }
.kpi-card--primary { border-left-color: var(--color-primary); }
.kpi-card--success { border-left-color: var(--color-success); }
.kpi-card--danger  { border-left-color: var(--color-danger); }

.kpi-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--color-neutral-bg);
  color: var(--color-neutral-text);
}
.kpi-card--info    .kpi-icon { background: var(--color-info-bg);      color: var(--color-info-text); }
.kpi-card--primary .kpi-icon { background: var(--color-primary-soft); color: var(--color-primary); }
.kpi-card--success .kpi-icon { background: var(--color-success-bg);   color: var(--color-success-text); }
.kpi-card--danger  .kpi-icon { background: var(--color-danger-bg);    color: var(--color-danger-text); }

.kpi-body { min-width: 0; }
.kpi-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
}
.kpi-value {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  font-variant-numeric: tabular-nums;
}
.kpi-hint {
  font-size: 11.5px;
  color: var(--color-text-faint);
}

/* Inline-Balken in Tabellen (Schreiben-Anzahl) */
.kpi-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.kpi-bar-track {
  flex: 1 1 auto;
  height: 6px;
  min-width: 32px;
  background: var(--color-bg-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.kpi-bar-fill {
  display: block;
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-pill);
}

@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Topbar (.topbar-tenant, .tenant-*, .avatar, .dropdown*, .breadcrumb)
   leben in Topbar.razor.css. */

/* Tweaks panel */
.tweaks-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 280px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  overflow: hidden;
  animation: dd-in 0.16s ease-out;
}
.tweaks-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
}
.tweaks-title { font-size: 12px; font-weight: 600; color: var(--color-text-primary); letter-spacing: 0.02em; text-transform: uppercase; }
.tweaks-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; }
.tweak-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tweak-label { font-size: 13px; color: var(--color-text-secondary); }

/* Segmented control */
.segmented {
  display: inline-flex;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.segmented button {
  border: 0;
  background: transparent;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.segmented button.active {
  background: var(--color-surface);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-xs);
}

/* Progress bar */
.progress {
  position: relative;
  height: 8px;
  background: var(--color-bg-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-pill);
  transition: width 0.4s ease-out;
}
.progress-fill.indeterminate {
  width: 35% !important;
  animation: progress-indet 1.4s ease-in-out infinite;
}
@keyframes progress-indet {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* Chart */
.chart-wrap { position: relative; height: 220px; padding: 4px; }

/* Wizard */
.wizard-shell {
  position: fixed;
  inset: 0;
  background: var(--color-bg-app);
  z-index: 200;
  display: grid;
  grid-template-columns: 280px 1fr 340px;
  animation: wizard-in 0.2s ease-out;
}
@keyframes wizard-in { from { opacity: 0; } to { opacity: 1; } }
.wizard-rail {
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
}
.wizard-rail-title {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}
.wizard-rail h2 { font-size: 18px; margin: 0 0 28px; font-weight: 600; color: var(--color-text-primary); letter-spacing: -0.01em; }
.wizard-steps { display: flex; flex-direction: column; gap: 2px; }
.wizard-step {
  position: relative;
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 8px;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
}
.wizard-step:hover { background: var(--color-surface-hover); }
.wizard-step-dot {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  color: var(--color-text-muted);
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}
.wizard-step.done .wizard-step-dot { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.wizard-step.active .wizard-step-dot { background: var(--color-primary-soft); border-color: var(--color-primary); color: var(--color-primary); }
.wizard-step-label { font-size: 13px; color: var(--color-text-secondary); font-weight: 500; line-height: 1.3; padding-top: 2px; }
.wizard-step.active .wizard-step-label { color: var(--color-text-primary); }
.wizard-step-sub { font-size: 11.5px; color: var(--color-text-muted); margin-top: 2px; font-weight: 400; }
.wizard-step-connector {
  position: absolute;
  left: 19px; top: 32px;
  width: 1px; height: calc(100% - 28px);
  background: var(--color-border);
}
.wizard-step.done + .wizard-step .wizard-step-connector,
.wizard-step.done .wizard-step-connector { background: var(--color-primary); }

.wizard-main {
  overflow: auto;
  padding: 48px 64px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.wizard-main-inner { max-width: 680px; width: 100%; margin: 0 auto; flex: 1; }
.wizard-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 10px;
}
.wizard-title {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--color-text-primary);
  margin: 0 0 8px;
  line-height: 1.15;
}
.wizard-desc {
  font-size: 15px;
  color: var(--color-text-muted);
  margin: 0 0 36px;
  max-width: 560px;
  line-height: 1.55;
}
.wizard-section { margin-bottom: 32px; }

.wizard-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 64px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.wizard-summary {
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  padding: 28px 24px;
  overflow: auto;
}
.wizard-summary h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin: 0 0 14px;
  font-weight: 600;
}
.summary-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}
.summary-row:last-child { border-bottom: 0; }
.summary-key { font-size: 11.5px; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }
.summary-val { font-size: 13.5px; color: var(--color-text-primary); margin-top: 4px; word-break: break-word; }
.summary-val.muted { color: var(--color-text-muted); font-style: italic; }

/* Option cards for wizard */
.option-grid { display: grid; gap: 12px; }
.option-card {
  position: relative;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 16px;
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.option-card:hover { border-color: var(--color-border-strong); }
.option-card.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  box-shadow: 0 0 0 3px var(--color-primary-ring);
}
.option-card-radio {
  width: 18px; height: 18px;
  border: 1.5px solid var(--color-border-strong);
  border-radius: 50%;
  flex: 0 0 auto;
  margin-top: 1px;
  position: relative;
  background: var(--color-surface);
}
.option-card.selected .option-card-radio { border-color: var(--color-primary); }
.option-card.selected .option-card-radio::after {
  content: ''; position: absolute;
  inset: 3px;
  background: var(--color-primary);
  border-radius: 50%;
}
.option-card-title { font-size: 14px; font-weight: 600; color: var(--color-text-primary); margin: 0; letter-spacing: -0.005em; }
.option-card-desc { font-size: 12.5px; color: var(--color-text-muted); margin: 3px 0 0; line-height: 1.5; }

/* Upload */
.upload-zone {
  border: 1.5px dashed var(--color-border-strong);
  border-radius: 12px;
  padding: 36px 24px;
  text-align: center;
  background: var(--color-bg-subtle);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.upload-zone:hover, .upload-zone.drag {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}
.upload-zone.success {
  border-color: var(--color-success);
  background: var(--color-success-bg);
  border-style: solid;
}
.upload-zone.error {
  border-color: var(--color-danger);
  background: var(--color-danger-bg);
  border-style: solid;
}

/* Pipeline step list */
.pipeline-list { display: flex; flex-direction: column; }
.pipeline-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}
.pipeline-step:last-child { border-bottom: 0; }
.pipeline-step-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--color-border);
}
.pipeline-step.running .pipeline-step-icon {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
  border-color: var(--color-warning);
  animation: pulse-warn 1.4s ease-in-out infinite;
}
.pipeline-step.done .pipeline-step-icon {
  background: var(--color-success-bg);
  color: var(--color-success-text);
  border-color: var(--color-success);
}
.pipeline-step.failed .pipeline-step-icon {
  background: var(--color-danger-bg);
  color: var(--color-danger-text);
  border-color: var(--color-danger);
}
@keyframes pulse-warn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}
.pipeline-step-body { flex: 1; min-width: 0; }
.pipeline-step-title { font-size: 13.5px; font-weight: 500; color: var(--color-text-primary); }
.pipeline-step-sub { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; font-family: var(--font-mono); }

/* Spinner */
.spinner {
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13.5px;
}

/* Filter chips */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  flex-wrap: wrap;
}
.search-box {
  position: relative;
  flex: 1;
  max-width: 320px;
}
.search-box input {
  width: 100%;
  height: 34px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.search-box input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-ring); }
.search-box svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--color-text-muted); }

/* Simulation banner */
.simulate-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(90deg, var(--color-primary-soft), transparent);
  border: 1px solid var(--color-primary);
  border-radius: 10px;
  margin-bottom: 16px;
}
.simulate-banner .pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  animation: pulse-dot 1.4s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.4); }
}

/* Toast */
.toast-stack {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 300;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  color: var(--color-text-primary);
  min-width: 280px;
  animation: toast-in 0.2s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.toast.success { border-left-color: var(--color-success); }
.toast.danger  { border-left-color: var(--color-danger); }
.toast.warning { border-left-color: var(--color-warning); }

/* Tooltip */
.tt-wrap { position: relative; display: inline-flex; }
.tt-bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #f1f5f9;
  font-size: 11.5px;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 50;
  font-weight: 500;
  box-shadow: var(--shadow-md);
}
.tt-wrap:hover .tt-bubble { opacity: 1; }
.tt-bubble::after {
  content: ''; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #0f172a;
}

/* Divider w/ label */
.divider-label {
  display: flex; align-items: center; gap: 12px;
  color: var(--color-text-faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 12px 0;
  font-weight: 600;
}
.divider-label::before, .divider-label::after {
  content: ''; flex: 1; height: 1px; background: var(--color-border);
}

/* Focus styling */
input:focus-visible, select:focus-visible, textarea:focus-visible,
button:focus-visible {
  outline-offset: 2px;
}

/* Checkbox */
.ds-check {
  width: 16px; height: 16px;
  border: 1.5px solid var(--color-border-strong);
  border-radius: 4px;
  display: inline-grid;
  place-items: center;
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  flex: 0 0 auto;
}
.ds-check.checked {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.ds-check.checked svg { color: #fff; }

/* Disabled button look w/ tooltip */
.btn-gated { position: relative; }

/* ------------------------------------------------------------
   Modal (PDF preview / AZP report)
   ------------------------------------------------------------ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 250;
  display: grid;
  place-items: center;
  padding: 40px;
  animation: dd-in 0.15s ease-out;
}
html[data-theme="dark"] .modal-backdrop { background: rgba(0, 0, 0, 0.7); }
.modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border);
  gap: 12px;
}
.modal-title { font-size: 14px; font-weight: 600; color: var(--color-text-primary); }
.modal-body { flex: 1; overflow: auto; background: var(--color-bg-subtle); padding: 24px; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--color-border);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* Paper (for PDF preview + AZP) */
.paper {
  background: #ffffff;
  color: #0f172a;
  width: 595px;      /* A4 @ 72dpi approx */
  min-height: 842px;
  margin: 0 auto;
  padding: 56px 48px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08), 0 12px 30px rgba(0,0,0,0.12);
  font-family: var(--font-ui);
  font-size: 11px;
  line-height: 1.55;
  border-radius: 2px;
}
html[data-theme="dark"] .paper { box-shadow: 0 1px 2px rgba(0,0,0,0.4), 0 20px 40px rgba(0,0,0,0.6); }

.paper h1 { font-size: 20px; margin: 0 0 4px; letter-spacing: -0.01em; }
.paper h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: #64748b; margin: 28px 0 10px; font-weight: 600; }
.paper .addr-block { font-size: 10px; color: #64748b; padding-bottom: 4px; border-bottom: 1px solid #e2e8f0; margin-bottom: 6px; }
.paper .recipient { margin: 40px 0 32px; font-size: 11px; line-height: 1.6; }
.paper .letter-body p { margin: 0 0 12px; }
.paper table { width: 100%; border-collapse: collapse; font-size: 10px; }
.paper table th, .paper table td { padding: 6px 8px; border-bottom: 1px solid #e2e8f0; text-align: left; }
.paper table th { background: #f8fafc; font-weight: 600; color: #475569; text-transform: uppercase; font-size: 9px; letter-spacing: 0.05em; }
.paper .meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; margin-top: 14px; }
.paper .meta-cell { font-size: 10px; }
.paper .meta-k { color: #64748b; text-transform: uppercase; letter-spacing: 0.04em; font-size: 9px; font-weight: 600; margin-bottom: 2px; }
.paper .meta-v { color: #0f172a; font-weight: 500; }
.paper .stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0 6px; }
.paper .stat-box { border: 1px solid #e2e8f0; border-radius: 6px; padding: 10px 12px; }
.paper .stat-box .n { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.paper .stat-box .l { font-size: 9px; text-transform: uppercase; color: #64748b; letter-spacing: 0.04em; font-weight: 600; }
.paper .brand { display: flex; align-items: center; gap: 8px; }
.paper .brand-swatch { width: 18px; height: 18px; border-radius: 4px; background: #2e3862; }
.paper .signature-line { margin-top: 40px; padding-top: 6px; border-top: 1px solid #cbd5e1; width: 180px; font-size: 9px; color: #64748b; }
.paper .pdf-footer { margin-top: 40px; padding-top: 10px; border-top: 1px solid #e2e8f0; font-size: 9px; color: #94a3b8; display: flex; justify-content: space-between; }
.paper.pdf-simulated .letter-body p:nth-child(odd) { color: #1f2937; }
.paper .bar-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 10px; }
.paper .bar-row .bar { height: 6px; background: #e2e8f0; border-radius: 4px; flex: 1; overflow: hidden; }
.paper .bar-row .bar-fill { height: 100%; background: #2e3862; }

/* Report download banner */
.report-banner {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 22px;
  background:
    radial-gradient(circle at 0% 0%, var(--color-primary-soft), transparent 60%),
    var(--color-surface);
  border: 1.5px solid var(--color-primary);
  border-radius: 14px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px -12px var(--color-primary);
  position: relative;
  overflow: hidden;
}
.report-banner::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--color-primary);
}
.report-banner .rb-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-primary), color-mix(in oklab, var(--color-primary) 60%, black));
  color: #fff;
  display: grid; place-items: center;
  flex: 0 0 auto;
  box-shadow: 0 4px 12px -2px var(--color-primary);
}
.report-banner .rb-icon svg { width: 22px; height: 22px; }
.report-banner .rb-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  background: var(--color-primary-soft);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 4px;
}
.report-banner .rb-title { font-size: 15px; font-weight: 600; color: var(--color-text-primary); letter-spacing: -0.01em; }
.report-banner .rb-sub { font-size: 12.5px; color: var(--color-text-secondary); margin-top: 3px; }

/* AZP Pipeline step — distinct visual treatment */
.pipeline-step.is-azp {
  background: linear-gradient(90deg, var(--color-primary-soft) 0%, transparent 50%);
  border-left: 3px solid var(--color-primary);
  padding-left: 13px;
  margin-left: -16px;
  padding-right: 16px;
  margin-right: -16px;
  border-radius: 0 8px 8px 0;
}
.pipeline-step.is-azp .pipeline-step-icon {
  background: var(--color-surface);
  border: 1.5px solid var(--color-primary);
  color: var(--color-primary);
}
.pipeline-step.is-azp.running .pipeline-step-icon,
.pipeline-step.is-azp.done .pipeline-step-icon {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.pipeline-step.is-azp .pipeline-step-title {
  font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.pipeline-step-tag {
  display: inline-flex; align-items: center;
  font-size: 9.5px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  border: 1px solid color-mix(in oklab, var(--color-primary) 30%, transparent);
}

/* Countdown for AZP generation */
.azp-countdown {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--color-info-bg);
  color: var(--color-info-text);
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13px;
}
.azp-countdown .spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--color-primary);
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal (PDF preview / AZP report) */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  display: grid; place-items: center;
  z-index: 100;
  padding: 40px 24px;
  animation: fadeIn 0.15s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: 0 32px 80px -20px rgba(0,0,0,0.4);
  max-width: 960px;
  width: 100%;
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-subtle);
  gap: 16px;
}
.modal-title { font-size: 14px; font-weight: 600; color: var(--color-text-primary); }
.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--color-canvas);
  display: flex; justify-content: center;
}

/* A4-ish paper for the rendered PDF */
.paper {
  background: #ffffff;
  color: #0f172a;
  width: 100%;
  max-width: 640px;
  padding: 48px 56px;
  box-shadow: 0 2px 20px rgba(15,23,42,0.12);
  border-radius: 2px;
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 1.55;
}
.paper h1 { font-size: 18px; font-weight: 700; margin: 0 0 6px; color: #0f172a; letter-spacing: -0.01em; }
.paper h2 { font-size: 12px; font-weight: 700; margin: 24px 0 8px; text-transform: uppercase; letter-spacing: 0.06em; color: #475569; }
.paper .brand { display: flex; align-items: center; gap: 10px; }
.paper .brand-swatch {
  width: 28px; height: 28px; border-radius: 6px;
  background: #2e3862;
  position: relative;
}
.paper .brand-swatch::after {
  content: '';
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #ff6136;
  bottom: 4px; right: 4px;
}
.paper .recipient {
  margin: 32px 0 24px;
  font-size: 11px;
  line-height: 1.5;
}
.paper .addr-block {
  font-size: 8px;
  color: #64748b;
  border-bottom: 0.5px solid #cbd5e1;
  padding-bottom: 2px;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.paper .letter-body { font-size: 11px; line-height: 1.6; color: #334155; }
.paper .letter-body p { margin: 0 0 10px; }
.paper table { width: 100%; border-collapse: collapse; font-size: 10px; margin: 6px 0 8px; }
.paper table th, .paper table td {
  text-align: left; padding: 6px 8px;
  border-bottom: 0.5px solid #e2e8f0;
}
.paper table th { font-weight: 600; color: #475569; background: #f8fafc; font-size: 9px; text-transform: uppercase; letter-spacing: 0.04em; }
.paper .meta-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin: 16px 0;
}
.paper .meta-cell {
  padding: 10px 12px;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}
.paper .meta-cell:nth-child(2n) { border-right: none; }
.paper .meta-cell:nth-last-child(-n+2) { border-bottom: none; }
.paper .meta-k { font-size: 8.5px; text-transform: uppercase; letter-spacing: 0.06em; color: #94a3b8; font-weight: 600; }
.paper .meta-v { font-size: 11px; color: #0f172a; margin-top: 3px; font-weight: 500; }
.paper .stat-row { display: flex; gap: 10px; margin: 10px 0 6px; }
.paper .stat-box {
  flex: 1; padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  text-align: center;
}
.paper .stat-box .n { font-family: var(--font-mono); font-size: 18px; font-weight: 700; color: #0f172a; }
.paper .stat-box .l { font-size: 8.5px; text-transform: uppercase; letter-spacing: 0.06em; color: #64748b; margin-top: 4px; }

/* Segmented control (Assembled / Raw) */
.segmented {
  display: inline-flex;
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 2px;
}
.segmented button {
  background: transparent;
  border: 0;
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: 6px;
}
.segmented button.active {
  background: var(--color-surface);
  color: var(--color-text-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

/* Gated button (4-eyes block on creator) */
.btn-gated {
  opacity: 0.55;
  cursor: not-allowed !important;
  position: relative;
}
.btn-gated:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: #0f172a;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  z-index: 10;
}

/* Toast */
.toast-stack {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  pointer-events: none;
}
.toast {
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--color-text-primary);
  color: var(--color-surface);
  font-size: 13px; font-weight: 500;
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
  animation: toastIn 0.25s ease-out;
}
.toast.success { background: var(--color-primary); color: #fff; }
.toast.danger { background: var(--color-danger); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }


/* ============================================================
   Konzept-update — additional shell components
   ============================================================ */

/* Tenant-Pill und Breadcrumb leben in Topbar.razor.css. */

/* Hinweis-Leiste — global notices stacked above page content */
.hinweis-stack {
  display: flex; flex-direction: column;
  gap: 8px;
  padding: 12px 28px 0;
}
.hinweis-bar {
  display: flex; align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  border: 1px solid;
}
.hinweis-info {
  background: color-mix(in oklab, var(--color-info) 8%, var(--color-surface));
  border-color: color-mix(in oklab, var(--color-info) 22%, transparent);
  color: var(--color-text-primary);
}
.hinweis-info > svg { color: var(--color-info); flex-shrink: 0; }
.hinweis-warning {
  background: color-mix(in oklab, var(--color-warning) 10%, var(--color-surface));
  border-color: color-mix(in oklab, var(--color-warning) 30%, transparent);
  color: var(--color-text-primary);
}
.hinweis-warning > svg { color: var(--color-warning); flex-shrink: 0; }
.hinweis-danger {
  background: color-mix(in oklab, var(--color-danger) 10%, var(--color-surface));
  border-color: color-mix(in oklab, var(--color-danger) 30%, transparent);
  color: var(--color-text-primary);
}
.hinweis-danger > svg { color: var(--color-danger); flex-shrink: 0; }
.hinweis-success {
  background: color-mix(in oklab, var(--color-success) 8%, var(--color-surface));
  border-color: color-mix(in oklab, var(--color-success) 22%, transparent);
  color: var(--color-text-primary);
}
.hinweis-success > svg { color: var(--color-success); flex-shrink: 0; }

/* Ampel inline */
.ampel {
  display: inline-flex; align-items: center;
  gap: 6px;
  vertical-align: middle;
}


/* ============================================================
   Mailing-Detail: Tabs, Ampel, Historie
   ============================================================ */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  margin-top: 8px;
}
.tab {
  padding: 10px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 0;
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text-muted);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  margin-bottom: -1px;
  transition: color 120ms;
}
.tab:hover { color: var(--color-text-primary); }
.tab.active {
  background: var(--color-bg-card);
  border-color: var(--color-border);
  border-bottom-color: var(--color-bg-card);
  color: var(--color-text-primary);
  font-weight: 600;
}
.tab-count {
  display: inline-block;
  min-width: 20px;
  text-align: center;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tab.active .tab-count {
  background: var(--color-primary-bg);
  color: var(--color-primary);
}

/* Ampel-Dots */
.ampel-dot {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
  flex: 0 0 12px;
}
.ampel-gruen { background: var(--color-success); box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-success) 25%, transparent); }
.ampel-gelb  { background: var(--color-warning); box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-warning) 25%, transparent); }
.ampel-rot   { background: var(--color-danger);  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-danger)  25%, transparent); }

/* ============================================================
   Prozess-Stepper (Aussendungs-Detail): Konfigurieren → … → Versendet
   ============================================================ */
.mailing-stepper {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 16px 4px;
  margin-bottom: 18px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card, 12px);
}
.mailing-step {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  text-align: center;
}
/* Verbindungslinie zwischen den Schritten (hinter den Kreisen). */
.mailing-step:not(:first-child)::before {
  content: "";
  position: absolute;
  top: 15px;            /* vertikale Mitte des Kreises (32px / 2 - 1px) */
  right: 50%;
  left: -50%;
  height: 2px;
  background: var(--color-border);
  z-index: 0;
}
.mailing-step.is-done::before,
.mailing-step.is-active::before {
  background: color-mix(in srgb, var(--color-success) 55%, var(--color-border));
}
.mailing-step-circle {
  position: relative;
  z-index: 1;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 600;
  background: var(--color-bg-subtle);
  border: 2px solid var(--color-border);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
.mailing-step-label {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.25;
  padding: 0 4px;
}
/* Erledigt (success). */
.mailing-step.is-done .mailing-step-circle {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #fff;
}
.mailing-step.is-done .mailing-step-label {
  color: var(--color-text-secondary);
}
/* Aktiv (info, fett). */
.mailing-step.is-active .mailing-step-circle {
  background: var(--color-info);
  border-color: var(--color-info);
  color: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-info) 18%, transparent);
}
.mailing-step.is-active .mailing-step-label {
  color: var(--color-text-primary);
  font-weight: 600;
}
/* Laufender, transienter Schritt — Lade-Spinner statt Nummer/Häkchen. */
.mailing-step-spinner {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, #fff 45%, transparent);
  border-top-color: #fff;
  animation: mailing-step-spin 0.8s linear infinite;
}
@keyframes mailing-step-spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .mailing-step-label { font-size: 10.5px; }
}

/* Dezenter dashed-Hinweis im Entwurf: noch keine Schreiben. */
.mailing-no-letters-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-card, 12px);
  background: transparent;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

/* Ablehnungs-Hinweis des Freigebers — gelbe Karte über der Konfiguration im Entwurf. */
.mailing-rejection-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 18px;
  border: 1px solid var(--color-warning-text);
  border-left-width: 4px;
  border-radius: var(--radius-card, 12px);
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
}
.mailing-rejection-note strong {
  display: block;
  font-size: 13.5px;
  margin-bottom: 2px;
}
.mailing-rejection-note p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.mailing-rejection-note-label {
  font-weight: 600;
  white-space: nowrap;
}

/* Kompakte Konfig-Zusammenfassung (Status „Produced"): Versandziel · Trennung · … */
.mailing-config-summary {
  display: flex;
  align-items: center;
  gap: 10px 18px;
  flex-wrap: wrap;
}
.mailing-config-summary-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12.5px;
}
.mailing-config-summary-item .label {
  color: var(--color-text-muted);
}
.mailing-config-summary-item .value {
  color: var(--color-text-primary);
  font-weight: 500;
}

/* Aufklappbare Konfiguration (Status „Produced"+): native Disclosure-Marker ausblenden,
   eigener Chevron im Summary-Markup. */
.mailing-config-collapse > summary { list-style: none; }
.mailing-config-collapse > summary::-webkit-details-marker { display: none; }

/* Status-Tabs (Aussendungen-Liste) */
.status-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  margin-bottom: 14px;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}
.status-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  height: 30px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: transparent;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 7px;
  cursor: pointer;
  transition: background 100ms, color 100ms;
  white-space: nowrap;
}
.status-tabs button:hover { color: var(--color-text-primary); background: color-mix(in srgb, var(--color-bg-card) 60%, transparent); }
.status-tabs button.active {
  background: var(--color-bg-card);
  color: var(--color-text-primary);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 0 0 1px var(--color-border);
}
.status-tabs button .count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
  background: var(--color-bg-card);
  border-radius: 9px;
  border: 1px solid var(--color-border);
}
.status-tabs button.active .count {
  color: var(--color-primary);
  background: var(--color-primary-bg);
  border-color: transparent;
}

/* Filter-Chips */
.filter-chip {
  padding: 6px 12px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 100ms;
}
.filter-chip .num { font-variant-numeric: tabular-nums; opacity: 0.7; font-size: 11px; }
.filter-chip:hover { background: var(--color-bg-subtle); }
.filter-chip.active {
  background: var(--color-text-primary);
  color: var(--color-bg-card);
  border-color: var(--color-text-primary);
}
.filter-chip.active .num { opacity: 0.85; }
.filter-chip.rot.active   { background: var(--color-danger);  border-color: var(--color-danger); }
.filter-chip.gelb.active  { background: var(--color-warning); border-color: var(--color-warning); }
.filter-chip.gruen.active { background: var(--color-success); border-color: var(--color-success); }

/* Versandart-Chip */
.versandart-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
}
.versandart-chip-modus {
  color: var(--color-text-muted);
  font-weight: 400;
  margin-left: 2px;
}

/* Aussendung-Historie Timeline */
.historie-list {
  padding: 24px 24px 8px;
}
.historie-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.historie-rail {
  flex: 0 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: stretch;
  padding-top: 6px;
}
.historie-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex: 0 0 12px;
  border: 2px solid var(--color-bg-card);
  outline: 2px solid var(--color-border);
}
.historie-dot.tone-success { background: var(--color-success); outline-color: color-mix(in srgb, var(--color-success) 35%, transparent); }
.historie-dot.tone-warning { background: var(--color-warning); outline-color: color-mix(in srgb, var(--color-warning) 35%, transparent); }
.historie-dot.tone-danger  { background: var(--color-danger);  outline-color: color-mix(in srgb, var(--color-danger)  35%, transparent); }
.historie-dot.tone-info    { background: var(--color-info);    outline-color: color-mix(in srgb, var(--color-info)    35%, transparent); }
.historie-dot.tone-neutral { background: var(--color-text-muted); outline-color: var(--color-border); }
.historie-line {
  flex: 1;
  width: 2px;
  background: var(--color-border);
  margin-top: 4px;
}

/* ============================================================
   Wizard v2 — embedded in shell, top stepper, summary inside card
   ============================================================ */
.wiz2 {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 28px 28px;
  min-height: calc(100vh - var(--topbar-h));
}
.wiz2-main {
  display: flex; flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-xs);
  flex: 1;
  min-height: 0;
}
.wiz2-header {
  padding: 20px 28px 0;
}
.wiz2-title-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.wiz2-title-row h1 { white-space: nowrap; }
.wiz2-title-row h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--color-text-primary);
}
.wiz2-title-row .draft-badge {
  font-size: 11.5px;
  color: var(--color-text-muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.wiz2-title-row .draft-badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-success) 25%, transparent);
}

/* Horizontal stepper */
.wiz2-stepper {
  display: flex;
  gap: 0;
  padding: 8px 0 18px;
  border-bottom: 1px solid var(--color-border);
}
.wiz2-step {
  flex: 1;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 14px 8px 0;
  cursor: default;
  position: relative;
  border-left: 3px solid transparent;
  padding-left: 14px;
  user-select: none;
  transition: background 0.12s;
}
.wiz2-step.clickable { cursor: pointer; }
.wiz2-step.clickable:hover { background: var(--color-surface-hover); border-radius: 6px; }
.wiz2-step.active { border-left-color: var(--color-primary); }
.wiz2-step.done { border-left-color: var(--color-success); }
.wiz2-step-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 600;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}
.wiz2-step.active .wiz2-step-num {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.wiz2-step.done .wiz2-step-num {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #fff;
}
.wiz2-step-body { min-width: 0; }
.wiz2-step-label { font-size: 12.5px; font-weight: 600; color: var(--color-text-secondary); line-height: 1.25; }
.wiz2-step.active .wiz2-step-label { color: var(--color-text-primary); }
.wiz2-step-sub { font-size: 11px; color: var(--color-text-faint); margin-top: 2px; line-height: 1.3; }

/* Step content area */
.wiz2-content {
  flex: 1;
  padding: 26px 28px 28px;
  overflow: auto;
}
.wiz2-content h2 {
  margin: 0 0 6px;
  font-size: 18px; font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
}
.wiz2-content .lead {
  font-size: 13.5px;
  color: var(--color-text-muted);
  margin: 0 0 22px;
  line-height: 1.55;
  max-width: 640px;
}
.wiz2-section { margin-bottom: 22px; }
.wiz2-section + .wiz2-section { padding-top: 0; }
.wiz2-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wiz2-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* Wizard verlassen — Entwurf-Summary in Confirm-Dialog */
.leave-summary {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-bg-subtle);
  padding: 14px 16px;
}
.leave-summary-head {
  display: flex; gap: 12px; align-items: flex-start;
}
.leave-summary-head > svg {
  flex: 0 0 auto;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.leave-summary-head .t {
  font-size: 13.5px; font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 3px;
}
.leave-summary-head .s {
  font-size: 12.5px; color: var(--color-text-muted);
  line-height: 1.45;
}

/* Step 3 — Sammel-PDF + Split-Modus side-by-side */
.step3-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
  margin-top: 8px;
}
.step3-col { min-width: 0; display: flex; flex-direction: column; }
.step3-col > .wiz2-section { margin-bottom: 0; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.step3-col > .wiz2-section + .wiz2-section { margin-top: 14px; }
.step3-col .wiz2-section > .upload-zone,
.step3-col .wiz2-section > .split-placeholder,
.step3-col .wiz2-section > .detect-banner,
.step3-col .wiz2-section > .wiz2-grid-2 { flex: 1; }
.step3-col .wiz2-grid-2 { grid-template-columns: 1fr; gap: 10px; align-content: start; }
.step3-col .option-card { padding: 12px 14px; }

.split-placeholder {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 24px;
  border: 1.5px dashed var(--color-border-strong);
  border-radius: 12px;
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
}
.split-placeholder .ic {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--color-surface-3, rgba(255,255,255,0.04));
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.split-placeholder .t { font-weight: 600; color: var(--color-text); font-size: 13.5px; margin-bottom: 4px; }
.split-placeholder .s { font-size: 12.5px; line-height: 1.5; }

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

/* Footer */
.wiz2-footer {
  padding: 14px 28px;
  border-top: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  background: var(--color-bg-subtle);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
}
.wiz2-footer .save-hint {
  font-size: 11.5px; color: var(--color-text-muted);
  display: inline-flex; align-items: center; gap: 6px;
}

/* Summary block — inside main card, bottom-aligned horizontal strip */
.wiz2-summary {
  background: var(--color-bg-subtle);
  border-top: 1px solid var(--color-border);
  overflow: hidden;
  flex: 0 0 auto;
}
.wiz2-summary-body { overflow: visible; }
.wiz2-summary-head {
  padding: 6px 14px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
  display: flex; align-items: center; gap: 12px;
}
.wiz2-summary-head h3 {
  margin: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  font-weight: 600;
}
.wiz2-summary-head .live-pill {
  font-size: 10.5px; color: var(--color-success-text);
  display: inline-flex; align-items: center; gap: 5px;
  font-weight: 600;
}
.wiz2-summary-head .live-pill::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-success);
}
.wiz2-summary-body {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0;
}
.wiz2-srow {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 14px;
  border-right: 1px solid var(--color-border);
  min-width: 0;
}
.wiz2-srow:last-child { border-right: 0; }
.wiz2-srow .k {
  font-size: 9.5px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.wiz2-srow .v {
  font-size: 12px;
  color: var(--color-text-primary);
  word-break: break-word;
  line-height: 1.35;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wiz2-srow .v.muted { color: var(--color-text-faint); font-style: italic; }
.wiz2-srow .v.mono { font-family: var(--font-mono); font-size: 11.5px; }
.wiz2-srow .v .pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 11px; font-weight: 600;
  font-family: var(--font-ui);
}

/* Pipeline mini in summary (Review step only) */
.wiz2-pipeline-card {
  padding: 14px 20px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  align-items: center;
}
.wiz2-pipeline-card .h {
  font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--color-text-muted);
  font-weight: 600;
}
.wiz2-pipeline-card .row {
  font-size: 12px; color: var(--color-text-secondary);
  font-family: var(--font-mono);
  display: flex; gap: 16px; flex-wrap: wrap;
}

/* Compact dropdown row (Kostenträger / Mail-Vorlage) */
.combo-row {
  display: flex; align-items: stretch; gap: 8px;
}
.combo-row .ds-select { flex: 1; }
.combo-current {
  display: flex; align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  background: var(--color-bg-subtle);
  margin-top: 8px;
}
.combo-current .ico {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  display: grid; place-items: center;
  flex: 0 0 auto;
}
.combo-current .body { min-width: 0; flex: 1; }
.combo-current .name {
  font-size: 13px; font-weight: 600; color: var(--color-text-primary);
  display: flex; align-items: center; gap: 6px;
}
.combo-current .meta {
  font-size: 11.5px; color: var(--color-text-muted); margin-top: 2px;
  font-family: var(--font-mono);
}

/* Auto-detect banner (NewDoc) */
.detect-banner {
  display: flex; gap: 12px;
  padding: 12px 14px;
  border: 1px solid color-mix(in oklab, var(--color-success) 30%, transparent);
  background: color-mix(in oklab, var(--color-success) 8%, var(--color-surface));
  border-radius: 10px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.detect-banner .ic {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--color-success);
  color: #fff;
  display: grid; place-items: center;
  flex: 0 0 auto;
}
.detect-banner .t {
  font-size: 13px; font-weight: 600; color: var(--color-text-primary);
}
.detect-banner .s {
  font-size: 12px; color: var(--color-text-secondary); margin-top: 2px; line-height: 1.5;
}
.detect-banner .actions {
  margin-top: 8px;
  display: flex; gap: 8px;
}

/* Inline file row for attachments */
.attach-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  margin-bottom: 6px;
}
.attach-row .ico {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--color-danger-bg); color: var(--color-danger);
  display: grid; place-items: center; flex: 0 0 auto;
}
.attach-row.local .ico {
  background: var(--color-info-bg); color: var(--color-info);
}
.attach-row .body { flex: 1; min-width: 0; }
.attach-row .name { font-size: 13px; font-weight: 500; color: var(--color-text-primary); }
.attach-row .meta { font-size: 11px; color: var(--color-text-muted); margin-top: 1px; font-family: var(--font-mono); }
.attach-row .tag {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 2px 6px; border-radius: 4px;
  background: var(--color-info-bg); color: var(--color-info-text);
}

/* Berechtigungs-Hinweis (gated) */
.perm-gate {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--color-bg-subtle);
  border: 1px dashed var(--color-border-strong);
  border-radius: 8px;
  font-size: 12px; color: var(--color-text-muted);
  margin-top: 8px;
}
.perm-gate svg { color: var(--color-text-faint); flex: 0 0 auto; }

/* Modal — Kostenträger anlegen */
.modal-md { max-width: 720px; width: calc(100vw - 80px); }
.modal-md .modal-body { padding: 26px 28px; background: var(--color-surface); }
.kt-form { display: flex; flex-direction: column; gap: 18px; }
.kt-form .row { display: grid; gap: 14px; }
.kt-form .row.r1 { grid-template-columns: 2fr 1fr 1fr; }
.kt-form .row.r2 { grid-template-columns: 3fr 1fr 2fr; }
.kt-form .field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kt-form .field .ds-label { margin: 0; }
.kt-form .field .ds-input,
.kt-form .field .ds-select { height: 40px; font-size: 13.5px; }
.kt-form .info-strip {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 14px;
  background: var(--color-info-bg); color: var(--color-info-text);
  border-radius: 8px;
  font-size: 12px; line-height: 1.5;
}
.kt-form .info-strip svg { margin-top: 2px; flex: 0 0 auto; }

.modal-sm { max-width: 460px; width: calc(100vw - 80px); }
.modal-sm .modal-body { padding: 18px 22px; background: var(--color-surface); }

/* Default summary body — single row in horizontal strip */
.wiz2-srow { border-right: 0 !important; }
.wiz2.layout-b .wiz2-summary { background: var(--color-bg-subtle); }

/* Review step — full-width inside main card */
.wiz2.review-mode .wiz2-content { padding: 28px 32px 24px; }
.review-full { display: flex; flex-direction: column; gap: 22px; }
.review-head h2 {
  margin: 0 0 6px;
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--color-text-primary);
}
.review-head .lead {
  font-size: 13.5px; color: var(--color-text-muted);
  margin: 0; line-height: 1.55; max-width: 820px;
}
.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.review-block {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  padding: 16px 18px 18px;
  display: flex; flex-direction: column;
  min-width: 0;
}
.review-block-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--color-text-muted); font-weight: 600;
  padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}
.review-block-head svg { width: 14px; height: 14px; }
.review-dl { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.review-dl > div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  align-items: baseline;
}
.review-dl dt {
  font-size: 11.5px; color: var(--color-text-muted);
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600;
  margin: 0;
}
.review-dl dd {
  margin: 0;
  font-size: 13.5px; color: var(--color-text-primary);
  line-height: 1.45; word-break: break-word;
}
.review-dl dd .sub {
  display: block; font-size: 11.5px; color: var(--color-text-muted);
  margin-top: 3px;
}
.review-dl dd.mono, .review-dl dd .mono { font-family: var(--font-mono); }
.review-dl dd .muted, .review-dl .muted {
  color: var(--color-text-faint); font-style: italic;
}
.review-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px;
}
.review-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0;
}
.review-pipeline {
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 14px 18px;
}
.review-pipeline .h {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--color-text-muted); font-weight: 600;
  margin-bottom: 8px;
}
.review-pipeline .steps {
  display: flex; flex-wrap: wrap; gap: 10px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--color-text-secondary);
  align-items: center;
}
.review-pipeline .arr { color: var(--color-text-faint); }

/* Review step — main card stays, summary strip is hidden via JSX */
.wiz2.review-mode .wiz2-summary {
  flex: 1; display: flex; flex-direction: column;
  position: static; max-height: none;
  min-height: calc(100vh - var(--topbar-h) - 48px);
}
.wiz2.review-mode .wiz2-summary-head { padding: 18px 28px; }
.wiz2.review-mode .wiz2-summary-head h3 {
  font-size: 18px; text-transform: none; letter-spacing: -0.01em;
  color: var(--color-text-primary);
}
.wiz2.review-mode .review-stepper {
  padding: 4px 28px 14px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
}
.wiz2.review-mode .wiz2-summary-body {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  flex: 0 0 auto;
}
.wiz2.review-mode .wiz2-srow { padding: 18px 24px; border-right: 1px solid var(--color-border) !important; }
.wiz2.review-mode .wiz2-srow:nth-child(3n) { border-right: 0 !important; }
.wiz2.review-mode .wiz2-srow .k { font-size: 11px; }
.wiz2.review-mode .wiz2-srow .v { font-size: 14px; }
.wiz2.review-mode .review-body {
  padding: 24px 28px;
  flex: 1;
}
.wiz2.review-mode .review-body h2 {
  margin: 0 0 6px;
  font-size: 18px; font-weight: 600;
  color: var(--color-text-primary); letter-spacing: -0.01em;
}
.wiz2.review-mode .review-body .lead {
  font-size: 13.5px; color: var(--color-text-muted);
  margin: 0 0 18px; line-height: 1.55; max-width: 720px;
}
.wiz2.review-mode .wiz2-footer-stuck {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
  padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
}

/* Tooltip wrapper */
.tt-wrap { position: relative; display: inline-block; }
.tt-wrap .tt-bubble {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-text-primary);
  color: var(--color-bg-card);
  font-size: 11.5px;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 1000;
  transition: opacity 120ms;
}
.tt-wrap:hover .tt-bubble { visibility: visible; opacity: 1; }

/* ============================================================
   Native <dialog>-Modals — Backdrop, Surface, Header, Footer
   ============================================================ */
dialog.ds-dialog {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    background: var(--color-surface);
    color: var(--color-text-primary);
    padding: 0;
    box-shadow: var(--shadow-lg);
    max-width: min(92vw, 1100px);
    max-height: 88vh;
    overflow: hidden;
}
/* WICHTIG: Browser-Default ist `display: none` für geschlossene <dialog>.
   Flex-Layout nur im offenen Zustand, sonst zeigen sie sich inline. */
dialog.ds-dialog[open] {
    display: flex;
    flex-direction: column;
}
dialog.ds-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
}
html[data-theme="dark"] dialog.ds-dialog::backdrop {
    background: rgba(0, 0, 0, 0.6);
}
.ds-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--color-border);
}
.ds-dialog-header h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
    letter-spacing: -0.005em;
}
.ds-dialog-body {
    padding: 20px;
    overflow: auto;
    flex: 1 1 auto;
}
.ds-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-subtle);
}
.ds-dialog-close {
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 4px;
    border-radius: var(--radius-input);
    line-height: 0;
}
.ds-dialog-close:hover { background: var(--color-surface-hover); color: var(--color-text-primary); }

/* ============================================================
   Sidebar — Collapsed-Variante
   Selectoren liegen hier (statt im isolierten Sidebar.razor.css),
   weil die [data-sidebar-collapsed]-Marke am .app-shell hängt.
   ============================================================ */
.app-shell[data-sidebar-collapsed="true"] .sidebar-brand {
    flex-direction: column;
    padding: 14px 0;
    gap: 8px;
}
.app-shell[data-sidebar-collapsed="true"] .sidebar-brand > div:last-child {
    display: none;
}
/* Toggle bleibt im eingeklappten Zustand erreichbar (kein margin-left:auto,
   das ihn aus den 64px herausschieben würde). */
.app-shell[data-sidebar-collapsed="true"] .sidebar-toggle {
    margin-left: 0;
}
.app-shell[data-sidebar-collapsed="true"] .ds-nav-section {
    display: none;
}
.app-shell[data-sidebar-collapsed="true"] .ds-nav-item .ds-nav-label {
    display: none;
}
.app-shell[data-sidebar-collapsed="true"] .ds-nav-item {
    justify-content: center;
}
.app-shell[data-sidebar-collapsed="true"] .sidebar-footer {
    display: none;
}
.app-shell[data-sidebar-collapsed="true"] .sidebar-toggle-icon {
    transform: rotate(180deg);
}
/* Eingeklappt: breites Logo aus, quadratische Bildmarke an (verhindert das abgeschnittene
   Logo in der schmalen Spalte). Die Klassen kommen aus dem scoped Sidebar.razor.css; die
   Collapse-Marke hängt am .app-shell, deshalb leben diese Regeln hier global. */
.app-shell[data-sidebar-collapsed="true"] .sidebar-brand-full {
    display: none;
}
.app-shell[data-sidebar-collapsed="true"] .sidebar-brand-mark {
    display: flex;
}

.sidebar-toggle {
    margin-left: auto;
    background: transparent;
    border: 0;
    color: var(--color-text-muted);
    padding: 4px;
    border-radius: var(--radius-input);
    cursor: pointer;
    line-height: 0;
    display: grid;
    place-items: center;
}
.sidebar-toggle:hover {
    background: var(--color-surface-hover);
    color: var(--color-text-primary);
}
.sidebar-toggle-icon {
    transition: transform 0.16s ease-out;
}

/* ============================================================
   Toaster (bottom-right)
   ============================================================ */
.ds-toaster {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1100;
    pointer-events: none;
}
.ds-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 280px;
    max-width: 420px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-input);
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    color: var(--color-text-primary);
    pointer-events: auto;
    animation: toast-in 0.16s ease-out;
}
@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ds-toast-msg { flex: 1; line-height: 1.4; }
.ds-toast-close {
    background: transparent;
    border: 0;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 2px;
    line-height: 0;
    border-radius: 4px;
}
.ds-toast-close:hover { background: var(--color-surface-hover); color: var(--color-text-primary); }

.ds-toast-success { border-left: 3px solid var(--color-success); }
.ds-toast-success > svg:first-of-type { color: var(--color-success); }
.ds-toast-warning { border-left: 3px solid var(--color-warning); }
.ds-toast-warning > svg:first-of-type { color: var(--color-warning); }
.ds-toast-danger  { border-left: 3px solid var(--color-danger); }
.ds-toast-danger  > svg:first-of-type { color: var(--color-danger); }
.ds-toast-info    { border-left: 3px solid var(--color-info); }
.ds-toast-info    > svg:first-of-type { color: var(--color-info); }

/* ============================================================
   Drawer (right side panel — inspection surface)
   ============================================================ */
.ds-drawer-shell {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 900;
}
.ds-drawer-scrim {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.32);
    opacity: 0;
    transition: opacity 0.16s ease-out;
}
.ds-drawer {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: min(420px, 90vw);
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform 0.18s ease-out;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
}
.ds-drawer-shell.ds-drawer-open { pointer-events: auto; }
.ds-drawer-shell.ds-drawer-open .ds-drawer-scrim { opacity: 1; }
.ds-drawer-shell.ds-drawer-open .ds-drawer { transform: translateX(0); }
.ds-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-subtle);
}
.ds-drawer-header h2 { margin: 0; font-size: 14px; font-weight: 600; color: var(--color-text-primary); }
.ds-drawer-close {
    background: transparent;
    border: 0;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    line-height: 0;
    border-radius: var(--radius-input);
}
.ds-drawer-close:hover { background: var(--color-surface-hover); color: var(--color-text-primary); }
.ds-drawer-body { padding: 16px 20px; overflow: auto; flex: 1 1 auto; }

/* ============================================================
   Hinweis-Leiste (Banners above content)
   ============================================================ */
.ds-banner-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 24px 0;
}
.ds-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-input);
    font-size: 12.5px;
    color: var(--color-text-primary);
    background: var(--color-surface);
}
.ds-banner-msg { flex: 1; line-height: 1.4; }
.ds-banner-action {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-primary);
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-btn);
    background: var(--color-surface);
}
.ds-banner-action:hover { background: var(--color-surface-hover); }
.ds-banner-close {
    background: transparent;
    border: 0;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 2px;
    line-height: 0;
    border-radius: 4px;
}
.ds-banner-close:hover { background: var(--color-surface-hover); color: var(--color-text-primary); }

.ds-banner-info    { border-left: 3px solid var(--color-info); }
.ds-banner-info    > svg:first-of-type { color: var(--color-info); }
.ds-banner-success { border-left: 3px solid var(--color-success); }
.ds-banner-success > svg:first-of-type { color: var(--color-success); }
.ds-banner-warning { border-left: 3px solid var(--color-warning); }
.ds-banner-warning > svg:first-of-type { color: var(--color-warning); }
.ds-banner-danger  { border-left: 3px solid var(--color-danger); }
.ds-banner-danger  > svg:first-of-type { color: var(--color-danger); }

/* ============================================================
   File-Input — gleiche Höhe/Border wie ds-input, Button links als ds-btn
   ============================================================ */
.ds-file {
    display: block;
    width: 100%;
    box-sizing: border-box;
    height: 36px;
    padding: 0;
    font-family: inherit;
    font-size: 13px;
    color: var(--color-text-primary);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-input);
    line-height: 34px;
    cursor: pointer;
    overflow: hidden;
}
.ds-file::file-selector-button {
    height: 34px;
    padding: 0 14px;
    margin: 0 12px 0 0;
    border: 0;
    border-right: 1px solid var(--color-border);
    background: var(--color-bg-subtle);
    color: var(--color-text-primary);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
}
.ds-file::file-selector-button:hover {
    background: var(--color-surface-hover);
}

/* ============================================================
   Meta-Label (kleine Caps-Label über Wert-Feldern in Cards)
   ============================================================ */
.ds-meta-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================================
   RichTextEditor (Mail-Body WYSIWYG, contenteditable)
   Eigenes, themenfähiges Styling (nur CSS-Variablen) — die
   Dropdown-Klassen aus dem Topbar sind component-scoped und
   greifen hier nicht, daher unter .rte nachgebildet.
   ============================================================ */
.rte {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-input);
    background: var(--color-surface);
    overflow: visible;
}
.rte-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    padding: 6px 8px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-subtle);
    border-top-left-radius: var(--radius-input);
    border-top-right-radius: var(--radius-input);
}
.rte-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    font: inherit;
    font-size: 12.5px;
    list-style: none;
}
.rte-tool:hover {
    background: var(--color-surface-hover);
    color: var(--color-text-primary);
}
.rte-tool::-webkit-details-marker { display: none; }
.rte-tool-text { white-space: nowrap; }
.rte-sep {
    width: 1px;
    align-self: stretch;
    margin: 4px 2px;
    background: var(--color-border);
}
.rte-placeholder { position: relative; }
.rte-placeholder > .dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 50;
}
.rte-placeholder:not([open]) > .dropdown-menu { display: none; }
.rte-placeholder > .dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    font: inherit;
    font-size: 13px;
    text-align: left;
    color: var(--color-text-primary);
    cursor: pointer;
}
.rte-placeholder > .dropdown-menu .dropdown-item:hover {
    background: var(--color-surface-hover);
}
.rte-token {
    font-size: 11px;
    color: var(--color-text-muted);
}
.rte-free {
    border-top: 1px solid var(--color-border);
    margin-top: 4px;
    padding: 8px 10px 4px;
}
.rte-hint {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 6px;
}
.rte-linkbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-subtle);
}
.rte-surface {
    min-height: 220px;
    max-height: 480px;
    overflow-y: auto;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text-primary);
    outline: none;
}
.rte-surface.is-readonly {
    background: var(--color-bg-subtle);
    color: var(--color-text-secondary);
    cursor: default;
}
.rte-surface:empty::before {
    content: "Mailtext hier eingeben …";
    color: var(--color-text-faint);
}
.rte-surface a { color: var(--color-primary); }
.rte-surface ul { padding-left: 22px; margin: 8px 0; }
.rte-surface p { margin: 0 0 10px; }

/* Absender im Mailinhalt — read-only (zentral pro Mail-Domain gepflegt) */
.mail-from-readonly {
    padding: 10px 14px;
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-input);
    font-size: 13px;
    color: var(--color-text-secondary);
}
.ds-field-hint {
    margin-top: 6px;
    font-size: 11.5px;
    color: var(--color-text-muted);
}
/* Betreff-Zeile mit „Platzhalter einfügen"-Dropdown rechts neben dem Label */
.mailinhalt-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}
.mailinhalt-label-row .ds-label { margin-bottom: 0; }

/* ------------------------------------------------------------
   Log-Viewer-Zeilen (.live-log-*) — geteilt zwischen dem Live-Worker-Log-Panel
   (MailingWorkerLogPanel) und dem Fortschritts-Dialog (MailingProgressDialog). Beide
   Komponenten rendern dieselbe terminal-artige Zeilenoptik; weil zwei Komponenten betroffen
   sind, liegen die Zeilen-Klassen global statt scoped. Die jeweilige Hülle (Card/Dialog-Body)
   bleibt komponenten-lokal.
   ------------------------------------------------------------ */
.live-log-empty {
    padding: 18px;
    font-size: 12px;
    color: var(--color-text-muted);
    font-style: italic;
    font-family: inherit;
}
.live-log-row {
    display: grid;
    grid-template-columns: 80px 36px auto 1fr;
    column-gap: 8px;
    padding: 4px 12px;
    border-bottom: 1px solid var(--color-border);
    align-items: baseline;
}
.live-log-row:last-child { border-bottom: 0; }
.live-log-time {
    color: var(--color-text-faint);
    font-size: 10.5px;
}
.live-log-level {
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 0.05em;
    padding: 1px 4px;
    border-radius: 3px;
    text-align: center;
}
.live-log-step {
    color: var(--color-text-muted);
    font-size: 10.5px;
}
.live-log-msg {
    color: var(--color-text-primary);
    word-break: break-word;
    white-space: pre-wrap;
}
.live-log-ex {
    grid-column: 1 / -1;
    margin: 4px 0 0;
    color: var(--color-danger, #dc2626);
    font-size: 10.5px;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 180px;
    overflow: auto;
    padding: 6px 8px;
    background: rgba(220, 38, 38, 0.05);
    border-radius: var(--radius-input);
}
.live-log-row.is-error  .live-log-level { background: rgba(220, 38, 38, 0.15); color: var(--color-danger, #dc2626); }
.live-log-row.is-warning .live-log-level { background: rgba(234, 179, 8, 0.18); color: #b45309; }
.live-log-row.is-debug   .live-log-level { background: rgba(120, 120, 120, 0.15); color: var(--color-text-muted); }
.live-log-row.is-info    .live-log-level { background: var(--color-primary-soft); color: var(--color-primary); }

/* Klickbare Step-/Letter-Chips als Filter-Trigger im Log-Row */
.live-log-step-btn,
.live-log-lid-btn {
    border: 1px solid var(--color-border);
    background: var(--color-bg-subtle);
    color: var(--color-text-muted);
    font-size: 10.5px;
    padding: 1px 6px;
    border-radius: 3px;
    cursor: pointer;
    line-height: 1.3;
}
.live-log-step-btn:hover,
.live-log-lid-btn:hover {
    background: var(--color-primary-soft);
    color: var(--color-primary);
    border-color: var(--color-primary);
}
.live-log-lid-btn {
    justify-self: end;
}

/* ------------------------------------------------------------
   Versandkosten-Auflistung (.preview-cost-*) — geteilt zwischen dem Freigabe-Dialog
   (ApproveDialog) und den Abschluss-Karten (MailingCompletionCards). Zwei Komponenten
   nutzen dieselbe Zeilenoptik, daher global statt scoped.
   ------------------------------------------------------------ */
.preview-cost {
    flex: 0 0 auto;
    border-top: 1px solid var(--color-border);
    padding: 10px 14px;
    background: var(--color-bg-subtle);
    font-size: 11.5px;
    max-height: 40%;
    overflow-y: auto;
}
.preview-cost-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.preview-cost-title {
    font-weight: 600;
    color: var(--color-text-primary);
}
.preview-cost-stand {
    color: var(--color-text-muted);
    font-size: 10.5px;
}
.preview-cost-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
    color: var(--color-text-secondary);
}
.preview-cost-label {
    flex: 1;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.preview-cost-label .ds-badge {
    font-size: 9.5px;
}
.preview-cost-muted { color: var(--color-text-muted); }
.preview-cost-count {
    font-variant-numeric: tabular-nums;
    text-align: right;
    min-width: 48px;
}
.preview-cost-sum {
    font-variant-numeric: tabular-nums;
    text-align: right;
    min-width: 72px;
}
.preview-cost-total {
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid var(--color-border);
    font-weight: 600;
    color: var(--color-text-primary);
}
.preview-cost-note {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 6px;
    color: var(--color-warning, var(--color-text-secondary));
    font-size: 10.5px;
}
.preview-cost-gross {
    font-weight: 600;
    color: var(--color-text-primary);
}
