/**
 * Elevate CRM · App UI
 * Vorlage: elevate-handoff — live Full-Viewport + echte Inputs + Mobile
 */

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

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
}

body {
  font-family: var(--font-ui);
  color: var(--text-primary);
  background: var(--black);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
}

/* Tastatur: klarer Fokus ohne Maus-Hover zu stören */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--aero);
  outline-offset: 2px;
}

img,
svg {
  display: block;
}

/* —— Screen —— */
.screen {
  width: 100%;
  min-height: 100dvh;
  height: 100dvh;
  margin: 0;
  background: var(--black);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.screen--login {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 90% 55% at 50% -8%, var(--accent-soft) 0%, transparent 58%),
    linear-gradient(180deg, #f7f7f6 0%, var(--surface-muted) 100%);
  height: auto;
  min-height: 100dvh;
}

/* —— Topbar —— */
.topbar {
  height: var(--topbar-h);
  padding: 0 var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-shrink: 0;
  position: relative;
  z-index: 20;
}

.brand {
  width: var(--rail-w);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand__mark {
  width: 28px;
  height: 28px;
}

.nav-pill {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs);
  background: var(--surface-nav);
  border-radius: 24px;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}

.nav-pill::-webkit-scrollbar {
  display: none;
}

.nav-pill__item {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 20px;
  color: var(--text-inverse-muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.nav-pill__item:hover {
  color: var(--text-inverse);
}

.nav-pill__item.is-active {
  background: var(--jet);
  color: var(--white);
  font-weight: 600;
}

.top-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.search {
  width: 200px;
  height: 38px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0 10px 0 14px;
  background: var(--jet);
  border-radius: 20px;
  color: var(--text-inverse-muted);
  font-size: 13px;
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text-inverse);
  /* kein type=search → kein Safari/Chrome Cancel-Emoji */
  -webkit-appearance: none;
  appearance: none;
}

.search input::placeholder {
  color: var(--text-inverse-muted);
}

.search__clear {
  width: 22px;
  height: 22px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--text-inverse-muted);
  flex-shrink: 0;
}

.search__clear:hover {
  color: var(--white);
  background: rgba(255,255,255,.12);
}

.search__clear[hidden] {
  display: none !important;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 19px;
  background: var(--jet);
  color: var(--text-inverse-muted);
  display: grid;
  place-items: center;
  position: relative;
}

.icon-btn:hover {
  color: var(--white);
}

.icon-btn.is-busy {
  color: var(--white);
}

.icon-btn__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--aero);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.icon-btn__badge[hidden] {
  display: none !important;
}

.notify-wrap {
  position: relative;
}

.notify-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, calc(100vw - 32px));
  max-height: 420px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.14);
  z-index: 40;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--text-primary);
}

.notify-panel[hidden] {
  display: none !important;
}

.notify-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.notify-panel__list {
  overflow: auto;
  max-height: 360px;
}

.notify-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
}

.notify-item:hover {
  background: var(--surface-muted);
}

.notify-item.is-unread {
  background: var(--accent-soft);
}

.notify-item__title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 2px;
}

.notify-item__body {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}

.notify-item__meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: var(--font-mono);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 19px;
  background: var(--aero);
  color: var(--white);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}

.faq-block {
  margin-bottom: 8px;
}

.faq-block h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.faq-block p,
.glossary dt + dd {
  margin: 0 0 12px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.45;
}

.glossary dt {
  font-weight: 600;
  font-size: 13px;
  margin-top: 10px;
}

/* Hilfe: Spalten nach Inhalt, Panel scrollt — kein card.grow/clip */
.help-layout {
  align-items: flex-start;
}

.help-main {
  flex: 1 1 auto;
  min-width: 0;
}

.help-layout > .side {
  align-self: flex-start;
  max-height: none;
  overflow: visible;
}

.mail-compose textarea {
  min-height: 120px;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--jet);
  color: var(--white);
  place-items: center;
  flex-shrink: 0;
}

.nav-backdrop {
  display: none;
}

/* —— Body / Rail / Panel —— */
.body {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 12px;
  padding: 0 16px 16px;
}

.rail {
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 12px 0;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.rail__bottom {
  width: 100%;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.rail__item {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: 10px 0;
  border-radius: 14px;
  color: var(--text-inverse-muted);
  font-size: 10px;
  font-weight: 500;
}

.rail__item.is-active {
  background: var(--jet);
  color: var(--white);
}

.rail__fab {
  width: 48px;
  height: 48px;
  border-radius: 24px;
  background: var(--aero);
  color: var(--white);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-accent);
  margin-top: 4px;
}

.panel {
  flex: 1;
  min-width: 0;
  min-height: 0;
  background: var(--surface-panel);
  border-radius: var(--radius-panel);
  padding: 28px 32px var(--panel-pad-bottom, 48px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.panel__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.panel__title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.panel__title--with-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  line-height: 1.15;
}

.panel__title--with-badge > span {
  line-height: 1.15;
}

.panel__title--with-badge .badge {
  flex-shrink: 0;
  align-self: center;
  line-height: 1;
  padding-block: 5px;
  transform: none;
}

.panel__sub {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.panel__back {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--aero);
  font-size: 12px;
  font-weight: 600;
}

.panel__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* —— Primitives —— */
.card {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.card--pad {
  padding: var(--card-pad-top) var(--card-pad-x) var(--card-pad-bottom);
}

.card--pad-lg {
  padding: var(--card-pad-top-lg) var(--card-pad-x-lg) var(--card-pad-bottom-lg);
}

.card--flush {
  overflow: hidden;
}

/* Suchläufe: nicht clippen — Panel scrollt die ganze Seite */
.runs-card {
  flex: 0 0 auto;
  overflow: visible;
  min-width: 0;
}

.runs-table.table {
  overflow-x: auto;
  overflow-y: visible;
}

/* Letztes Kind in gepolsterten Cards nie an die Unterkante kleben */
.card--pad > :last-child,
.card--pad-lg > :last-child {
  margin-bottom: 0;
}

.card--pad > .stack:last-child,
.card--pad-lg > .stack:last-child,
.card--pad > .mail-compose:last-child,
.card--pad-lg > .mail-compose:last-child,
.card--pad > .timeline:last-child,
.card--pad-lg > .timeline:last-child {
  padding-bottom: 2px;
}

.strip {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-strip);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-sizing: border-box;
}

.btn--primary {
  background: var(--aero);
  color: var(--white);
  border-color: var(--aero);
}

.btn--primary:hover {
  filter: brightness(1.05);
}

.btn--secondary {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--silver);
  font-weight: 500;
}

.btn--secondary:hover {
  background: var(--surface-muted);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  font-weight: 500;
}

.btn--danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn--sm {
  min-height: 32px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12px;
}

.btn--block {
  width: 100%;
}

.btn:disabled,
.btn.is-loading {
  opacity: 0.65;
  cursor: wait;
  pointer-events: none;
}

.btn__spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: el-spin .7s linear infinite;
  flex-shrink: 0;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 26px;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.badge--accent {
  background: var(--accent-soft);
  color: #c41408;
}

.badge--success {
  background: var(--success-soft);
  color: var(--success);
}

.badge--muted {
  background: var(--surface-muted);
  color: var(--text-secondary);
}

.badge--outline {
  background: var(--surface-muted);
  color: var(--text-secondary);
}

.chip {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 26px;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

.chip--accent {
  background: var(--accent-soft);
  color: #c41408;
  font-weight: 600;
}

/* Author-CSS überschreibt sonst das native [hidden] (display:none) */
.field[hidden],
[hidden] {
  display: none !important;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field + .field {
  margin-top: 14px;
}

.col > .field + .field,
.stack > .field + .field,
.stack--md > .field + .field,
.stack--lg > .field + .field {
  margin-top: 0;
}

.field__hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.field__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.field__control,
input.field__control,
textarea.field__control,
select.field__control {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0 14px;
  background: var(--surface-raised);
  border: 1px solid var(--silver);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  outline: none;
  box-sizing: border-box;
}

textarea.field__control,
.field__control--area {
  min-height: 160px;
  align-items: flex-start;
  padding: var(--space-md);
  line-height: 1.45;
  font-weight: 400;
  resize: vertical;
}

.field__control:focus,
input.field__control:focus,
textarea.field__control:focus,
select.field__control:focus {
  background: var(--surface-raised);
  border-color: var(--jet);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--aero) 28%, transparent);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 14px;
}

.field-grid .field + .field {
  margin-top: 0;
}

/* Switch / Checkbox */
.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  margin: 0;
}

.switch + .field-grid,
.switch + .field,
.switch + .mail-test {
  margin-top: 4px;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.switch__track {
  width: 40px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: var(--silver);
  position: relative;
  flex-shrink: 0;
  transition: background .15s ease;
}

.switch__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface-raised);
  box-shadow: var(--shadow-strip);
  transition: transform .15s ease;
}

.switch input:checked + .switch__track {
  background: var(--aero);
}

.switch input:checked + .switch__track::after {
  transform: translateX(16px);
}

.switch input:focus-visible + .switch__track {
  box-shadow: 0 0 0 2px var(--accent-soft), 0 0 0 4px var(--aero);
}

.switch__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.mail-test {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  padding: 14px;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
}

.mail-test .field {
  flex: 1;
  min-width: 180px;
  margin: 0;
}

.shot-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shot-grid--previews {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px 20px;
}

.shot-grid--compact {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.shot-card--compact.shot-card--desktop {
  width: 100%;
  max-width: 148px;
}

.shot-card--compact.shot-card--mobile {
  width: 72px;
}

.shot-card--compact .shot-card__link {
  position: relative;
  box-shadow: 0 1px 3px #02020212;
}

.shot-card--compact .shot-card__link:focus {
  outline: none;
}

.shot-card--compact .shot-card__link:focus-visible {
  outline: 2px solid var(--aero);
  outline-offset: 2px;
}

.shot-card--compact .shot-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.shot-card__tag {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #020202b8;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  pointer-events: none;
}

.audit-with-shots__shots .audit-block__label {
  margin-bottom: 12px;
}

.audit-with-shots {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 148px;
  gap: 20px 24px;
  align-items: start;
}

.audit-with-shots__shots {
  position: sticky;
  top: 8px;
}

@media (max-width: 820px) {
  .audit-with-shots {
    grid-template-columns: 1fr;
  }

  .shot-grid--compact {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
  }

  .audit-with-shots__shots {
    position: static;
  }
}

.shot-card {
  margin: 0;
}

.shot-card--desktop {
  width: min(100%, 400px);
  flex: 0 0 auto;
}

.shot-card--mobile {
  width: min(100%, 140px);
  flex: 0 0 auto;
}

.shot-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.shot-card__link {
  display: grid;
  place-items: center;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: zoom-in;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-muted);
  text-align: left;
}

.shot-card--desktop .shot-card__link,
.shot-card--desktop .shot-card__empty {
  aspect-ratio: 16 / 9;
}

.shot-card--mobile .shot-card__link,
.shot-card--mobile .shot-card__empty {
  aspect-ratio: 9 / 16;
}

.shot-card__img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: top center;
}

.shot-card__empty {
  display: grid;
  place-items: center;
  width: 100%;
  padding: 16px;
  text-align: center;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  font-size: 12px;
  box-sizing: border-box;
}


.mono {
  font-family: var(--font-data);
}

.muted {
  color: var(--text-muted);
}

.link {
  color: var(--aero);
  font-weight: 600;
}

.link--quiet {
  color: var(--text-secondary);
  font-weight: 500;
}

/* —— Typo / Layout utilities (statt Inline-Styles) —— */
.u-h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.u-h2--spaced {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
}

.u-h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

/* Headline → Inhalt in Cards ohne stack-* */
.card--pad > .u-h3:first-child,
.card--pad-lg > .u-h3:first-child,
.card--pad > .dv__panel-head:first-child,
.card--pad-lg > .dv__panel-head:first-child {
  margin-bottom: 12px;
}

.stack--md > .u-h3:first-child,
.stack--lg > .u-h3:first-child,
.stack > .u-h3:first-child {
  margin-bottom: 0;
}

.u-text-sm {
  font-size: 12px;
}

.u-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}

.u-hint--md {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.u-flex-between {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 6px;
}

.u-self-start {
  align-self: flex-start;
  flex-shrink: 0;
}

.u-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.u-empty {
  padding: 24px;
}

.u-pre {
  white-space: pre-wrap;
}

.u-mb-0 {
  margin: 0;
}

.row--wrap {
  flex-wrap: wrap;
}

.card--provider {
  min-width: 200px;
  background: var(--surface-muted);
  box-shadow: none;
}

.card--provider.is-active {
  background: var(--accent-soft);
}

.field--compact {
  margin: 0;
  min-width: 200px;
}

.row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.row.grow {
  flex: 1 1 auto;
  align-items: stretch;
}

.row > * {
  min-width: 0;
}

/* Hauptspalte füllt die Restbreite; .side bleibt fix (sonst schrumpft Content auf Inhalt) */
.row > .col:not(.side):not(.side--sm),
.row > .card:not(.side):not(.side--sm) {
  flex: 1 1 auto;
  min-width: 0;
}

.col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
}

.grow {
  flex: 1;
  min-height: 0;
}

.card.grow,
.table.grow,
.log-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.stack,
.stack--md,
.stack--lg {
  display: flex;
  flex-direction: column;
}

.stack {
  gap: var(--space-sm);
}

.stack--md {
  gap: 12px;
}

.stack--lg {
  gap: var(--space-md);
}

.side {
  width: 320px;
  flex: 0 0 320px;
}

.side--sm {
  width: 280px;
  flex: 0 0 280px;
}

/* —— Metrics —— */
.metrics {
  display: flex;
  align-items: center;
  padding: 8px 4px;
  flex-wrap: wrap;
  gap: 8px 0;
}

.metrics__item {
  flex: 1;
  min-width: 120px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 12px;
}

.metrics__value {
  font-family: var(--font-data);
  font-size: 18px;
  font-weight: 700;
}

.metrics__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.25;
}

.metrics__div {
  width: 1px;
  height: 24px;
  background: var(--border);
  flex-shrink: 0;
}

/* —— List / table —— */
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
  text-decoration: none;
  color: inherit;
}

.list-row > .btn {
  margin-left: auto;
  flex-shrink: 0;
}

.list-row > .score-meta {
  flex-shrink: 0;
  margin-left: auto;
}

.list-row > .score-meta + .btn {
  margin-left: 0;
}

.list-row__main {
  flex: 1;
  min-width: 140px;
}

.list-row__title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.list-row__sub {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

/* —— Papierkorb —— */
.trash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.trash-grid > .card {
  min-width: 0;
  overflow: auto;
}

.table__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
}

.table__section-head .u-h3 {
  margin: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.table__section-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

/* —— Kommunikation / Post —— */
.mail-compose {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#lead-comms {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comms-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.comms-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 0 28px;
  align-items: start;
}

.comms-layout__contacts {
  min-width: 0;
  padding-right: 24px;
  border-right: 1px solid var(--border);
}

.comms-layout__mail {
  min-width: 0;
}

@media (max-width: 900px) {
  .comms-layout {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .comms-layout__contacts {
    padding-right: 0;
    padding-bottom: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
}

.comms-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.comms-contact-list,
.comms-msg-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: none;
  width: 100%;
}

.comms-contact {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.comms-contact__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.comms-contact__main:hover strong {
  color: var(--aero);
}

.comms-contact__name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.comms-contact__name strong {
  font-size: 13px;
}

.comms-contact__meta {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.comms-msg {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border-strong);
}

.comms-msg--inbound {
  border-left-color: var(--aero);
}

.comms-msg--outbound {
  border-left-color: var(--success);
}

.comms-msg.is-draft {
  border-left-color: var(--warning);
}

.comms-msg__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  margin-bottom: 8px;
}

.comms-msg__head time,
.post-msg__head time,
.post-row__when,
.post-read__meta > span:not(.chip) {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-muted);
  white-space: nowrap;
}

.comms-msg__subj,
.post-msg__subj {
  display: block;
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.comms-msg__meta {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.comms-msg__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

/* Mail-Body: Plaintext, nüchtern — lange Mails nur nach Länge eingeklappt */
.mail-body {
  margin: 0;
  max-width: 42rem;
}

.mail-body__main,
.mail-body__preview {
  margin: 0;
  padding: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-primary);
  background: transparent;
  border: 0;
}

.mail-body--long details {
  margin: 0;
}

.mail-body--long summary {
  cursor: pointer;
  list-style: none;
  display: block;
}

.mail-body--long summary::-webkit-details-marker {
  display: none;
}

.mail-body__preview {
  color: var(--text-secondary);
  mask-image: linear-gradient(180deg, #000 55%, transparent);
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent);
}

.mail-body__more {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 650;
  color: var(--aero);
}

.mail-body--long details[open] .mail-body__preview,
.mail-body--long details[open] .mail-body__more {
  display: none;
}

.mail-body--long details[open] .mail-body__main {
  margin-top: 0;
}

/* Solid status chips (Suchläufe · Mail · Audit-Prio) — pen.dev */
.chip--solid,
.chip--run-ok,
.chip--run-warn,
.chip--solid-ok,
.chip--solid-warn,
.chip--solid-hot,
.chip--solid-danger,
.chip--solid-muted {
  min-height: 26px;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: var(--white);
}

.chip--solid-ok,
.chip--run-ok { background: var(--success); }

.chip--solid-warn,
.chip--run-warn { background: var(--warning); }

.chip--solid-hot { background: var(--accent); }

.chip--solid-danger { background: var(--danger); }

.chip--solid-muted { background: var(--jet); }

/* Soft chips nur noch für Zustände wie „Aktiv / verifiziert“ */
.chip--mail-draft,
.chip--mail-sent,
.chip--mail-in,
.chip--mail-fail {
  min-height: 26px;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: var(--white);
}

.chip--mail-draft { background: var(--warning); color: var(--white); }
.chip--mail-sent { background: var(--success); color: var(--white); }
.chip--mail-in { background: var(--accent); color: var(--white); }
.chip--mail-fail { background: var(--danger); color: var(--white); }

/* Meta-Zeilen setzen sonst muted auf alle spans — Chips ausnehmen */
.post-read__meta .chip,
.post-read__msg-meta .chip,
.muted > .chip,
p.muted .chip {
  color: var(--white);
}

.chip--ok {
  background: var(--success-soft);
  color: var(--success);
  font-weight: 600;
}

.chip--warn {
  background: var(--warning-soft);
  color: var(--warning);
  font-weight: 650;
}

.comms-compose-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.comms-seq__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--accent-soft);
  border-radius: var(--radius-md);
  font-size: 13px;
}

.comms-seq-step {
  padding: 10px;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
}

.chip--muted {
  background: #e4e4e2;
  color: var(--text-primary);
  font-weight: 600;
}

.chip--inverse {
  background: var(--surface-inverse);
  color: var(--text-inverse);
  font-weight: 650;
}

/* —— Offcanvas Sheet (Compose / Kontakt) —— */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 160;
  pointer-events: none;
}

.sheet.is-open {
  pointer-events: auto;
}

.sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 28, 0.35);
  opacity: 0;
  transition: opacity 180ms ease;
}

.sheet.is-open .sheet__backdrop {
  opacity: 1;
}

.sheet__panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(440px, 100vw);
  height: 100%;
  background: var(--surface);
  box-shadow: var(--shadow-popover);
  transform: translateX(100%);
  transition: transform 200ms ease;
}

.sheet__panel--sm {
  width: min(380px, 100vw);
}

.sheet.is-open .sheet__panel {
  transform: translateX(0);
}

.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.sheet__title {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.sheet__body {
  flex: 1;
  overflow: auto;
  padding: 18px;
}

.sheet__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.btn i[data-lucide] {
  flex-shrink: 0;
}

.table__head--mail,
.table__row--mail {
  grid-template-columns: minmax(120px, 1fr) minmax(160px, 1.6fr) 100px 110px 40px;
  min-width: 720px;
}

/* —— Post (Mail-Client) —— */
.post-app {
  display: grid;
  grid-template-columns: 220px minmax(240px, 1fr) minmax(280px, 1.4fr);
  flex: 1;
  min-height: min(640px, calc(100vh - 220px));
  height: auto;
  max-height: calc(100vh - 180px);
  margin: 0;
  overflow: hidden;
}

.post-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border-right: 1px solid var(--silver);
  background: var(--surface-list);
  overflow: hidden;
  min-height: 0;
}

.post-nav__body {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0;
}

.post-nav__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: var(--dash-row-pad-y) var(--dash-row-pad-x);
  border: 0;
  border-top: 1px solid var(--silver);
  border-radius: 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 550;
  background: transparent;
  line-height: var(--dash-row-line);
}

.post-nav__item:hover {
  background: rgba(252, 252, 252, 0.55);
  color: var(--text-primary);
}

.post-nav__item.is-active {
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: inset 3px 0 0 var(--accent);
  border-top-color: var(--silver);
  font-weight: 600;
}

.post-nav__count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.post-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.post-header__lead {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-width: 0;
}

.post-header__lead-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.post-header__select {
  min-width: 160px;
  max-width: 240px;
  min-height: 36px;
  padding: 6px 10px;
  font-size: 13px;
}

.post-header__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.post-header__pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--surface-list);
  border: 1px solid var(--silver);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.post-header__pill.is-on {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 35%, var(--silver));
  background: color-mix(in srgb, var(--success) 10%, var(--surface));
}

.post-nav__filter {
  margin-top: auto;
  flex-shrink: 0;
  padding: 12px 14px;
  border-top: 1px solid var(--silver);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface-list);
}

.post-nav__filter .field__label {
  margin: 0;
}

.post-nav__filter .field__control {
  background: var(--surface-raised);
  border-color: var(--silver);
}

.post-nav__group {
  width: 100%;
}

.post-nav__group .btn {
  flex: 1;
  justify-content: center;
  font-size: 11px;
  min-height: 32px;
  padding: 6px 8px;
}

.post-nav__meta {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.35;
}

.post-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid var(--border);
  overflow: auto;
}

.post-list--full {
  grid-column: 2 / -1;
  border-right: 0;
}

.post-list__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 0;
  position: sticky;
  top: 0;
  background: var(--surface-list);
  z-index: 1;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.post-list__head strong {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.post-list__count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* —— Reader-Listen: einheitliche Zeile + Active (Audit · Mail · Suchläufe · Adressbuch) —— */
.dv__findings,
.mail-client__list,
.dv__run-list,
.ab-list {
  background: var(--surface-list);
  border-right: 1px solid var(--silver);
}

.dv__find-row,
.post-row,
.dv__run-row,
.ab-row {
  display: flex;
  flex-direction: column;
  row-gap: var(--dash-row-gap);
  width: 100%;
  padding: var(--dash-row-pad-y) var(--dash-row-pad-x);
  border: 0;
  border-radius: 0;
  border-top: 1px solid var(--silver);
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  box-sizing: border-box;
  text-decoration: none;
  line-height: var(--dash-row-line);
}

.dv__find-row:hover:not(.is-active),
.post-row:hover:not(.is-active),
.dv__run-row:hover:not(.is-active),
.ab-row:hover:not(.is-active) {
  background: rgba(252, 252, 252, 0.55);
}

.dv__find-row.is-active,
.post-row.is-active,
.dv__run-row.is-active,
.ab-row.is-active {
  background: var(--surface);
  box-shadow: inset 3px 0 0 var(--accent);
  border-color: transparent;
  border-top-color: var(--silver);
}

.dv__find-row.is-active strong,
.post-row.is-active .post-row__id strong,
.dv__run-row.is-active strong,
.ab-row.is-active strong {
  color: var(--accent);
}

.mail-client__list .post-row.is-active .post-row__subj {
  color: var(--accent);
}

.dv__find-head,
.post-list__head,
.dv__run-list-head,
.ab-list__head {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  border-bottom: 0;
  background: var(--surface-list);
}

.post-row__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.post-row__id {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.post-row__id strong {
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-row__unread {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.post-row__who {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  min-width: 0;
}

.post-row__who strong {
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-row__lead {
  font-size: 11px;
  color: var(--text-secondary);
}

.post-row__count {
  font-size: 11px;
  font-weight: 650;
  color: var(--text-secondary);
  background: var(--surface-muted);
  border-radius: var(--radius-pill);
  padding: 1px 7px;
}

.post-row__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-row__subj {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-row__prev {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-row__when {
  flex-shrink: 0;
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

.post-read {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: auto;
}

.post-read__empty {
  margin: auto;
  padding: 32px;
  text-align: center;
}

.post-read__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface-raised);
  z-index: 1;
}

.post-read__title {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.post-read__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.post-read__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 20px 24px;
  background: var(--surface-raised);
}

.post-read__party {
  margin: 6px 0 0;
  font-size: 12px;
}

.post-read__msg {
  max-width: 42rem;
}

.post-read__msg-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  font-size: 12px;
}

.post-read__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.post-msg {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  max-width: 42rem;
}

.post-msg--inbound {
  border-left-color: var(--aero);
}

.post-msg--outbound {
  border-left-color: var(--success);
}

.post-msg.is-draft {
  border-left-color: var(--warning);
}

.post-msg__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 10px;
}

.post-msg__addr {
  flex: 1;
  min-width: 100px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.post-msg__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

@media (max-width: 960px) {
  .post-app {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .post-nav {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .post-nav__filter {
    width: 100%;
    margin-top: 8px;
    padding-top: 8px;
  }

  .post-list {
    border-right: 0;
    max-height: 40vh;
  }

  .post-read {
    min-height: 40vh;
  }
}

.stack--sm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.table {
  overflow: auto;
}

.table__head,
.table__row {
  display: grid;
  grid-template-columns: minmax(140px, 1.3fr) minmax(90px, 0.9fr) 72px 110px minmax(158px, auto);
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  min-width: 720px;
}

.table__head--profiles,
.table__row--profiles {
  grid-template-columns: minmax(180px, 1.6fr) 110px minmax(140px, auto) 64px minmax(140px, auto);
  min-width: 780px;
}

.table__row--profiles {
  font-size: 13px;
  line-height: 1.4;
}

.table__row--profiles > span {
  min-width: 0;
}

.profiles-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.profiles-name strong {
  font-size: 13px;
  font-weight: 600;
}

.profiles-meta {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table__head--leads,
.table__row--leads {
  grid-template-columns: 52px minmax(140px, 1.5fr) minmax(90px, 0.75fr) minmax(100px, 1fr) 118px 108px 108px 76px;
  min-width: 960px;
}

.table__head--leads-compact,
.table__row--leads-compact {
  grid-template-columns: 52px minmax(140px, 1.5fr) minmax(90px, 0.8fr) 118px 108px 108px 76px;
  min-width: 840px;
}

.table__row--leads,
.table__row--leads-compact {
  font-size: 13px;
  line-height: 1.4;
}

.table__row--leads > span,
.table__row--leads-compact > span {
  min-width: 0;
}

.leads-company {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.leads-thumb {
  display: block;
  width: 44px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-muted);
  cursor: zoom-in;
  flex-shrink: 0;
}

.leads-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.leads-thumb--empty {
  cursor: default;
  border-style: dashed;
  opacity: 0.45;
}

.leads-thumb:hover:not(.leads-thumb--empty) {
  border-color: var(--border-strong);
}

.leads-company strong {
  font-size: 13px;
  font-weight: 600;
}

.leads-web {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  width: auto;
  max-width: 100%;
  gap: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
}

.leads-web:hover {
  color: var(--aero);
  text-decoration: underline;
}

.leads-web svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.leads-scores {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  cursor: default;
}

.leads-scores--triple {
  display: inline-flex;
  align-items: stretch;
  gap: 10px;
}

.leads-scores--pair {
  display: inline-flex;
  align-items: stretch;
  gap: 12px;
}

.leads-scores--pill {
  display: inline-flex;
  align-items: center;
  gap: 0;
  box-sizing: border-box;
  min-height: 26px;
  height: 26px;
  padding: 0 4px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  max-width: 100%;
}

.leads-scores--pill-lg {
  height: auto;
  min-height: 0;
  padding: 6px 12px;
  gap: 0;
  background: var(--surface-list);
  border: 1px solid var(--border-subtle);
}

.leads-scores--pill-lg .leads-scores__item {
  padding: 0 8px;
  gap: 6px;
}

.leads-scores--pill-lg .leads-scores__val {
  font-size: 16px;
}

.leads-scores--pill-lg .leads-scores__sep {
  height: 16px;
}

.leads-scores--pill .leads-scores__item {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  line-height: 1;
}

.leads-scores--pill .leads-scores__sep {
  width: 1px;
  height: 12px;
  align-self: center;
  margin: 0 1px;
  background: var(--border);
}

.leads-scores--pill .leads-scores__val {
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.leads-scores__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  line-height: 1.15;
}

.leads-scores__val {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.leads-scores__item.is-primary .leads-scores__val {
  font-weight: 700;
  color: var(--text-primary);
}

.leads-scores__lab {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.leads-scores__ico {
  display: inline-flex;
  color: var(--text-muted);
  opacity: 0.85;
  flex-shrink: 0;
}

.leads-scores__item.is-primary .leads-scores__ico {
  color: var(--text-secondary);
  opacity: 1;
}

.leads-scores__fit {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.leads-scores__hint {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  opacity: 0.7;
}

.rating-stars {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.02em;
}

.rating-stars__on {
  color: #d4a017;
}

.rating-stars__half {
  color: #d4a017;
  opacity: 0.55;
}

.rating-stars__off {
  color: var(--border-strong);
  opacity: 0.55;
}

.leads-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.table-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
}

.table-icon-btn:hover {
  background: var(--surface-raised);
  color: var(--text-primary);
}

.table-icon-btn--ok {
  color: var(--success);
  background: var(--success-soft);
}

.table-icon-btn--ok:hover {
  color: var(--success);
  filter: brightness(0.96);
}

.table-icon-btn--no {
  color: var(--danger);
  background: var(--danger-soft);
}

.table-icon-btn--no:hover {
  color: var(--danger);
  filter: brightness(0.96);
}

.table-icon-btn.is-busy,
.table-icon-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.table__cell-link {
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.table__cell-link:hover strong {
  color: var(--aero);
}

.table__head {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.table__row > span:last-child,
.table__head > span:last-child {
  white-space: nowrap;
  justify-self: end;
  text-align: right;
}

.table__row > span:last-child .leads-actions {
  justify-content: flex-end;
}

.table__rule {
  height: 1px;
  background: var(--border);
}

.table__row + .table__row {
  box-shadow: inset 0 1px 0 var(--border-subtle);
}

.table__row:hover,
.table__row.is-active {
  background: var(--surface-muted);
}

a.table__row {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.table__row strong {
  font-size: 13px;
  font-weight: 600;
}

.table__head.table__head--trash-profiles,
.table__row.table__row--trash-profiles {
  grid-template-columns: minmax(140px, 1.6fr) minmax(120px, 1fr) 72px 76px;
  min-width: 0;
  width: 100%;
  font-size: 13px;
}

.table__head.table__head--trash-leads,
.table__row.table__row--trash-leads {
  grid-template-columns: minmax(160px, 1.5fr) minmax(160px, 1.2fr) minmax(130px, 1fr) 76px;
  min-width: 0;
  width: 100%;
  font-size: 13px;
}

.table__row.table__row--trash-profiles > span,
.table__row.table__row--trash-leads > span {
  min-width: 0;
}

.table__row.table__row--trash-leads > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table__row.table__row--trash-profiles.table__row--static,
.table__row.table__row--trash-leads.table__row--static {
  cursor: default;
}

.table__row.table__row--trash-profiles.table__row--static:hover,
.table__row.table__row--trash-leads.table__row--static:hover {
  background: transparent;
}

.table__row.table__row--trash-leads .leads-company strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* —— Progress —— */
.progress {
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--border-subtle);
  box-shadow: inset 0 0 0 1px var(--border);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  background: var(--aero);
  border-radius: inherit;
}

.progress--sm {
  height: 6px;
}

/* —— Scores —— */
.score-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
  line-height: 1.35;
  white-space: normal;
  max-width: none;
}

.score-meta__k {
  font-weight: 600;
  color: var(--text-secondary);
}

.score-meta__sep {
  color: var(--border-strong);
  opacity: 0.55;
}

.meta-grid,
.kv-list,
.criteria-list {
  margin: 0;
  display: grid;
  gap: 12px;
}

.meta-grid > div,
.kv-list__row,
.criteria-list__row {
  display: grid;
  grid-template-columns: 10.5rem minmax(0, 1fr);
  column-gap: 16px;
  row-gap: 2px;
  align-items: start;
  font-size: 13px;
}

.meta-grid dt,
.kv-list dt,
.criteria-list dt {
  margin: 0;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.4;
}

.meta-grid dd,
.kv-list dd,
.criteria-list dd {
  margin: 0;
  word-break: break-word;
  line-height: 1.45;
}

.kv-list__pre {
  display: block;
  white-space: pre-wrap;
}

.kv-block {
  display: grid;
  gap: 12px;
}

.kv-block__title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.lead-detail {
  align-items: flex-start;
}

.lead-detail > .col {
  flex: 1 1 0;
}

.lead-detail > .side,
.lead-detail__rail {
  flex: 0 0 300px;
  width: 300px;
  align-self: flex-start;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 4px;
  display: grid;
  gap: 16px;
}

.timeline__item {
  display: grid;
  gap: 2px;
  padding-left: 14px;
  border-left: 2px solid var(--border);
}

.timeline__when {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.3;
}

.timeline__what {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.timeline__detail {
  font-size: 12px;
  margin-top: 2px;
}

.activity-feed {
  list-style: none;
  margin: 0;
  padding: 4px 0 28px;
  display: flex;
  flex-direction: column;
}

.approval-queue {
  padding-bottom: 4px;
}

.review-panel {
  background: var(--surface-raised);
}

.review-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-group__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
}

.review-group__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
}

a.review-group__label:hover {
  color: var(--aero);
}

.review-group__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-row {
  display: flex;
  align-items: center;
  gap: 10px 12px;
  padding: 12px 14px;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.review-row__main {
  flex: 1;
  min-width: 160px;
}

.review-row__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
}

a.review-row__title:hover {
  color: var(--aero);
  text-decoration: underline;
}

.review-row__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.review-row__scores {
  background: var(--surface-raised);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin-left: auto;
  flex-shrink: 0;
}

.review-row__scores .score-meta {
  max-width: none;
}

.review-row__info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  color: var(--text-muted);
  cursor: pointer;
}

.review-row__info:hover,
.review-row__info:focus-visible {
  color: var(--text-primary);
  outline: none;
}

.el-tip {
  position: fixed;
  z-index: 200;
  max-width: min(320px, calc(100vw - 24px));
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  white-space: pre-wrap;
  box-shadow: var(--shadow-popover);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.el-tip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.review-row > .btn {
  flex-shrink: 0;
}

.review-row__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.review-row__actions .btn {
  flex-shrink: 0;
}

.approval-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.approval-stats__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
}

.activity-feed__item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.activity-feed__item:last-child {
  border-bottom: 0;
}

.activity-feed__when {
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 2px;
}

.activity-feed__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.activity-feed__detail {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.activity-feed__links {
  margin-top: 6px;
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.table__head--activity,
.table__row--activity {
  grid-template-columns: minmax(120px, 1.1fr) minmax(120px, 1.2fr) 110px 70px minmax(100px, 1.2fr) 80px;
  min-width: 720px;
}

/* —— Dialog (statt alert/confirm/prompt) —— */
.dialog {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--overlay-scrim);
  display: grid;
  place-items: center;
  padding: 24px;
}

.dialog__panel {
  width: min(420px, 100%);
  background: var(--surface-raised, var(--white));
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-popover);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dialog--choices .dialog__panel {
  width: min(460px, 100%);
}

.dialog__choices {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.dialog__choices-label {
  padding: 0;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.dialog__choices-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.1));
  border-radius: var(--radius-control, 8px);
  padding: 4px;
  max-height: min(280px, 50vh);
  overflow: auto;
}

.dialog__choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.35;
  cursor: pointer;
}

.dialog__choice:hover {
  background: var(--surface-muted, rgba(0, 0, 0, 0.04));
}

.dialog__choice:has(input:checked) {
  background: var(--surface-muted, rgba(0, 0, 0, 0.06));
}

.dialog__choice input {
  margin-top: 2px;
  flex-shrink: 0;
}

.dialog__choices-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--danger, #b42318);
}

.dialog__head {
  padding: 20px 20px 0;
}

.dialog__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.dialog__msg {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-secondary);
  white-space: pre-line;
}

.dialog__body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dialog__body:empty {
  display: none;
}

.dialog__check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
}

.dialog__check input {
  margin-top: 2px;
  flex-shrink: 0;
}

.dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 20px 20px;
  flex-wrap: wrap;
}

/* —— Live-Log Modal —— */
.live-log {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: var(--overlay-scrim);
  display: grid;
  place-items: center;
  padding: 24px;
}

.live-log__panel {
  width: min(560px, 100%);
  max-height: min(80vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--surface-raised, var(--white));
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.live-log__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px;
}

.live-log__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.live-log__sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.live-log__status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 18px 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  font-size: 12px;
  font-weight: 600;
}

.live-log__status.is-live {
  background: var(--accent-soft, rgba(0, 0, 0, 0.06));
}

.live-log__pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.live-log__status.is-live .live-log__pulse {
  background: var(--danger, #b42318);
  box-shadow: 0 0 0 0 rgba(180, 35, 24, 0.35);
  animation: live-pulse 1.4s ease-out infinite;
}

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(180, 35, 24, 0.35); }
  70% { box-shadow: 0 0 0 8px rgba(180, 35, 24, 0); }
  100% { box-shadow: 0 0 0 0 rgba(180, 35, 24, 0); }
}

.live-log__list {
  flex: 1;
  overflow: auto;
  padding: 0 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.live-log__row {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.live-log__row.is-job {
  background: var(--surface-raised, var(--white));
  box-shadow: inset 0 0 0 1px transparent;
}

.live-log__row.is-running {
  background: var(--accent-soft, var(--surface-muted));
}

.live-log__when {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.live-log__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.live-log__body strong {
  font-size: 13px;
  font-weight: 600;
}

.live-log__detail {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
  word-break: break-word;
}

.live-log__empty {
  margin: 24px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

@media (max-width: 520px) {
  .live-log__row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 220;
  background: var(--overlay-scrim);
  display: grid;
  place-items: center;
  padding: 24px;
}

.lightbox__figure {
  margin: 0;
  max-width: min(960px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lightbox__figure img {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 40px);
  object-fit: contain;
  border-radius: var(--radius-md);
  background: var(--surface-preview);
}

.lightbox__figure figcaption {
  color: var(--text-inverse);
  font-size: 13px;
  text-align: center;
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgba(252, 252, 252, 0.15);
  color: var(--text-inverse);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.runs-table {
  min-width: 0;
}

.runs-table .table__head--runs,
.runs-table .table__row--runs {
  grid-template-columns: 52px 110px 88px 88px minmax(158px, 1fr);
  min-width: 560px;
  font-size: 13px;
}

.runs-table .table__row--runs {
  color: var(--text-primary);
}

.runs-table .table__row--runs .mono {
  font-size: 13px;
  font-weight: 500;
}

.runs-table .table__row--runs .muted {
  font-size: 13px;
  color: var(--text-muted);
}

.runs-table .badge {
  font-size: 11px;
}

.run-block {
  border-top: 1px solid var(--border);
}

.run-block:first-of-type {
  border-top: 0;
}

.run-block__summary {
  list-style: none;
  cursor: pointer;
}

.run-block__summary::-webkit-details-marker {
  display: none;
}

.run-block[open] > .run-block__summary {
  background: var(--surface-muted);
}

.run-block__body {
  padding: 0 18px 14px;
  border-top: 1px solid var(--border);
}

.run-block__empty {
  margin: 0;
  padding: 10px 0 2px;
  font-size: 13px;
}

.run-results {
  display: grid;
  gap: 8px;
  padding-top: 12px;
}

.run-result {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  font-size: 13px;
}

.run-result__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.run-result__main strong,
.run-result__title {
  font-size: 13px;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}

a.run-result__title:hover strong {
  color: var(--aero);
  text-decoration: underline;
}

.audit-potential {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.run-result__main .muted {
  font-size: 12px;
}

.run-result__reason {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

.run-result--kept {
  background: var(--success-soft);
}

.run-result--skipped,
.run-result--duped {
  background: var(--surface-muted);
}

.criteria-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.criteria-section + .criteria-section {
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.criteria-section__title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
}

.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}

.choice input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.choice.is-on,
.choice:has(input:checked) {
  background: var(--accent-soft);
  color: var(--text-primary);
}

.switch-stack {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.empty-state {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 90;
  transform: translateX(-50%) translateY(12px);
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow-toast);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}

.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.toast--error {
  background: var(--danger-soft);
  color: var(--danger);
}

.stub-card {
  padding: 32px;
  text-align: center;
}

.stub-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

/* —— Plan: Wochenliste —— */
.table__head.table__head--plan,
.table__row.table__row--plan {
  grid-template-columns: minmax(110px, 0.9fr) 64px minmax(160px, 1.8fr) 64px 96px 56px;
  min-width: 0;
  width: 100%;
  font-size: 13px;
}

.table__row.table__row--plan > span {
  min-width: 0;
}

.table__row.table__row--plan .plan-day.is-today {
  font-weight: 600;
  color: var(--text-primary);
}

.table__row.table__row--plan.is-today {
  background: var(--surface-muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4em;
  height: 1.4em;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  vertical-align: middle;
  box-sizing: border-box;
}

/* Auf grauem/dunklem Button: weißer Kreis */
.btn--secondary .count-badge,
.btn.is-active .count-badge,
.btn--primary .count-badge,
.btn--danger .count-badge {
  background: var(--surface-raised, #fff);
  color: var(--text-primary);
}

/* —— Audit-Karte —— */
.audit-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 0 4px;
}

.audit-block + .audit-block {
  margin-top: 8px;
  padding-top: 20px;
  box-shadow: inset 0 1px 0 var(--border);
}

.audit-block:first-child {
  padding-top: 0;
}

.audit-block__label {
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.audit-block__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
}

.audit-block__text .chip {
  margin: 0 6px 6px 0;
}

.audit-scores {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
  margin-top: 2px;
}

.audit-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 8px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  text-align: center;
}

.audit-score__val {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
}

.audit-score__key {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.audit-list {
  margin: 0;
  padding-left: 1.15em;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.audit-list li + li {
  margin-top: 6px;
}

.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-nav .list-row,
.settings-nav .btn {
  width: 100%;
  justify-content: flex-start;
}

.settings-nav .list-row.is-active {
  background: var(--accent-soft);
}

.event-card {
  background: var(--black);
  color: var(--white);
  border-radius: 14px;
  padding: 16px;
}

.event-card .muted {
  color: var(--text-inverse-muted);
}

.map-frame {
  width: 100%;
  height: 280px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-muted);
}

.map-frame--side {
  height: 180px;
}

.map-coords {
  margin: 0;
  font-size: 11px;
}

.map-frame--tall {
  height: min(520px, 60vh);
}

.map-empty {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.map-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  border: 1px solid var(--silver);
  box-shadow: 0 1px 2px #02020208;
}

.map-toggle .btn {
  background: transparent;
  box-shadow: none;
  color: var(--text-secondary);
}

.map-toggle .btn.is-active {
  background: var(--jet);
  color: var(--white);
}

/* —— Login —— */
.login-card {
  width: min(100%, 420px);
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-card__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 700;
}

.login-card__logo {
  height: 28px;
  width: auto;
}

.login-card__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.login-card__meta {
  margin: 0;
  text-align: center;
  font-size: 12px;
}

.login-card__sub {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.login-error {
  display: none;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}

.login-error.is-visible {
  display: block;
}

/* —— Responsive —— */
@media (max-width: 1100px) {
  .row {
    flex-direction: column;
  }

  .side,
  .side--sm {
    width: 100%;
    flex: none;
  }

  .search {
    display: none;
  }

  .panel {
    padding: 20px 16px;
    border-radius: 20px;
  }

  .toast {
    bottom: calc(var(--rail-h) + 16px);
  }
}

@media (max-width: 900px) {
  .nav-toggle {
    display: grid;
    margin-left: auto;
  }

  .top-tools {
    margin-left: 0;
  }

  .nav-pill {
    display: none;
  }

  body.nav-open .nav-pill {
    display: flex;
    position: absolute;
    top: calc(var(--topbar-h) - 8px);
    left: 16px;
    right: 16px;
    flex-direction: column;
    align-items: stretch;
    padding: 8px;
    border-radius: 16px;
    z-index: 40;
    max-height: 70vh;
    overflow: auto;
  }

  body.nav-open .nav-pill__item {
    justify-content: flex-start;
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: var(--overlay-backdrop);
  }

  .nav-backdrop[hidden] {
    display: none;
  }

  .rail {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    width: auto;
    height: 64px;
    flex-direction: row;
    justify-content: space-around;
    padding: 6px 72px 6px 8px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
    background: var(--black);
    border-top: 1px solid var(--surface-nav);
  }

  .rail__bottom {
    flex-direction: row;
    width: auto;
    flex: 1;
    margin-top: 0;
    justify-content: space-around;
    align-items: center;
    gap: 0;
    padding-right: 8px;
  }

  .rail__item {
    width: auto;
    min-width: 48px;
    padding: 6px 4px;
    font-size: 9px;
  }

  .rail__fab {
    position: absolute;
    right: 14px;
    top: -22px;
    width: 52px;
    height: 52px;
    margin-top: 0;
  }

  .body {
    padding: 0 12px 80px;
  }

  .panel__title {
    font-size: 22px;
  }

  .metrics__div {
    display: none;
  }

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

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

  .panel__actions {
    width: 100%;
  }

  .panel__actions .btn {
    flex: 1;
  }

  .top-tools .avatar,
  .top-tools .icon-btn {
    width: 34px;
    height: 34px;
  }
}

@media (max-width: 560px) {
  .list-row,
  .review-row {
    align-items: flex-start;
  }

  .list-row .btn,
  .review-row > .btn,
  .review-row__actions {
    width: 100%;
  }

  .review-row__actions .btn {
    flex: 1 1 auto;
  }

  .meta-grid > div,
  .kv-list__row,
  .criteria-list__row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* —— Detail View (Lead · Suchauftrag) —— */
.dv {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: var(--fs-body);
}

.dv__toolbar {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px #02020208;
  padding: 8px 10px;
  max-width: 100%;
}

.dv__kpis {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.dv__kpi {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 6px;
  padding: 2px 14px;
  border-left: 1px solid var(--silver);
}

.dv__kpi:first-child {
  border-left: 0;
  padding-left: 6px;
}

.dv__kpi-val {
  font-family: var(--font-data);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.dv__kpi-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.dv__kpi-label--ico {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
}

.dv__toolbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dv__toolbar-actions .btn--sm {
  min-height: 30px;
  padding: 0 12px;
}

.dv__kpis + .dv__toolbar-actions {
  padding-left: 12px;
  margin-left: 4px;
  border-left: 1px solid var(--silver);
}

.dv__prio--hot,
.dv__prio--hot .dv__prio-tier {
  color: var(--accent);
}

.dv__prio-tier {
  font-size: 0.72em;
  font-weight: 650;
}

.dv__main {
  display: grid;
  gap: 16px;
  align-items: stretch;
}

.dv__main--3 {
  grid-template-columns: minmax(0, 2fr) 310px 310px;
}

.dv__main--2 {
  grid-template-columns: minmax(0, 1fr) 310px;
}

.dv__akte {
  display: flex;
  flex-direction: column;
  align-self: start;
  min-height: 0;
  overflow: hidden;
}

.dv__akte:has(.dv__akte-foot) {
  padding-bottom: 0;
}

.dv__akte-head,
.dv__panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dv__akte-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.dv__akte-chips .leads-scores--pill {
  flex-shrink: 0;
}

.dv__facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
  margin: 12px 0 10px;
}

.dv__facts dt {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 1px;
}

.dv__facts dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.3;
}

.leads-web--accent {
  color: var(--accent);
  font-weight: 600;
}

.leads-web--accent:hover {
  color: var(--accent);
}

.dv__fazit-block {
  margin: 0 0 14px;
}

.dv__fazit-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.dv__fazit {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-secondary);
}

.dv__akte-foot {
  margin-top: 4px;
  margin-left: calc(-1 * var(--card-pad-x-lg));
  margin-right: calc(-1 * var(--card-pad-x-lg));
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--silver);
  background: var(--surface-list);
}

.dv__akte-stat {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 0;
  border-left: 1px solid var(--silver);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}

.dv__akte-stat:first-child {
  border-left: 0;
  padding-left: var(--card-pad-x-lg);
}

.dv__akte-stat:last-child {
  padding-right: var(--card-pad-x-lg);
}

.dv__akte-stat:hover {
  background: var(--surface);
}

.dv__akte-stat-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--text-muted);
}

.dv__akte-stat-main svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.dv__akte-stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dv__akte-stat-n {
  font-family: var(--font-data);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.dv__alle {
  font-size: 13px;
  font-weight: 650;
  color: var(--accent);
  text-decoration: none;
}

.dv__standort .map-frame {
  height: 168px;
  min-height: 168px;
  margin: 10px 0 8px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.dv__dist {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.dv__verlauf {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.dv__verlauf > .dv__panel-head {
  padding: 14px var(--card-pad-x);
  margin-bottom: 0;
  flex-shrink: 0;
}

.dv__events {
  flex: 1 1 auto;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--silver);
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
}

.dv__events .post-row {
  background: var(--surface);
}

.dv__events .post-row:first-child {
  border-top-color: transparent;
}

.dv__events-empty {
  margin: 0;
  padding: 0 var(--card-pad-x) var(--card-pad-bottom);
}

.dv__audit {
  overflow: hidden;
}

.dv__audit-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.dv__audit-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.dv__audit-title .u-h2 {
  margin: 0;
}

.dv__audit-score {
  font-size: 13px;
  font-weight: 650;
}

.dv__audit-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
}

.dv__cat-tab,
.mail-client__tab {
  border: 0;
  background: transparent;
  padding: 6px 12px;
  border-radius: 8px;
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}

.dv__cat-tab span,
.mail-client__tab-n {
  color: inherit;
  opacity: 0.85;
  font-weight: 500;
  font-family: var(--font-data);
}

.dv__cat-tab:hover,
.mail-client__tab:hover {
  background: var(--surface-list);
}

.dv__cat-tab.is-active,
.mail-client__tab.is-active {
  background: var(--surface-inverse);
  color: var(--text-inverse);
  font-weight: 600;
}

.dv__cat-tab.is-active span,
.mail-client__tab.is-active .mail-client__tab-n {
  color: var(--text-inverse-muted);
  opacity: 1;
}

.dv__audit-body {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr) 240px;
  min-height: 320px;
}

.dv__findings {
  overflow: auto;
  max-height: 440px;
}

.mail-client__list {
  overflow: auto;
  min-height: 0;
  height: 100%;
}

/* Lead-Embed: Liste begrenzt, damit das Panel nicht explodiert */
.dv__mail .mail-client__list {
  max-height: 440px;
  height: auto;
}

.dv__find-head,
.post-list__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 0;
}

.dv__find-head strong,
.post-list__head strong {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.dv__find-row {
  align-items: flex-start;
}

.dv__find-cat {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.3;
}

.dv__find-cat--hot {
  color: var(--accent);
  font-weight: 700;
}

.dv__find-row strong {
  font-size: 13px;
  font-weight: 600;
}

.dv__find-teaser {
  font-size: 11px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dv__finding-detail {
  padding: 18px 20px;
  overflow: auto;
  background: var(--surface);
}

.dv__fd-head {
  margin-bottom: 14px;
}

.dv__fd-title {
  margin: 8px 0 4px;
  font-size: 20px;
  font-weight: 700;
}

.dv__fd-meta {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.dv__fd-block {
  margin-bottom: 14px;
}

.dv__fd-block h4 {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
}

.dv__fd-block p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.dv__fd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.dv__screens {
  border-left: 1px solid var(--silver);
  padding: 14px 12px;
  background: var(--surface-list);
  overflow: auto;
}

.dv__screens-label {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
}

.dv__screens .shot-grid--compact {
  gap: 14px;
}

.dv__mail {
  overflow: hidden;
}

.mail-client {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.dv__mail .mail-client {
  min-height: 360px;
  height: auto;
}

.mail-client__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.mail-client__title {
  font-size: 16px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.mail-client__title-n {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
}

.mail-client__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
}

.mail-client__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mail-client__body {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}

.mail-client__list .post-row {
  width: 100%;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.mail-client__read {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: var(--surface);
}

.post-app--client {
  grid-template-columns: 220px minmax(0, 1fr);
}

.post-app__client-host {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.post-app__client-host .mail-client {
  flex: 1;
  min-height: 0;
  height: 100%;
}

.post-app__client-host .mail-client__toolbar {
  display: none;
}

/* —— Elevate Modals (Adressbuch + Compose) —— */
body.modal-open,
body.sheet-open {
  overflow: hidden;
}

.el-modal {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
}

.el-modal.is-open {
  pointer-events: auto;
}

.el-modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay-scrim);
  opacity: 0;
  transition: opacity 160ms ease;
}

.el-modal.is-open .el-modal__backdrop {
  opacity: 1;
}

.el-modal__panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(90vh, 900px);
  background: var(--surface-raised);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-popover);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
}

.el-modal.is-open .el-modal__panel {
  transform: none;
  opacity: 1;
}

.el-modal--compose .el-modal__panel {
  width: min(640px, 100%);
}

.el-modal--sm .el-modal__panel {
  width: min(440px, 100%);
}

.el-modal--ab .el-modal__panel,
.ab-modal {
  width: min(880px, 100%);
  min-height: min(560px, 85vh);
}

.el-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.el-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.el-modal__sub {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.el-modal__body {
  padding: 18px 20px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.el-modal__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-raised);
  flex-shrink: 0;
}

.ab-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ab-modal__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  min-width: 0;
}

.ab-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.ab-modal__meta {
  font-size: 13px;
  color: var(--text-muted);
}

.ab-modal__count {
  font-weight: 650;
  color: var(--text-secondary);
}

.ab-modal__tools {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.ab-body {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.ab-list {
  overflow: auto;
}

.ab-list__head {
  position: sticky;
  top: 0;
  z-index: 1;
}

.ab-row {
  align-items: flex-start;
  gap: 2px;
}

.ab-row__role {
  font-size: 12px;
  color: var(--text-muted);
}

.ab-detail {
  padding: 20px 22px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ab-detail__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.ab-detail__name {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.ab-detail__email {
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
  font-size: 14px;
}

.ab-detail__email:hover {
  text-decoration: underline;
}

.ab-detail__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
  margin: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.ab-detail__meta dt {
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.ab-detail__meta dd {
  margin: 0;
  font-size: 13px;
}

.ab-herkunft {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.ab-herkunft__label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.ab-herkunft__line {
  margin: 0;
  font-size: 13px;
}

.ab-herkunft__hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.ab-source-link {
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
}

.ab-source-link:hover {
  text-decoration: underline;
}

.ab-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  justify-content: flex-end;
}

.ab-empty {
  padding: 24px 14px;
  color: var(--text-muted);
  font-size: 13px;
}

.ab-empty--detail {
  padding: 40px 22px;
}

@media (max-width: 1100px) {
  .dv__main--3 {
    grid-template-columns: 1fr 1fr;
  }
  .dv__main--3 .dv__akte {
    grid-column: 1 / -1;
  }
  .dv__audit-body {
    grid-template-columns: 280px minmax(0, 1fr);
  }
  .dv__screens {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 800px) {
  .dv__toolbar {
    width: 100%;
    justify-content: space-between;
  }
  .dv__main--2,
  .dv__main--3 {
    grid-template-columns: 1fr;
  }
  .dv__facts,
  .ab-detail__meta {
    grid-template-columns: 1fr;
  }
  .dv__audit-body,
  .mail-client__body,
  .ab-body {
    grid-template-columns: 1fr;
  }
  .dv__findings,
  .dv__mail .mail-client__list,
  .ab-list {
    max-height: 240px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .post-app {
    height: auto;
    max-height: none;
    min-height: 480px;
  }

  .post-app .mail-client__list {
    max-height: none;
    min-height: 220px;
  }
  .el-modal--ab .el-modal__panel,
  .ab-modal {
    width: 100%;
    min-height: 70vh;
  }
}


/* —— Suchauftrag: Betrieb + Prompt —— */
.dv__prompt {
  margin: 12px 0 0;
  white-space: pre-wrap;
  line-height: 1.5;
  font-size: var(--fs-copy);
  color: var(--text-secondary);
}

.dv__cap {
  margin: 12px 0 14px;
}

.dv__next-box {
  background: var(--surface-list);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dv__next-box__label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}

.dv__next-box__value {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.dv__next-box__hint {
  margin: 0;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
}

.dv__pipe {
  margin-bottom: 8px;
  font-size: var(--fs-body);
}

/* —— Suchläufe Reader —— */
.dv__runs {
  overflow: hidden;
}

.dv__runs-toolbar {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: var(--card-pad-top-lg) var(--card-pad-x-lg);
  border-bottom: 1px solid var(--border);
}

.dv__runs-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  min-width: 0;
}

.dv__runs-h {
  margin: 0;
  font-size: var(--fs-title);
  font-weight: 700;
}

.dv__runs-count {
  font-size: var(--fs-body);
  font-weight: 650;
  color: var(--text-secondary);
}

.dv__runs-hint {
  font-size: var(--fs-meta);
  color: var(--text-muted);
}

.dv__runs-body {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  min-height: 380px;
}

.dv__run-list {
  overflow: auto;
  max-height: 560px;
}

.dv__run-row {
  font-size: var(--fs-body);
}

.dv__run-row-main {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.dv__run-row-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dv__run-row-when {
  flex-shrink: 0;
  margin-left: auto;
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

.dv__run-row-meta {
  padding-left: 0;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
}

.dv__run-detail {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
}

.dv__run-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--silver);
}

.dv__run-id {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.dv__run-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.15;
}

.dv__run-meta {
  margin: 0;
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.dv__run-aside {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: auto;
}

.dv__run-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 12px;
  margin-left: 4px;
  border-left: 1px solid var(--silver);
}

.dv__run-kpis {
  display: flex;
  align-items: center;
  gap: 0;
}

.dv__run-kpis > div {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-left: 1px solid var(--silver);
}

.dv__run-kpis > div:first-child {
  border-left: 0;
  padding-left: 0;
}

.dv__run-kpis strong {
  font-family: var(--font-data);
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  min-width: 28px;
}

.dv__run-kpis span {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.dv__lead-table {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  padding: 0;
  min-width: 0;
}

.table__head--run-leads,
.table__row--run-leads {
  grid-template-columns: minmax(110px, 1.3fr) minmax(64px, 0.7fr) 118px 96px 84px 104px;
  gap: 8px;
  align-items: center;
  padding: var(--dash-row-pad-y) var(--dash-row-pad-x);
  min-width: 580px;
  font-size: 13px;
  line-height: var(--dash-row-line);
}

.table__head--run-leads {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  padding-top: 10px;
  padding-bottom: 10px;
}

.table__row--run-leads > span {
  min-width: 0;
}

.table__row--run-leads .leads-company strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table__row--run-leads.table__row--static {
  cursor: default;
}

.table__row--run-leads.table__row--static:hover {
  background: transparent;
}


@media (max-width: 960px) {
  .dv__main--2,
  .dv__runs-body {
    grid-template-columns: 1fr;
  }
  .dv__run-list {
    max-height: 240px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
}

/* —— Übersicht / Dashboard —— */
.dash__kpi-link {
  color: inherit;
  text-decoration: none;
}

.dash__kpi-link:hover .dv__kpi-val {
  color: var(--accent);
}

.dash .dv__toolbar {
  flex-wrap: wrap;
  row-gap: 8px;
}

.dash__top {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.dash__panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.dash__panel .dv__panel-head {
  margin-bottom: 12px;
}

.dash__mail-head {
  flex-wrap: wrap;
  row-gap: 8px;
}

.dash__mail-head-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.dash__mail-head-stats {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.dash__mail-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.dash__mail-stat:hover {
  color: var(--text-secondary);
}

.dash__mail-stat strong {
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  line-height: 1;
}

.dash__mail-stat.is-hot strong {
  color: var(--accent);
}

.dash__mail-stat--static {
  cursor: default;
}

.dash__mail-stat--static:hover {
  color: var(--text-muted);
}

.dash__mail-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dash__mail-kpis--compact {
  margin-top: 8px;
}

.dash__mail-kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 8px;
  border-radius: var(--radius-md);
  background: var(--surface-list);
  text-decoration: none;
  color: inherit;
  min-width: 0;
  text-align: left;
}

.dash__mail-kpi:hover {
  background: var(--surface-muted);
}

.dash__mail-kpi--static {
  cursor: default;
}

.dash__mail-kpi--static:hover {
  background: var(--surface-list);
}

.dash__mail-kpi.is-hot strong {
  color: var(--accent);
}

.dash__mail-kpi strong {
  font-family: var(--font-data);
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.dash__mail-kpi span {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.dash__panel-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dash__panel--list {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  min-height: 0;
  max-height: 300px;
}

.dash__panel--list > .dv__panel-head {
  padding: 14px var(--card-pad-x);
  margin-bottom: 0;
  flex-shrink: 0;
  min-height: 52px;
  box-sizing: border-box;
  align-items: center;
  gap: 8px;
}

.dash__panel-head-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  flex-wrap: nowrap;
}

.dash__panel--list > .dv__panel-head .u-h3 {
  margin: 0;
  line-height: 1.2;
  flex-shrink: 0;
}

.dash__panel--list > .dv__panel-head .chip {
  font-size: 11px;
  padding: 2px 7px;
  line-height: 1.2;
}

.dash__panel--list .dash__mail-head-stats {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex-shrink: 1;
  overflow: hidden;
}

.dash__panel--list .dash__mail-stat span {
  font-size: 10px;
}

.dash__panel-list {
  flex: 1 1 auto;
  background: var(--surface);
  border-top: 1px solid var(--silver);
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
}

.dash__panel-progress {
  margin: 2px 0 0;
}

.dash__panel-list .post-row {
  text-decoration: none;
  background: var(--surface);
}

.dash__panel-list > .post-row:not(a):not(button) {
  cursor: default;
}

.dash__panel-list .post-row:first-child {
  border-top-color: transparent;
}

.dash__panel--list > .muted {
  padding: 0 var(--card-pad-x) var(--card-pad-bottom);
}

.post-row--ico {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  column-gap: var(--dash-row-ico-gap);
  align-items: center;
}

.post-row--ico .post-row__stack {
  min-width: 0;
  display: flex;
  flex-direction: column;
  row-gap: var(--dash-row-gap);
}

.post-row--ico .post-row__subj {
  font-size: 12px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-row--ico > .dash__event-ico--lg {
  align-self: center;
}

.dash__triage-list .post-row.is-active .post-row__subj {
  color: var(--accent);
}

.dash__triage-list .post-row__lead {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.dash__profiles-scroll {
  min-height: 0;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
  margin-right: -4px;
}

.dash__profile + .dash__profile {
  margin-top: 14px;
}

.dash__profile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.dash__profile-name {
  font-size: 13px;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash__profile-name:hover {
  color: var(--accent);
}

.dash__profile .progress {
  margin: 0;
}

.dash__profile-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.dash__panel--feed {
  min-height: 0;
}

.dash__feed {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dash__feed--compact {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash__feed-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  font-size: 12px;
}

.dash__feed-item time {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--text-muted);
}

.dash__feed-item strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash__feed-item span {
  display: block;
  margin-top: 2px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash__feed-item.is-hot strong {
  color: var(--accent);
}

.dash__panel-list .post-row.is-hot .post-row__id strong,
.dash__panel-list .post-row.is-hot .post-row__subj {
  color: var(--accent);
}

.dash__event-ico {
  display: inline-flex;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.dash__event-ico svg {
  width: 14px;
  height: 14px;
}

.dash__event-ico--lg {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--surface-list);
  color: var(--text-secondary);
}

.dash__event-ico--lg svg {
  width: 18px;
  height: 18px;
}

.dash__event-ico--active {
  color: var(--success);
}

.dash__event-ico--paused {
  color: var(--warning);
}

.post-row.is-hot .dash__event-ico,
.dash__feed-item.is-hot .dash__event-ico {
  color: var(--accent);
}

.post-row.is-hot .dash__event-ico--lg {
  background: var(--accent-soft);
  color: var(--accent);
}

.dash__panel-list .post-row.is-hot .post-row__subj {
  color: var(--accent);
}

.dash__triage {
  overflow: hidden;
}

.dash__triage-toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: var(--card-pad-top-lg) var(--card-pad-x-lg);
  border-bottom: 1px solid var(--border);
}

.dash__triage-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.dash__triage-h {
  margin: 0;
  font-size: var(--fs-title);
  font-weight: 700;
}

.dash__triage-count {
  font-size: 13px;
  font-weight: 650;
  color: var(--text-secondary);
}

.dash__triage-body {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr) 260px;
  min-height: 420px;
}

.dash__triage-list {
  background: var(--surface-list);
  border-right: 1px solid var(--silver);
  overflow: auto;
  max-height: 560px;
}

.dash__triage-list-head {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-list);
}

.dash__triage-list .post-row__top {
  align-items: center;
}

.dash__triage-list .leads-scores--pill {
  flex-shrink: 0;
}

.dash__triage-list .leads-scores__ico svg {
  width: 11px;
  height: 11px;
}

.dash__triage-akte {
  padding: 18px 20px;
  overflow: auto;
  background: var(--surface);
  min-width: 0;
}

.dash__triage-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.dash__triage-chips-start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.dash__triage-chips .leads-scores--pill {
  flex-shrink: 0;
}

.dash__triage-chips .leads-scores__ico svg {
  width: 12px;
  height: 12px;
}

.dash__triage-name {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.dash__triage-meta {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-secondary);
}

.dash__triage-facts {
  margin-top: 0;
}

.dash__triage-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.dash__triage-ctx {
  border-left: 1px solid var(--silver);
  padding: 16px 14px;
  background: var(--surface);
  overflow: auto;
  min-width: 0;
}

.dash__ctx-h {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: none;
}

.dash__ctx-block + .dash__ctx-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--silver);
}

.dash__ctx-block > .dv__panel-head {
  margin-bottom: 10px;
}

.dash__ctx-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.dash__ctx-block .dash__mail-kpis--compact {
  margin-top: 0;
}

.dash__ctx-post {
  margin-top: 10px;
}

.dash__ctx-block .dash__profile-name {
  display: block;
  margin: 0;
}

.dash__ctx-stats {
  margin-top: 10px;
}

.dash__ctx-block .dash__feed--compact,
.dash__ctx-block > .muted {
  margin: 0;
}

.u-mt-xs {
  margin-top: 6px;
}

@media (max-width: 1100px) {
  .dash__top {
    grid-template-columns: 1fr;
  }
  .dash__triage-body {
    grid-template-columns: 300px minmax(0, 1fr);
  }
  .dash__triage-ctx {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 800px) {
  .dash .dv__toolbar {
    width: 100%;
  }
  .dash__triage-body {
    grid-template-columns: 1fr;
  }
  .dash__triage-list {
    max-height: 220px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
}
