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

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

:root {
  --bg:          #121828;
  --surface:     #1d2840;
  --surface-2:   #273458;
  --border:      rgba(80,130,210,.30);
  --border-2:    rgba(80,130,210,.55);
  --text:        #edf4ff;
  --text-2:      #8aacd8;
  --text-3:      #5a789e;
  --deck-bg:     #0f1520;
  --deck-bg-2:   #16203a;
  --deck-edge:   #0a1018;
  --grad:        linear-gradient(135deg, #0d6bdc 0%, #7c3aed 100%);
  --chrome:      linear-gradient(140deg, #2a4870 0%, #6096d8 28%, #dff2ff 50%, #6096d8 72%, #2a4870 100%);
  --prismatic:   linear-gradient(135deg, #0ea5e9 0%, #8b5cf6 45%, #ec4899 100%);
  --header-h:    62px;
  --meta-h:      40px;
  --radius-sm:   10px;
  --radius:      14px;
  --transition:  .17s cubic-bezier(.4,0,.2,1);
  --banner-h:    0px;
  --footer-h:    30px;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  background-image:
    linear-gradient(rgba(80,130,210,.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80,130,210,.1) 1px, transparent 1px);
  background-size: 52px 52px;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }

/* ── SHELL ─────────────────────────────────────────
   Kein overflow:hidden, kein height:100vh.
   Der Browser scrollt natürlich.
   ─────────────────────────────────────────────── */
.app {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR — sticky, scrollt intern ─────────── */
.sidebar {
  width: 232px;
  flex-shrink: 0;
  position: relative;
  position: sticky;
  top: 0;
  height: calc(100vh - var(--footer-h));
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: 2px 0 32px rgba(0,0,0,.5), inset -1px 0 0 rgba(80,130,210,.06);
  display: flex;
  flex-direction: column;
  z-index: 20;
}

/* ── SIDEBAR RESIZE HANDLE ──────────────────────── */
.sidebar-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: col-resize;
  z-index: 21;
  transition: background var(--transition);
}
.sidebar-resize-handle:hover { background: rgba(3,105,161,.06); }

.sidebar-resize-bar {
  width: 3px;
  height: 32px;
  border-radius: 3px;
  background: var(--border-2);
  transition: height var(--transition);
}
.sidebar-resize-handle:hover .sidebar-resize-bar { height: 48px; }

.sidebar-logo {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-icon {
  width: 26px;
  height: 26px;
  background: var(--chrome);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(74,126,192,.4), inset 0 1px 0 rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-logo span { font-size: .83rem; font-weight: 700; letter-spacing: -.02em; }

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 6px;
  flex-shrink: 0;
}

/* ── Sidebar Collapse (Desktop) ─────────────────── */
.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  color: var(--text-3);
  border-radius: 7px;
  cursor: pointer;
  flex-shrink: 0;
  transition: color var(--transition), background var(--transition);
  margin-left: auto;
}
.sidebar-collapse-btn:hover { color: var(--text-2); background: var(--surface-2); }

.sidebar.sidebar-animating { transition: width .25s ease; }

.sidebar.sidebar-eingeklappt {
  width: 0 !important;
  min-width: 0 !important;
  overflow: hidden;
}

.sidebar-expand-btn {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 22px;
  height: 64px;
  background: var(--surface-2);
  border: none;
  border-radius: 0 8px 8px 0;
  border-right: 2px solid rgba(96,150,216,0.2);
  color: var(--text-3);
  cursor: grab;
  box-shadow: 2px 0 8px rgba(0,0,0,.3);
  transition: width var(--transition), color var(--transition), box-shadow var(--transition), background var(--transition);
  font-size: .55rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  padding: 10px 0;
  user-select: none;
}
.sidebar-expand-btn:hover {
  width: 26px;
  color: var(--text-2);
  background: var(--surface);
  box-shadow: 2px 0 12px rgba(74,126,192,.25);
}
.sidebar-expand-btn--dragging { cursor: grabbing; }
.sidebar-expand-btn.hidden { display: none; }

.sidebar-section-label {
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-3);
}

.toggle-all-btn {
  background: none;
  border: none;
  font-size: .65rem;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.toggle-all-btn:hover { color: var(--text-2); background: var(--surface-2); }

.sidebar-search-wrap {
  padding: 4px 8px 2px;
}
.sidebar-search {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: .72rem;
  font-family: inherit;
  padding: 5px 10px;
  outline: none;
  transition: border-color var(--transition);
}
.sidebar-search::placeholder { color: var(--text-3); }
.sidebar-search:focus {
  border-color: var(--border-2);
  box-shadow: 0 0 0 2px rgba(96,150,216,.18);
}
.sidebar-search::-webkit-search-cancel-button { display: none; }


.customer-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
}

.kunden-filter-summary {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 6px;
  margin: -2px 0 8px;
  padding: 0 2px;
}

.kunden-filter-count {
  font-size: .68rem;
  font-weight: 700;
  color: var(--text-3);
}

.kunden-filter-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.kunden-filter-chip,
.kunden-filter-clear {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  border-radius: 999px;
  font-family: inherit;
  font-size: .66rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.kunden-filter-chip {
  padding: 4px 7px 4px 9px;
  border: 1px solid rgba(96,165,250,.32);
  background: rgba(37,99,235,.14);
  color: #bfdbfe;
}

.kunden-filter-chip:hover {
  border-color: rgba(96,165,250,.55);
  background: rgba(37,99,235,.24);
}

.kunden-filter-chip:focus-visible,
.kunden-filter-clear:focus-visible,
.kunden-follow-up-chip:focus-visible,
.mandant-filter-chip:focus-visible {
  outline: none;
  border-color: rgba(96,165,250,.75) !important;
  box-shadow: 0 0 0 2px rgba(96,150,216,.28);
}

.kunden-filter-chip span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kunden-filter-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(191,219,254,.16);
  color: #dbeafe;
  font-size: .75rem;
  line-height: 1;
  flex-shrink: 0;
}

.kunden-filter-clear {
  padding: 4px 8px;
  border: 1px solid rgba(148,163,184,.24);
  background: rgba(15,23,42,.48);
  color: var(--text-2);
}

.kunden-filter-clear:hover {
  border-color: rgba(148,163,184,.42);
  background: rgba(15,23,42,.72);
  color: var(--text);
}

/* ── Buchstabengruppe ── */
.customer-group { list-style: none; }

.customer-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background var(--transition);
}
.customer-group-header::-webkit-details-marker { display: none; }
.customer-group-header::marker { display: none; }
.customer-group-header:hover { background: var(--surface-2); }

.customer-group-letter {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-3);
}

.group-chevron {
  color: var(--text-3);
  flex-shrink: 0;
  transition: transform var(--transition);
}

details[open] > .customer-group-header .group-chevron {
  transform: rotate(90deg);
}

.customer-group-items {
  list-style: none;
  padding-left: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
}

.customer-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition);
}

.customer-item:hover  { background: var(--surface-2); }
.customer-item.active { background: rgba(13,107,220,.1); border-color: rgba(80,130,210,.35); box-shadow: 0 0 14px rgba(13,107,220,.14), 0 1px 4px rgba(0,0,0,.3); }
.customer-item:focus-visible {
  outline: none;
  border-color: rgba(96,150,216,.82);
  box-shadow: 0 0 0 2px rgba(96,150,216,.28), 0 1px 4px rgba(0,0,0,.3);
}
.customer-item.active:focus-visible {
  box-shadow: 0 0 0 2px rgba(96,150,216,.34), 0 0 14px rgba(13,107,220,.16), 0 1px 4px rgba(0,0,0,.3);
}

.customer-item-info { flex: 1; min-width: 0; }

.customer-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .67rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.customer-item-name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-item-company {
  font-size: .7rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* ── Customer Expander ──────────────────────────── */
.customer-expander-btn {
  background: none;
  border: none;
  color: rgba(90,120,158,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 1px 2px rgba(0,0,0,.18);
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.customer-expander-btn:hover {
  background: linear-gradient(170deg, rgba(70,110,180,.24) 0%, rgba(40,70,120,.34) 100%);
  color: var(--text-2);
  border-color: rgba(80,130,210,.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 1px 3px rgba(0,0,0,.22);
}
.customer-expander-btn:focus-visible {
  outline: none;
  color: var(--text);
  background: rgba(80,130,210,.2);
  box-shadow: 0 0 0 2px rgba(96,150,216,.42), inset 0 1px 0 rgba(255,255,255,.08);
}

.customer-expander-icon { transition: transform var(--transition); flex-shrink: 0; }
.customer-expander-btn.expanded .customer-expander-icon { transform: rotate(180deg); }

.customer-expand-panel {
  width: 100%;
  flex-shrink: 0;
  display: none;
  flex-direction: column;
  gap: 1px;
  padding: 6px 4px 4px 42px;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}
.customer-expand-panel.open { display: flex; }

.customer-expand-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
  font-size: .71rem;
}
.customer-expand-label {
  color: var(--text-3);
  font-weight: 500;
  flex-shrink: 0;
  min-width: 52px;
}
.customer-expand-value {
  color: var(--text-2);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* ── MAIN — wächst mit dem Inhalt ─────────────── */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: row;
  position: relative;
}

.main-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: calc(100vh - var(--footer-h));
  overflow: hidden;
}

/* ── AKTIVE ANSICHT ─────────────────────────────── */
.active-view {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ── CUSTOMER HEADER — sticky ──────────────────── */
.customer-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  transition: height .25s ease, padding .25s ease;
}

/* Kompakter Header wenn Preview-Content sichtbar */
#activeView.header-kompakt .customer-header {
  height: 44px;
  padding: 0 20px;
}
#activeView.header-kompakt .metadata-strip {
  top: calc(44px + var(--banner-h));
}

.customer-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--chrome);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(74,126,192,.4), inset 0 1px 0 rgba(255,255,255,.2);
  transition: width .25s ease, height .25s ease, border-radius .25s ease, font-size .25s ease;
}
#activeView.header-kompakt .customer-header-avatar {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  font-size: .65rem;
}

.customer-header-name    { font-size: .92rem; font-weight: 700; letter-spacing: -.02em; transition: font-size .25s ease; }
.customer-header-company { font-size: .73rem; color: var(--text-3); margin-top: 1px; transition: opacity .2s ease, max-height .25s ease; }
#activeView.header-kompakt .customer-header-name    { font-size: .82rem; }
#activeView.header-kompakt .customer-header-company { opacity: 0; max-height: 0; overflow: hidden; margin: 0; }

/* ── PREVIEW PANEL PULSE ────────────────────────── */
@keyframes previewPulse {
  0%   { opacity: 0; }
  12%  { opacity: 1; }
  100% { opacity: 0; }
}
.preview-panel.preview-flash::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(56,189,248,.09);
  border: 2px solid rgba(56,189,248,.55);
  pointer-events: none;
  z-index: 5;
  animation: previewPulse 1s ease-out forwards;
}

/* ── KUNDEN-STATUS (Header rechts) ─────────────── */
.customer-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.status-lamp {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background .3s, box-shadow .3s;
}
.status-lamp.green  { background: #22c55e; box-shadow: 0 0 7px rgba(34,197,94,.65); }
.status-lamp.yellow { background: #fbbf24; box-shadow: 0 0 7px rgba(251,191,36,.55); animation: pulse-yellow 2s ease-in-out infinite; }

@keyframes pulse-yellow {
  0%, 100% { opacity: 1;   box-shadow: 0 0 7px rgba(251,191,36,.55); }
  50%       { opacity: .45; box-shadow: 0 0 3px rgba(251,191,36,.2); }
}

.status-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-2);
}

.status-timer {
  font-size: .72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #16a34a;
  background: rgba(34,197,94,.1);
  border: 1px solid rgba(34,197,94,.28);
  padding: 2px 9px;
  border-radius: 99px;
}

.customer-status.inactive {
  cursor: pointer;
  border-radius: 8px;
  padding: 4px 8px;
  margin-right: -8px;
  transition: background var(--transition);
}
.customer-status.inactive:hover  { background: rgba(251,191,36,.12); }
.customer-status.inactive:active { background: rgba(251,191,36,.22); }

/* ── SIDEBAR STATUS-PUNKT ───────────────────────── */
.sidebar-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-left: auto;
}
.sidebar-status-dot.green  { background: #22c55e; box-shadow: 0 0 5px rgba(34,197,94,.5); }
.sidebar-status-dot.yellow { background: #fbbf24; box-shadow: 0 0 5px rgba(251,191,36,.4); }

.follow-up-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: .58rem;
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 1px 4px rgba(0,0,0,.22);
}
.follow-up-badge.overdue {
  background: #ef4444;
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
}
.follow-up-badge.today {
  background: #f97316;
  color: #fff7ed;
  border: 1px solid rgba(255,255,255,.2);
}
.follow-up-badge.upcoming {
  background: #22c55e;
  color: #052e16;
  border: 1px solid rgba(187,247,208,.65);
}

/* ── MANDANT BAR — CRM-Kunde noch kein Mandant ─── */
.mandant-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: rgba(16,185,129,.07);
  border-bottom: 1px solid rgba(16,185,129,.18);
  font-size: .8rem;
  color: #4ade80;
  flex-shrink: 0;
}
.mandant-bar svg { color: #16a34a; flex-shrink: 0; }
.mandant-bar span { flex: 1; }
.mandant-bar button {
  flex-shrink: 0;
  padding: 5px 14px;
  font-size: .75rem;
  font-weight: 600;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--transition);
}
.mandant-bar button:hover { opacity: .85; }
.mandant-bar button:disabled { opacity: .45; cursor: not-allowed; }
.mandant-avatar { background: rgba(16,185,129,.15) !important; color: #4ade80 !important; }
.mandant-aktiv-badge { color: #4ade80 !important; }
.mandant-item.active { background: rgba(16,185,129,.09); border-color: rgba(74,222,128,.25); box-shadow: 0 0 14px rgba(16,185,129,.1); }
.mandant-item:hover  { background: rgba(16,185,129,.06); }
.mandant-item .customer-avatar { background: linear-gradient(135deg, #16a34a, #4ade80) !important; color: #fff !important; }
.mandant-item:focus-visible {
  border-color: rgba(74,222,128,.75);
  box-shadow: 0 0 0 2px rgba(74,222,128,.24), 0 1px 4px rgba(0,0,0,.3);
}

#kundenPhasenFilter:focus-visible,
#mandantSortSelect:focus-visible,
.mandant-status-aktion:focus-visible,
.mandant-rechtsform-aktion:focus-visible {
  outline: none;
  border-color: rgba(96,150,216,.75) !important;
  box-shadow: 0 0 0 2px rgba(96,150,216,.26);
}

/* ── HAUPT-TABS (Übersicht / Dokumente) ──────────── */
.main-tabs {
  display: flex;
  gap: 2px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.main-tab {
  padding: 8px 16px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-2);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.main-tab:hover  { color: var(--text-1); }
.main-tab.active { color: #60a5fa; border-bottom-color: #60a5fa; font-weight: 600; }

/* ── MANDANT DOKUMENTE PANEL ─────────────────────── */
.mandant-dok-panel {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dok-karte {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.dok-karte-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(16,185,129,.12);
  color: #4ade80;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(74,222,128,.15);
}
.dok-karte-info { flex: 1; min-width: 0; }
.dok-karte-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dok-karte-meta {
  font-size: .75rem;
  color: var(--text-3);
  margin-top: 2px;
}
.dok-karte-btn {
  padding: 5px 10px;
  font-size: .78rem;
  font-weight: 500;
  color: #4ade80;
  background: rgba(16,185,129,.1);
  border: 1px solid rgba(74,222,128,.2);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition);
}
.dok-karte-btn:hover { background: rgba(16,185,129,.2); border-color: rgba(74,222,128,.35); }
.dok-karte-actions { display: flex; gap: 6px; flex-shrink: 0; }
.dok-leer {
  text-align: center;
  color: var(--text-3);
  font-size: .85rem;
  padding: 32px 0;
}

/* ── METADATA STRIP — sticky unter dem Header ─── */
.metadata-strip {
  position: sticky;
  top: calc(var(--header-h) + var(--banner-h));
  z-index: 9;
  height: var(--meta-h);
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.metadata-strip::-webkit-scrollbar { display: none; }

.meta-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding: 0 16px;
  flex-shrink: 0;
}

.meta-divider {
  width: 1px;
  background: var(--border);
  margin: 7px 0;
  flex-shrink: 0;
}

.meta-label {
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  white-space: nowrap;
}

.meta-value {
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.meta-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 2px;
  border-radius: 3px;
  color: var(--text-3);
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, color .15s;
  flex-shrink: 0;
}
.meta-item:hover .meta-copy-btn {
  opacity: 1;
}
.meta-copy-btn:hover {
  color: var(--text-1);
}
.meta-copy-btn.copied {
  color: #22c55e;
  opacity: 1;
}

/* ── WORKSPACE ─────────────────────────────────── */
.workspace {
  display: flex;
  flex: 1;
}

/* ── DECK RESIZE HANDLE ─────────────────────────── */
.deck-resize-handle {
  width: 12px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: calc(100vh - var(--footer-h));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: col-resize;
  border-left: 1px solid var(--border);
  transition: background var(--transition);
  z-index: 1;
}
.deck-resize-handle:hover { background: rgba(3,105,161,.06); }
.deck-resize-bar {
  width: 3px;
  height: 32px;
  border-radius: 2px;
  background: var(--border-2);
  transition: height var(--transition);
}
.deck-resize-handle:hover .deck-resize-bar { height: 48px; }

/* ── DECK SIDEBAR ──────────────────────────────── */
.deck-scroll {
  width: 264px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: calc(100vh - var(--footer-h));
  overflow-y: auto;
  padding: 12px 8px 40px;
  background: var(--bg);
}

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

.inactive-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: rgba(251,191,36,.07);
  border-bottom: 1px solid rgba(251,191,36,.18);
  font-size: .8rem;
  color: #fbbf24;
}
.inactive-banner span { flex: 1; }
.inactive-banner button {
  flex-shrink: 0;
  padding: 5px 14px;
  font-size: .75rem;
  font-weight: 600;
  background: #f59e0b;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity var(--transition);
}
.inactive-banner button:hover { opacity: .85; }

/* ── DOKUMENT-EINGANG (Deck-Panel) ─────────────── */
.dok-eingang-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dok-eingang-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 8px;
}

.dok-eingang-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
}

.eingang-gruppe {
  background: var(--surface);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  overflow: hidden;
}

.eingang-gruppe-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
}

.eingang-email {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.eingang-count {
  flex-shrink: 0;
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-3);
  background: var(--bg);
  border-radius: 20px;
  padding: 1px 7px;
  margin-left: 6px;
}

.eingang-leer {
  padding: 20px 12px;
  font-size: .78rem;
  color: var(--text-3);
  text-align: center;
}

/* ── DOKUMENT EINZEL-ITEM ───────────────────────── */
.kdok-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  transition: background var(--transition);
}

.kdok-item:hover { background: var(--surface-2); }

.kdok-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  align-self: flex-start;
  margin-top: 1px;
}

.kdok-info {
  flex: 1;
  min-width: 0;
}

.kdok-name {
  font-size: .77rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kdok-zeile2 {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.kdok-datum {
  font-size: .65rem;
  color: var(--text-3);
  white-space: nowrap;
}

.kdok-status {
  font-size: .62rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .03em;
  white-space: nowrap;
}

.kdok-status.eingegangen { background: rgba(251,191,36,.15);  color: #fbbf24; border: 1px solid rgba(251,191,36,.25); }
.kdok-status.geprueft    { background: rgba(34,197,94,.13);   color: #4ade80; border: 1px solid rgba(74,222,128,.22); }
.kdok-status.abgelehnt   { background: rgba(239,68,68,.13);   color: #f87171; border: 1px solid rgba(248,113,113,.22); }
.kdok-status.angefordert { background: rgba(14,165,233,.13);  color: #38bdf8; border: 1px solid rgba(56,189,248,.22); }

.kdok-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-3);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}

.kdok-download:hover { background: var(--bg); color: var(--text); }

.kdok-leer {
  padding: 10px 20px;
  font-size: .78rem;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.kdok-spinner {
  width: 13px;
  height: 13px;
  border: 2px solid var(--border);
  border-top-color: var(--text-3);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex-shrink: 0;
}

/* ── SIDEBAR MODUS-TABS (CRM / Eingang) ─────────── */
.sidebar-mode-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 10px 4px;
  flex-shrink: 0;
}
.sidebar-mode-tab {
  flex: 1;
  padding: 5px 0;
  font-size: .72rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.sidebar-mode-tab.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.sidebar-mode-tab:not(.active):hover { background: var(--surface-2); color: var(--text-2); }

/* ── EINGANG SIDEBAR-ITEMS ──────────────────────── */
.eingang-sidebar-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.eingang-sidebar-item:hover { background: var(--surface-2); }
.eingang-sidebar-item.active { background: rgba(3,105,161,.07); border-left: 3px solid #0369a1; }
.eingang-sidebar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.eingang-sidebar-info { flex: 1; min-width: 0; }
.eingang-sidebar-email {
  font-size: .74rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eingang-sidebar-count {
  font-size: .65rem;
  color: var(--text-3);
  margin-top: 1px;
}

/* ── EINGANG DETAIL VIEW ────────────────────────── */
#eingangDetailView {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.eingang-stammdaten-wrap {
  padding: 16px 24px;
  overflow-y: auto;
}
.eingang-section-title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
  margin-bottom: 10px;
}
.stammdaten-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  margin-bottom: 20px;
}
.stammdaten-label {
  font-size: .74rem;
  color: var(--text-3);
  white-space: nowrap;
  padding-top: 1px;
}
.stammdaten-value {
  font-size: .74rem;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
}
.eingang-datei-section {
  padding: 0 24px 24px;
}
.eingang-datei-liste {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.eingang-datei-liste .kdok-item { border-bottom: 1px solid var(--border); }
.eingang-datei-liste .kdok-item:last-child { border-bottom: none; }
.eingang-leer-detail {
  padding: 20px 24px;
  font-size: .78rem;
  color: var(--text-3);
}

/* ── DECK TABS ──────────────────────────────────── */
.deck-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.deck-tabs {
  display: flex;
  background: var(--deck-bg-2);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.deck-tab {
  padding: 4px 12px;
  font-size: .72rem;
  font-weight: 600;
  color: #5a6a82;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.deck-tab:hover:not(.active):not(:disabled) { color: #8baabf; }
.deck-tab:disabled { opacity: .35; cursor: default; }
.deck-tab.active {
  background: var(--deck-bg);
  color: #c8d8e8;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

/* Panel-Karte */
.deck-group {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid rgba(80,130,210,.16);
  overflow: hidden;
  box-shadow:
    0 4px 24px rgba(0,0,0,.5),
    0 1px 0 rgba(255,255,255,.04) inset,
    0 0 0 1px rgba(0,0,0,.3);
}

/* Panel-Header */
.deck-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  list-style: none;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}
.deck-group-header:hover { background: var(--surface-2); }
.deck-group-header::-webkit-details-marker { display: none; }
.deck-group-header::marker { display: none; }

details.deck-group[open] > .deck-group-header .group-chevron { transform: rotate(90deg); }
details.deck-group:not([open]) {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
details.deck-group:not([open]) > .deck-group-header { border-bottom: none; }

.deck-group-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.deck-group-label {
  flex: 1;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--accent);
  white-space: nowrap;
}

.deck-group .group-chevron { color: var(--text-3); }

/* Button-Fläche */
.deck-workflow {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px 6px 10px;
}

/* ── DECK BUTTON ───────────────────────────────── */
.deck-btn {
  position: relative;
  width: 100%;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  background: linear-gradient(160deg,
    #1a2c48 0%,
    #223660 40%,
    rgba(96,150,216,.18) 55%,
    #1a2c48 100%
  );
  border: 1px solid rgba(80,130,210,.38);
  color: rgba(255,255,255,.6);
  border-radius: 12px;
  cursor: pointer;
  padding: 0 12px 0 14px;
  color: rgba(255,255,255,.45);
  box-shadow:
    0 3px 0 var(--deck-edge),
    0 6px 20px rgba(0,0,0,.5),
    inset 0 1px 0 rgba(255,255,255,.08),
    inset 0 -1px 0 rgba(0,0,0,.4);
  transform: translateY(0);
  transition: transform .1s ease, box-shadow .1s ease, border-color .1s ease;
  user-select: none;
  overflow: hidden;
}

/* Farbiger linker Akzentstreifen */
.deck-btn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
  opacity: .45;
  transition: opacity var(--transition), top var(--transition), bottom var(--transition);
}
.deck-btn:hover::before  { opacity: 1; top: 4px; bottom: 4px; }
.deck-btn.pressed::before { opacity: 1; }

.deck-step-num {
  font-size: .56rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: rgba(255,255,255,.18);
  min-width: 16px;
  flex-shrink: 0;
  transition: color var(--transition);
}

/* Icon in Akzentfarbe */
.deck-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: var(--accent);
  opacity: .55;
  transition: opacity var(--transition);
}

.deck-btn:hover {
  border-color: rgba(255,255,255,.13);
  box-shadow:
    0 4px 0 var(--deck-edge),
    0 7px 20px rgba(0,0,0,.35),
    0 0 18px var(--glow),
    inset 0 1px 0 rgba(255,255,255,.1);
  transform: translateY(-1px);
}
.deck-btn:hover .deck-icon     { opacity: 1; }
.deck-btn:hover .deck-step-num { color: var(--accent); opacity: .6; }

.deck-btn:disabled {
  opacity: .28;
  cursor: not-allowed;
  transform: none !important;
  box-shadow:
    0 3px 0 var(--deck-edge),
    0 5px 14px rgba(0,0,0,.25) !important;
}
.deck-btn:disabled::before { opacity: .15; }
.deck-btn--locked:disabled { opacity: .45; }

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: rgba(255,255,255,.8);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex-shrink: 0;
  margin: 0 auto;
}

.deck-btn.pressed,
.deck-btn:active {
  transform: translateY(2px);
  box-shadow:
    0 1px 0 var(--deck-edge),
    0 2px 8px rgba(0,0,0,.25),
    0 0 14px var(--glow),
    inset 0 2px 4px rgba(0,0,0,.3);
}
.deck-btn.pressed .deck-icon { opacity: 1; }

.deck-label {
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.3;
  color: rgba(255,255,255,.82);
  transition: color var(--transition);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deck-lock-icon {
  display: none;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #fbbf24;
  opacity: .95;
}

.deck-lock-icon svg {
  width: 15px;
  height: 15px;
}

.deck-btn--locked .deck-lock-icon {
  display: inline-flex;
}

.deck-btn--locked .deck-label {
  min-width: 0;
}

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

.deck-btn:hover .deck-label,
.deck-btn.pressed .deck-label { color: #fff; }

/* ── PREVIEW PANEL — nimmt den Großteil ein ────── */
.preview-panel {
  flex: 1;
  min-width: 0;
  position: relative;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  overflow: hidden;
}

.resize-handle {
  width: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: col-resize;
  transition: background var(--transition);
}

.resize-handle:hover { background: rgba(3,105,161,.06); }

.resize-handle-bar {
  width: 3px;
  height: 32px;
  border-radius: 3px;
  background: var(--border-2);
  transition: height var(--transition);
}

.resize-handle:hover .resize-handle-bar { height: 48px; }

.preview-inner {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.preview-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 24px;
  text-align: center;
}

.preview-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
}

.preview-empty-title { font-size: .85rem; font-weight: 600; color: var(--text-2); }
.preview-empty-hint  { font-size: .75rem; color: var(--text-3); line-height: 1.6; }

.preview-content {
  padding: 20px;
  font-size: .85rem;
  color: var(--text-2);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ── HTML PREVIEW + EDITOR ──────────────────────── */
.preview-html-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.preview-html-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.preview-html-toolbar-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.preview-html-document {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.preview-html-filename {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-html-filename::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad);
  flex-shrink: 0;
}

.preview-html-status {
  flex-shrink: 0;
  font-size: .68rem;
  font-weight: 700;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
}

/* Segmented control */
.preview-html-actions {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 2px;
  gap: 2px;
  width: 100%;
}

.preview-mode-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 4px 12px;
  font-size: .68rem;
  font-weight: 600;
  border: none;
  border-radius: 5px;
  background: none;
  color: var(--text-3);
  cursor: pointer;
  transition: all var(--transition);
}
.preview-mode-btn.active {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 1px 4px rgba(3,105,161,.25);
}
.preview-mode-btn:hover:not(.active):not(:disabled) { color: var(--text-2); background: var(--border); }
.preview-mode-btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.2); }

.preview-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: .72rem;
  font-weight: 600;
  background: var(--grad);
  color: #fff;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  flex-shrink: 0;
}
.preview-send-btn:hover:not(:disabled)  { opacity: .85; }
.preview-send-btn:active:not(:disabled) { transform: scale(.96); }
.preview-send-btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.2); }

/* ── VERSANDDIALOG ─────────────────────────────── */
.versand-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15,23,42,.52);
}

.versand-dialog {
  width: min(440px, 100%);
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0,0,0,.28);
  outline: none;
}

.versand-dialog:focus-visible {
  box-shadow: 0 24px 80px rgba(0,0,0,.28), 0 0 0 2px rgba(96,150,216,.55);
}

.versand-dialog-title {
  margin-bottom: 4px;
  font-size: .98rem;
  font-weight: 700;
}

.versand-dialog-sub {
  margin-bottom: 16px;
  color: var(--text-2);
  font-size: .78rem;
  line-height: 1.4;
}

.versand-field {
  margin-bottom: 12px;
}

.versand-label {
  display: block;
  margin-bottom: 5px;
  color: var(--text-3);
  font-size: .72rem;
  font-weight: 700;
}

.versand-input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  font-size: .82rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.versand-input::placeholder { color: var(--text-3); }

.versand-input:focus {
  border-color: var(--border-2);
  box-shadow: 0 0 0 2px rgba(96,150,216,.18);
}

.versand-input.is-invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220,38,38,.18);
}

.versand-help {
  margin-top: 5px;
  color: var(--text-3);
  font-size: .72rem;
  line-height: 1.35;
}

.versand-counter {
  margin: -4px 0 12px;
  font-size: .76rem;
  font-weight: 700;
}

.versand-counter.is-ok { color: #16a34a; }
.versand-counter.is-warning { color: #ca8a04; }
.versand-counter.is-error { color: #dc2626; }

.versand-error {
  min-height: 18px;
  margin-bottom: 12px;
  color: #dc2626;
  font-size: .76rem;
  line-height: 1.35;
}

.versand-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── DOKUMENT-AKTIONEN (Speichern / Verlauf) ─────── */
.preview-toolbar-right {
  display: flex;
  align-items: center;
  gap: .4rem;
  position: relative;
  min-width: 0;
}

.preview-doc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: .68rem;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
.preview-doc-btn:hover  { background: var(--border); color: var(--text); }
.preview-doc-btn:active { transform: scale(.96); }
.preview-doc-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  filter: grayscale(.2);
}

@media (max-width: 560px) {
  .preview-html-toolbar {
    padding: 9px 10px;
  }

  .preview-html-toolbar .preview-html-toolbar-top {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .preview-html-document {
    gap: 6px;
  }

  .preview-html-status {
    font-size: .62rem;
    padding: 2px 6px;
  }

  .preview-html-toolbar .preview-toolbar-right {
    gap: 5px;
  }

  .preview-html-toolbar .preview-doc-btn {
    width: 30px;
    height: 30px;
    padding: 0;
  }

  .preview-html-toolbar .preview-doc-btn .preview-btn-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .preview-html-toolbar .preview-send-btn {
    min-width: 88px;
    height: 30px;
    padding: 0 10px;
  }

  .preview-html-actions {
    align-self: stretch;
  }
}

button.merge-feedback-target,
[role="button"].merge-feedback-target {
  position: relative;
  overflow: hidden;
}

button.merge-feedback-pressed,
[role="button"].merge-feedback-pressed {
  transform: translateY(1px) scale(.97);
  filter: brightness(.96);
}

button.merge-feedback-busy,
[role="button"].merge-feedback-busy {
  position: relative;
  overflow: hidden;
  pointer-events: none;
  filter: saturate(1.1) brightness(.95);
  box-shadow: inset 0 0 0 999px rgba(15,23,42,.12), 0 0 0 3px rgba(14,165,233,.18);
}

button.merge-feedback-busy::after,
[role="button"].merge-feedback-busy::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.24), transparent);
  transform: translateX(-100%);
  animation: merge-feedback-sweep 1.1s ease-in-out infinite;
  pointer-events: none;
}

@keyframes merge-feedback-sweep {
  to { transform: translateX(100%); }
}

.verlauf-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 210px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,.18);
  z-index: 100;
  overflow: hidden;
}

.verlauf-eintrag {
  padding: 8px 12px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.verlauf-eintrag:last-child { border-bottom: none; }
.verlauf-eintrag:hover { background: var(--surface-2); }

.verlauf-datum {
  font-size: .68rem;
  color: var(--text-3);
  margin-bottom: 2px;
}
.verlauf-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text);
}

.verlauf-review {
  margin-top: 5px;
  font-size: .68rem;
  line-height: 1.35;
  color: var(--text-2);
}

.verlauf-status {
  padding: 12px;
  font-size: .75rem;
  color: var(--text-3);
  text-align: center;
}

/* ── TEMP-PASSWORT DIALOG ───────────────────────────── */
.pw-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pw-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  width: 340px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pw-dialog-title { font-size: 1rem; font-weight: 700; color: var(--text-1); }
.pw-dialog-sub   { font-size: .82rem; color: var(--text-2); line-height: 1.5; }
.pw-dialog-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16,185,129,.1);
  border: 1px solid rgba(74,222,128,.25);
  border-radius: 8px;
  padding: 10px 12px;
}
.pw-dialog-code {
  flex: 1;
  font-family: monospace;
  font-size: .95rem;
  font-weight: 700;
  color: #4ade80;
  word-break: break-all;
}
.pw-dialog-copy {
  padding: 4px 10px;
  font-size: .78rem;
  font-weight: 600;
  background: rgba(22,163,74,.7);
  color: #fff;
  border: 1px solid rgba(74,222,128,.3);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
}
.pw-dialog-copy:hover { opacity: .88; }
.pw-dialog-close {
  align-self: flex-end;
  padding: 6px 16px;
  font-size: .82rem;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-2);
}
.pw-dialog-close:hover { background: var(--surface-3, #e5e7eb); }

/* ── KUNDEN-AKTIVIERUNG DIALOG ─────────────────── */
.activation-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,.48);
}

.activation-dialog {
  width: 420px;
  max-width: 100%;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(0,0,0,.35);
  outline: none;
}

.activation-dialog:focus-visible {
  box-shadow: 0 18px 44px rgba(0,0,0,.35), 0 0 0 2px rgba(96,150,216,.55);
}

.activation-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.activation-dialog-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.activation-dialog-sub {
  margin-top: 4px;
  font-size: .82rem;
  line-height: 1.45;
  color: var(--text-2);
}

.activation-dialog-x {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-2);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.activation-dialog-x:hover,
.activation-dialog-x:focus-visible {
  background: rgba(80,130,210,.18);
  border-color: var(--border-2);
  color: var(--text);
  outline: none;
}

.activation-purpose-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.activation-purpose-option {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-2);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.activation-purpose-option:hover {
  border-color: var(--border-2);
  color: var(--text);
}

.activation-purpose-option:has(input:checked) {
  background: rgba(13,107,220,.16);
  border-color: rgba(96,150,216,.65);
  color: var(--text);
  box-shadow: 0 0 16px rgba(13,107,220,.16);
}

.activation-purpose-option input {
  width: 15px;
  height: 15px;
  accent-color: #6096d8;
  flex-shrink: 0;
}

.activation-comment-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.activation-comment-wrap.hidden { display: none; }

.activation-comment-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
}

.activation-comment-input {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  padding: 9px 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: .82rem;
  line-height: 1.45;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.activation-comment-input::placeholder { color: var(--text-3); }
.activation-comment-input:focus {
  border-color: var(--border-2);
  box-shadow: 0 0 0 2px rgba(96,150,216,.18);
}

.activation-comment-error {
  min-height: 16px;
  font-size: .72rem;
  color: #f87171;
}

.activation-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.activation-dialog-cancel,
.activation-dialog-submit {
  min-height: 34px;
  padding: 7px 14px;
  border-radius: 7px;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), opacity var(--transition);
}

.activation-dialog-cancel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.activation-dialog-cancel:hover,
.activation-dialog-cancel:focus-visible {
  border-color: var(--border-2);
  color: var(--text);
  outline: none;
}

.activation-dialog-submit {
  background: var(--grad);
  border: 1px solid rgba(255,255,255,.14);
  color: #fff;
  box-shadow: 0 6px 18px rgba(13,107,220,.22);
}

.activation-dialog-submit:hover,
.activation-dialog-submit:focus-visible {
  opacity: .92;
  outline: none;
}

@media (max-width: 480px) {
  .activation-purpose-group { grid-template-columns: 1fr; }
  .activation-dialog-actions { flex-direction: column-reverse; }
  .activation-dialog-cancel,
  .activation-dialog-submit { width: 100%; }
}

.titel-eingabe {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 230px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,.18);
  z-index: 100;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.titel-input {
  width: 100%;
  padding: 5px 9px;
  font-size: .75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--transition);
}
.titel-input:focus { border-color: var(--accent, #38bdf8); }

/* ── LINKEDIN LOADING & PREVIEW ─────────────────── */
.linkedin-loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 32px 24px;
}

.linkedin-loading-logo {
  width: 56px;
  height: 56px;
  background: rgba(10,102,194,.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: linkedinPulse 2s ease-in-out infinite;
}

@keyframes linkedinPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(10,102,194,.25); }
  50%       { box-shadow: 0 0 0 10px rgba(10,102,194,0); }
}

.linkedin-loading-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
}

.linkedin-loading-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 240px;
}

.linkedin-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .8rem;
  color: var(--text-2);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  transition: all .3s ease;
}

.linkedin-step::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background .3s;
}

.linkedin-step.active {
  color: var(--text);
  background: rgba(10,102,194,.08);
}
.linkedin-step.active::before {
  background: #0a66c2;
  animation: linkedinDot .8s ease-in-out infinite alternate;
}

.linkedin-step.done {
  color: #22c55e;
}
.linkedin-step.done::before {
  background: #22c55e;
}

@keyframes linkedinDot {
  from { opacity: .4; transform: scale(.8); }
  to   { opacity: 1;  transform: scale(1.2); }
}

/* ── LINKEDIN TABS ──────────────────────────────── */
.linkedin-tabs {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.linkedin-tab {
  padding: 4px 12px;
  font-size: .75rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.linkedin-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

/* ── LINKEDIN CARD ──────────────────────────────── */
.li-card-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--surface-2);
}

.li-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}

.li-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 10px;
}

.li-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0a66c2, #0d8aff);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(10,102,194,.35);
}

.li-card-meta { flex: 1; min-width: 0; }

.li-card-name {
  font-size: .86rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.li-card-sub {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: .71rem;
  color: var(--text-2);
  margin-top: 1px;
}

.li-card-brand { flex-shrink: 0; opacity: .9; }

.li-card-body { padding: 0 16px 12px; }

.li-card-text {
  font-size: .84rem;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 12px;
  word-break: break-word;
}

.li-card-hook {
  font-weight: 700;
}

.li-card-cta {
  font-size: .76rem;
  color: var(--text-2);
  font-style: italic;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.li-card-reactions {
  padding: 6px 16px;
  border-top: 1px solid var(--border);
}

.li-reaction-count {
  font-size: .75rem;
  color: var(--text-2);
}
.li-reaction-count em { font-style: normal; }

.li-card-actions {
  display: flex;
  border-top: 1px solid var(--border);
}

.li-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 4px;
  font-size: .75rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-2);
  background: none;
  border: none;
  cursor: default;
  opacity: .6;
}

/* ── LINKEDIN EDIT ──────────────────────────────── */
.li-edit-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  overflow-y: auto;
}

.li-edit-text {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: .84rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  resize: vertical;
  min-height: 220px;
  line-height: 1.65;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.li-edit-text:focus {
  border-color: #0a66c2;
  box-shadow: 0 0 0 3px rgba(10,102,194,.12);
}

.li-char-count {
  font-size: .72rem;
  color: var(--text-2);
  text-align: right;
}
.li-char-count.warn { color: #fbbf24; }
.li-char-count.over { color: #f87171; font-weight: 600; }

.li-edit-hint {
  font-size: .72rem;
  color: var(--text-2);
  margin: 0;
}

.linkedin-preview-image-wrap {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
  max-width: 320px;
  margin: 0 auto;
}

.linkedin-preview-img {
  width: 100%;
  display: block;
  aspect-ratio: 1;
  object-fit: cover;
  transition: opacity .3s, filter .3s;
}

.linkedin-preview-img.loading {
  opacity: .35;
  filter: blur(3px);
}

.li-img-placeholder {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-2);
  font-size: .78rem;
  background: var(--surface-2);
}

.li-img-btns {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
}

.li-img-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: .73rem;
  font-family: inherit;
  font-weight: 600;
  color: #fff;
  background: rgba(0,0,0,.55);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background .15s, opacity .15s;
  white-space: nowrap;
}
.li-img-btn:hover:not(:disabled)    { background: rgba(0,0,0,.75); }
.li-img-btn:disabled                { opacity: .4; cursor: not-allowed; }
.li-img-btn--upload                 { background: rgba(10,102,194,.7); }
.li-img-btn--upload:hover:not(:disabled) { background: rgba(10,102,194,.9); }

/* keep old name for compat */
.linkedin-regen-btn { display: none; }

/* ── FORMAT-LEISTE ──────────────────────────────── */
.fmt-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.fmt-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 5px;
  font-size: .72rem;
  font-weight: 600;
  background: none;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.fmt-btn:hover  { background: var(--surface); border-color: var(--border); }
.fmt-btn:active { background: var(--border); }

.fmt-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
}

.preview-html-frame {
  flex: 1;
  border: none;
  width: 100%;
}

.preview-html-editor {
  flex: 1;
  border: none;
  padding: 14px;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: .72rem;
  color: var(--text);
  background: var(--surface);
  resize: none;
  outline: none;
  line-height: 1.6;
  tab-size: 2;
}

/* ── TERMIN-FORMULAR ───────────────────────────── */
.termin-form {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.termin-row {
  display: flex;
  gap: 12px;
}
.termin-row .termin-field { flex: 1; }

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

.termin-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .02em;
}

.termin-input {
  padding: 8px 11px;
  font-size: .82rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
  box-sizing: border-box;
}
.termin-input:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14,165,233,.12);
}

.termin-textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

/* ── LEAD FORM ─────────────────────────────────── */
.lead-form {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow-y: auto;
}

.lead-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lead-section-label {
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-2);
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
}

.lead-row {
  display: flex;
  gap: 10px;
}
.lead-row .lead-field { flex: 1; min-width: 0; }

.lead-field {
  position: relative;
}

.lead-input {
  width: 100%;
  box-sizing: border-box;
  padding: 18px 12px 6px;
  font-size: .84rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.lead-input:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14,165,233,.12);
}

.lead-label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .84rem;
  color: var(--text-2);
  pointer-events: none;
  transition: top .15s ease, transform .15s ease, font-size .15s ease, color .15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 24px);
}

.lead-input:focus + .lead-label,
.lead-input:not(:placeholder-shown) + .lead-label {
  top: 7px;
  transform: none;
  font-size: .63rem;
  font-weight: 600;
  letter-spacing: .03em;
  color: #0ea5e9;
}

.lead-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
  padding-top: 20px;
}

.lead-field--area .lead-label {
  top: 14px;
  transform: none;
}
.lead-textarea:focus + .lead-label,
.lead-textarea:not(:placeholder-shown) + .lead-label {
  top: 5px;
  transform: none;
  font-size: .63rem;
  font-weight: 600;
  letter-spacing: .03em;
  color: #0ea5e9;
}

/* ── EMPTY STATE ───────────────────────────────── */
.empty-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

.empty-divider {
  width: 1px;
  height: 64px;
  background: var(--border);
  flex-shrink: 0;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(14,165,233,.12);
  border: 1px solid rgba(56,189,248,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
}

.empty-state h3 { font-size: .88rem; font-weight: 600; color: var(--text-2); }
.empty-state p  { font-size: .76rem; color: var(--text-3); max-width: 200px; line-height: 1.5; }

/* ── TOAST ──────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 100;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--deck-bg);
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.88);
  padding: 11px 14px;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  font-size: .8rem;
  max-width: 300px;
  animation: toastIn .2s cubic-bezier(.34,1.56,.64,1);
}

.toast-dot { width: 6px; height: 6px; border-radius: 50%; background: #38bdf8; flex-shrink: 0; }
.toast span { flex: 1; }
.toast button {
  background: none; border: none; color: rgba(255,255,255,.3);
  cursor: pointer; font-size: .75rem; padding: 0; flex-shrink: 0;
}
.toast button:hover { color: rgba(255,255,255,.7); }

@keyframes toastIn {
  from { transform: translateY(8px) scale(.95); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* ── SIDEBAR LADE- UND FEHLERZUSTAND ───────────── */
.sidebar-status {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 16px;
  text-align: center;
  font-size: .78rem;
  color: var(--text-3);
  line-height: 1.5;
}

.sidebar-status.error { color: var(--text-2); }
.sidebar-status.error svg { color: #f87171; }

.sidebar-status button {
  margin-top: 4px;
  padding: 5px 14px;
  font-size: .72rem;
  font-weight: 600;
  color: #7dd3fc;
  background: rgba(14,165,233,.12);
  border: 1px solid rgba(56,189,248,.22);
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.sidebar-status button:hover { background: rgba(14,165,233,.2); border-color: rgba(56,189,248,.35); }

.sidebar-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-2);
  border-top-color: #0369a1;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

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

/* ── HILFKLASSEN ────────────────────────────────── */
.hidden { display: none !important; }

/* ── FOOTER (fixed, immer sichtbar) ─────────────── */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-h);
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 16px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  font-size: .72rem;
  color: var(--text-3);
}

/* ═══════════════════════════════════════════════════
   CLAUDE CHAT
   ═══════════════════════════════════════════════════ */

/* ── FAB ────────────────────────────────────────── */
.chat-fab {
  position: fixed;
  bottom: calc(var(--footer-h) + 20px);
  right: 20px;
  z-index: 10;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--chrome);
  border: 1px solid rgba(184,220,255,.3);
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow:
    0 4px 18px rgba(74,126,192,.45),
    0 2px 6px rgba(0,0,0,.3),
    inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform var(--transition), box-shadow var(--transition), background .2s;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.chat-fab:hover:not(:disabled)  { transform: scale(1.08); box-shadow: 0 6px 26px rgba(74,126,192,.6), 0 3px 8px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.3); }
.chat-fab:active:not(:disabled) { transform: scale(.94); }
.chat-fab--dragging              { cursor: grabbing !important; transform: scale(1.1) !important; box-shadow: 0 8px 32px rgba(74,126,192,.65), 0 4px 10px rgba(0,0,0,.4) !important; }
.chat-fab.open   { background: linear-gradient(140deg, #0a1828 0%, #1a2f4a 40%, rgba(80,130,210,.15) 55%, #0a1828 100%); border-color: rgba(80,130,210,.25); }
.chat-fab:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }

.chat-fab-icon-open  { display: block; }
.chat-fab-icon-close { display: none;  }
.chat-fab.open .chat-fab-icon-open  { display: none;  }
.chat-fab.open .chat-fab-icon-close { display: block; }

.chat-fab.has-unread::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f43f5e;
  border: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(244,63,94,.28);
  animation: chatBadgePop .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes chatBadgePop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* ── PANEL ──────────────────────────────────────── */
.chat-panel {
  position: fixed;
  bottom: calc(var(--footer-h) + 76px);
  right: 16px;
  z-index: 9;
  width: calc(100% - 32px);
  max-width: 420px;
  height: 480px;
  background: rgba(9,12,22,.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(80,130,210,.2);
  border-top: 1px solid rgba(184,220,255,.12);
  border-radius: 18px;
  box-shadow:
    0 24px 64px rgba(0,0,0,.5),
    0 4px 16px rgba(0,0,0,.3),
    inset 0 1px 0 rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(14px) scale(.97);
  opacity: 0;
  pointer-events: none;
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), opacity .18s ease;
}
.chat-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

.chat-status-live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── HEADER ─────────────────────────────────────── */
.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 8px 14px;
  flex-shrink: 0;
}

.chat-header + .chat-role-bar {
  border-bottom: 1px solid var(--border);
}

.chat-header:has(+ .chat-messages) {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.chat-header-avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.chat-header-info   { flex: 1; min-width: 0; }
.chat-header-title  { font-size: .82rem; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.chat-header-sub    { font-size: .67rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

.chat-icon-btn {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 5px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.chat-icon-btn:hover { background: var(--surface-2); color: var(--text-2); }

/* ── ROLLEN-SELEKTOR ────────────────────────────── */
.chat-role-bar {
  padding: 0 14px 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.chat-role-prefix {
  font-size: .63rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-3);
  flex-shrink: 0;
}

.chat-role-dropdown {
  position: relative;
}

.chat-role-native {
  display: none;
}

.chat-role-trigger {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px 4px 12px;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
  white-space: nowrap;
}
.chat-role-trigger:hover:not(:disabled) { border-color: var(--border-2); background: var(--bg); }
.chat-role-trigger:disabled { opacity: .4; cursor: not-allowed; }
.chat-role-trigger svg   { color: var(--text-3); flex-shrink: 0; transition: transform var(--transition); }

.chat-role-menu {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  padding: 4px;
  z-index: 20;
}
.chat-role-menu.open { display: block; }

.chat-role-option {
  display: block;
  width: 100%;
  text-align: left;
  font-size: .73rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-2);
  background: none;
  border: none;
  border-radius: 7px;
  padding: 6px 10px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.chat-role-option:hover:not(:disabled)  { background: var(--surface-2); color: var(--text); }
.chat-role-option.active                { color: #60a5fa; font-weight: 600; }
.chat-role-option.unavailable           { opacity: .35; cursor: not-allowed; pointer-events: none; }

.chat-role-group-label {
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 8px 10px 3px;
}

/* ── MESSAGES ───────────────────────────────────── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: .8rem;
  line-height: 1.5;
  margin: auto 0;
}

.chat-welcome-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
}

/* Bubbles */
.chat-msg { display: flex; flex-direction: column; max-width: 88%; }
.chat-msg.user      { align-self: flex-end;   align-items: flex-end; }
.chat-msg.assistant { align-self: flex-start; align-items: flex-start; }

.chat-bubble {
  padding: 9px 13px;
  border-radius: 12px;
  font-size: .81rem;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-msg.user      .chat-bubble { background: var(--grad); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.assistant .chat-bubble { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-bottom-left-radius: 4px; }
.chat-msg--error .chat-bubble {
  background: rgba(127,29,29,.32);
  border-color: rgba(248,113,113,.45);
  color: #fecaca;
}

.chat-timestamp { font-size: .65rem; opacity: .5; margin-top: 2px; }
.chat-msg.user      .chat-timestamp { text-align: right; }
.chat-msg.assistant .chat-timestamp { text-align: left; }

/* Bestätigungs-Bubble */
.chat-bubble--confirm {
  background: var(--surface-2);
  border: 1px solid rgba(14,165,233,.35) !important;
  padding: 11px 13px 10px;
}
.chat-confirm-label {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  color: #0ea5e9;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.chat-confirm-list {
  margin: 0 0 10px 0;
  padding: 0 0 0 14px;
  font-size: .8rem;
  color: var(--text);
  line-height: 1.7;
}
.chat-confirm-btns {
  display: flex;
  gap: 6px;
}
.chat-confirm-ja, .chat-confirm-nein {
  flex: 1;
  padding: 5px 10px;
  border: none;
  border-radius: 7px;
  font-size: .76rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.chat-confirm-ja   { background: #0ea5e9; color: #fff; }
.chat-confirm-nein { background: rgba(255,255,255,.08); color: var(--text-2); }
.chat-confirm-ja:hover   { opacity: .85; }
.chat-confirm-nein:hover { opacity: .7; }
.chat-confirm-status {
  font-size: .78rem;
  color: var(--text-2);
}

/* Typing indicator */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  color: var(--text-2);
  font-size: .78rem;
}

.chat-typing-label {
  line-height: 1;
}

.chat-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chat-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  animation: chat-bounce .9s ease-in-out infinite;
}
.chat-typing-dot:nth-child(2) { animation-delay: .15s; }
.chat-typing-dot:nth-child(3) { animation-delay: .30s; }

@keyframes chat-bounce {
  0%, 80%, 100% { transform: translateY(0);   opacity: .4; }
  40%            { transform: translateY(-5px); opacity: 1;  }
}

/* ── INPUT ──────────────────────────────────────── */
.chat-input-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  min-height: 36px;
  max-height: 120px;
  padding: 7px 11px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .81rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  resize: none;
  outline: none;
  line-height: 1.45;
  overflow-y: auto;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.chat-input:focus          { border-color: #7dd3fc; box-shadow: 0 0 0 3px rgba(125,211,252,.15); }
.chat-input::placeholder   { color: var(--text-3); }

.chat-attach-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  transition: all var(--transition);
}
.chat-attach-btn:hover           { background: var(--surface-2); color: var(--text-2); border-color: var(--border-2); }
.chat-attach-btn.active          { background: rgba(14,165,233,.15); border-color: rgba(125,211,252,.35); color: #7dd3fc; }
.chat-attach-btn.active:hover    { background: rgba(14,165,233,.25); }

.chat-send-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--grad);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: opacity var(--transition), transform var(--transition);
}
.chat-send-btn:hover:not(:disabled)  { opacity: .85; }
.chat-send-btn:active:not(:disabled) { transform: scale(.92); }
.chat-send-btn:disabled              { opacity: .65; cursor: not-allowed; }
.chat-send-btn.is-loading svg        { display: none; }
.chat-send-btn.is-loading::before {
  content: '';
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  animation: chat-send-spin .75s linear infinite;
}

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

/* ── Desktop: mobile-only elements hidden ────────── */
.mobile-nav             { display: none; }
.mobile-back-btn        { display: none; }
.mobile-home-count      { display: none; }
.customer-item-chevron  { display: none; }
.drawer-overlay         { display: none; }
.mobile-no-customer-bar { display: none; }
.burger-btn             { display: none; }
.drawer-close-btn       { display: none; }

/* ═══════════════════════════════════════════════════
   MOBIL — Burger-Drawer Design (≤ 768px)
   ═══════════════════════════════════════════════════ */
@media (max-width: 768px) {

  html, body { height: 100%; overflow: hidden; }
  * { -webkit-tap-highlight-color: transparent; }
  .app { height: 100dvh; overflow: hidden; position: relative; }

  /* ── Dimm-Overlay ── */
  .drawer-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(0,0,0,.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .32s cubic-bezier(.4,0,.2,1);
  }
  .app.drawer-open .drawer-overlay {
    opacity: 1;
    pointer-events: all;
  }

  /* ── Sidebar → Left Drawer ── */
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 85%;
    max-width: 320px;
    height: 100%;
    z-index: 200;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    overflow: hidden;
    background: var(--surface);
    transform: translateX(-100%);
    transition: transform .32s cubic-bezier(.4,0,.2,1);
    will-change: transform;
    box-shadow: 4px 0 24px rgba(0,0,0,.15);
  }
  .sidebar-resize-handle { display: none; }
  .app.drawer-open .sidebar { transform: translateX(0); }

  /* Drawer schließen-Button */
  .drawer-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    background: none;
    color: var(--text-2);
    border-radius: 8px;
    cursor: pointer;
    touch-action: manipulation;
    margin-left: auto;
    flex-shrink: 0;
  }
  .drawer-close-btn:active { background: var(--surface-2); }

  .sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 14px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--surface);
  }
  .sidebar-logo .logo-icon { width: 30px; height: 30px; border-radius: 9px; font-size: .66rem; flex-shrink: 0; }
  .sidebar-logo > span:not(.mobile-home-count) { font-size: .88rem; font-weight: 700; letter-spacing: -.02em; }

  .mobile-home-count {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .64rem;
    font-weight: 700;
    color: var(--text-3);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2px 8px;
    flex-shrink: 0;
  }

  .sidebar-section-header { display: none; }
  .sidebar-collapse-btn  { display: none; }
  .sidebar-expand-btn    { display: none; }

  /* Sidebar-Sektionen füllen restliche Höhe und scrollen */
  #sidebarCrmSection,
  #sidebarEingangSection {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  /* DB-Listen scrollen als Ganzes */
  #sidebarEingangSection {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  /* Kundenliste */
  .customer-list {
    flex: 1;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    gap: 0;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    user-select: none;
  }

  .kunden-filter-summary {
    margin: -2px 10px 10px;
    padding: 0;
  }

  .kunden-filter-chips {
    width: 100%;
    align-items: flex-start;
  }

  .kunden-filter-chip {
    max-width: 100%;
  }

  .kunden-filter-chip span:first-child {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .customer-list .customer-group         { display: block; width: 100%; }
  .customer-list .customer-group details { display: block; }
  .customer-list .customer-group-items   {
    display: flex !important;
    flex-direction: column;
    padding: 0;
    margin: 0;
    gap: 0;
  }

  .customer-group-header {
    display: flex;
    padding: 8px 16px 4px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    cursor: default;
    min-height: 0;
  }
  .customer-group-header:hover { background: var(--surface-2); }
  .customer-group-header .group-chevron { display: none; }
  .customer-group-letter { font-size: .6rem; letter-spacing: .12em; }

  .customer-item {
    flex-direction: row;
    align-items: center;
    text-align: left;
    padding: 12px 16px;
    min-width: 0;
    width: 100%;
    gap: 12px;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border);
    min-height: 64px;
    touch-action: manipulation;
    background: var(--surface);
  }
  .customer-item:active { background: var(--surface-2); }
  .customer-item.active { background: rgba(13,107,220,.1); border-color: rgba(80,130,210,.35); }
  .mandant-item.active  { background: rgba(16,185,129,.09); border-color: rgba(74,222,128,.25); }
  .mandant-item:active  { background: rgba(16,185,129,.15); }

  .customer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    font-size: .78rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(3,105,161,.15);
  }

  .customer-item-info    { flex: 1; min-width: 0; }
  .customer-item-name    { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .customer-item-company { display: block !important; font-size: .72rem; color: var(--text-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sidebar-status-dot    { width: 9px; height: 9px; margin-left: 0; flex-shrink: 0; }
  .customer-item-chevron { display: block; flex-shrink: 0; color: var(--border-2); }
  .customer-expand-panel { padding-left: 50px; }

  /* ── Main — immer sichtbar ── */
  .main {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    z-index: 10;
    background: var(--bg);
    overflow: hidden;
  }

  /* ── No-Customer Top Bar ── */
  .mobile-no-customer-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .mobile-no-customer-bar .logo-icon { width: 28px; height: 28px; border-radius: 8px; font-size: .62rem; flex-shrink: 0; }
  .mobile-no-customer-bar > span { font-size: .88rem; font-weight: 700; letter-spacing: -.02em; flex: 1; }

  /* ── Burger-Button ── */
  .burger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: none;
    background: none;
    color: var(--text);
    border-radius: 10px;
    cursor: pointer;
    touch-action: manipulation;
  }
  .burger-btn:active { background: var(--surface-2); }

  /* ── Kunden-Header ── */
  .customer-header {
    position: static;
    height: auto;
    padding: 8px 14px;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }
  .customer-header-avatar  { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; }
  .customer-header-name    { font-size: .84rem; }
  .customer-header-company { font-size: .68rem; }

  .customer-status {
    margin-left: auto;
    width: auto;
    border-top: none;
    padding-top: 0;
    margin-top: 0;
    gap: 6px;
    flex-shrink: 0;
  }

  .metadata-strip {
    position: static;
    flex-shrink: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    scrollbar-width: none;
  }
  .metadata-strip::-webkit-scrollbar { display: none; }
  .meta-copy-btn { opacity: 1; }

  .inactive-banner { border-radius: 0; flex-shrink: 0; }

  /* ── Main-Left ── */
  .main-left {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    position: static;
    height: auto;
    overflow: hidden;
    min-height: 0;
  }
  .main-left.mobile-expand { flex: 1; overflow: hidden; }

  .main-left:not(.mobile-expand) .preview-panel { display: none !important; }
  .main-left:not(.mobile-expand) .empty-wrap    { display: none !important; }

  .main-left.mobile-expand .preview-panel {
    flex: 1;
    position: static;
    height: auto;
    border-right: none;
  }

  .empty-wrap { flex: 1; min-height: 0; }
  .deck-resize-handle { display: none; }

  /* ── Deck ── */
  .deck-scroll {
    flex: 1;
    width: 100%;
    min-height: 0;
    position: static;
    border-left: none;
    border-top: 1px solid var(--border);
    background: var(--bg);
    padding: 14px 12px 20px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    box-shadow: none;
  }
  .deck-scroll::-webkit-scrollbar { display: none; }

  .deck-toolbar { margin-bottom: 14px; }

  .deck-tabs { flex: 1; padding: 4px; gap: 3px; border-radius: 10px; }
  .deck-tab {
    flex: 1;
    padding: 10px 0;
    font-size: .78rem;
    min-height: 42px;
    text-align: center;
    touch-action: manipulation;
    border-radius: 7px;
  }
  .toggle-all-btn { padding: 9px 12px; min-height: 42px; font-size: .7rem; touch-action: manipulation; }

  .deck       { flex-direction: column; gap: 10px; }
  .deck-group { flex-shrink: unset; width: 100%; }
  .deck-group-header { padding: 12px 16px; min-height: 48px; }

  .deck-workflow {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 6px 8px 10px;
  }
  .deck-btn {
    width: 100%;
    height: 62px;
    gap: 10px;
    padding: 0 12px 0 16px;
    touch-action: manipulation;
    border-radius: 12px;
  }
  .deck-workflow .deck-btn:only-child { grid-column: span 2; }
  .deck-step-num { display: none; }
  .deck-icon     { width: 19px; height: 19px; }
  .deck-label    { font-size: .73rem; line-height: 1.3; white-space: normal; }

  /* ── Bottom Tab Bar ── */
  .mobile-nav {
    display: flex;
    flex-shrink: 0;
    height: 60px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -1px 0 var(--border), 0 -4px 20px rgba(0,0,0,.06);
  }

  .mobile-nav-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: none;
    background: none;
    color: var(--text-3);
    font-size: .57rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color var(--transition);
    position: relative;
    padding: 0 0 2px;
    touch-action: manipulation;
  }
  .mobile-nav-tab.active { color: #60a5fa; }
  .mobile-nav-tab:active { background: var(--surface-2); }

  .mobile-nav-tab.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2.5px;
    background: linear-gradient(90deg, #0b3060, #0ea5e9);
    border-radius: 0 0 3px 3px;
  }

  .mobile-nav-tab.has-content::after {
    content: '';
    position: absolute;
    top: 10px;
    right: calc(50% - 20px);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0ea5e9;
    border: 2px solid var(--surface);
    animation: badgePop .3s cubic-bezier(.34,1.56,.64,1);
  }

  @keyframes badgePop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
  }

  /* ── Chat & Toast ── */
  .chat-fab {
    position: fixed;
    bottom: 76px;
    right: 16px;
    z-index: 300;
  }

  .chat-panel {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 136px;
    width: auto;
    max-width: none;
    height: 56vh;
    z-index: 299;
    border-radius: 16px;
  }

  .chat-role-native {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
  }

  .chat-role-menu { display: none !important; }

  .toast-container { left: 50%; right: auto; transform: translateX(-50%); bottom: 70px; width: calc(100% - 24px); }
  .toast           { max-width: 100%; }

  footer { display: none; }
}

/* ════════════════════════════════════════════════════
   ANIMATIONEN
   ════════════════════════════════════════════════════ */

/* ── Tab-Wechsel: Gruppen raus- / reinfahren ─────── */
@keyframes deck-slide-out {
  from { transform: translateX(0)    opacity: 1; }
  to   { transform: translateX(-22px); opacity: 0; }
}
@keyframes deck-slide-in {
  from { transform: translateX(22px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.deck-group--exit {
  animation: deck-slide-out .15s cubic-bezier(.4,0,1,1) forwards;
  pointer-events: none;
}
.deck-group--enter {
  animation: deck-slide-in .22s cubic-bezier(0,.6,.3,1) both;
}

/* ── LinkedIn Hintergrundbild-Auswahl ────────────── */
.linkedin-bild-auswahl {
  padding: 10px 12px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.linkedin-bild-auswahl-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}
.linkedin-bild-auswahl-ladehinweis {
  font-size: 11px;
  color: var(--text-3);
}
.linkedin-bild-galerie {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.linkedin-bild-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  flex-shrink: 0;
}
.linkedin-bild-thumb {
  width: 72px;
  height: 72px;
  border-radius: 6px;
  border: 2px solid var(--border);
  object-fit: cover;
  display: block;
  transition: border-color .15s, box-shadow .15s;
  background: var(--surface);
}
.linkedin-bild-thumb.laden {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: li-skeleton 1.4s infinite linear;
}
@keyframes li-skeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.linkedin-bild-option:hover .linkedin-bild-thumb { border-color: #0a66c2; }
.linkedin-bild-option.aktiv .linkedin-bild-thumb {
  border-color: #0a66c2;
  border-width: 3px;
  box-shadow: 0 0 0 2px rgba(10,102,194,.25);
}
.linkedin-bild-option-name {
  font-size: 10px;
  color: var(--text-3);
  white-space: nowrap;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .15s;
}
.linkedin-bild-option.aktiv .linkedin-bild-option-name {
  color: #0a66c2;
  font-weight: 600;
}
.linkedin-bild-option.loading .linkedin-bild-thumb {
  opacity: .5;
  pointer-events: none;
}

/* ── LinkedIn Themenauswahl ──────────────────────── */
/* ── LinkedIn Themenauswahl (alte Klassen — CDN-Kompatibilität) ──────────── */

.linkedin-themen-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 20px 16px 16px;
  min-height: 200px;
}
.linkedin-themen-kopf, .facebook-themen-kopf {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
}
.linkedin-themen-ladehinweis, .facebook-themen-ladehinweis,
.linkedin-themen-leer {
  font-size: 13px;
  color: var(--text-3);
  padding: 12px 0;
}
.linkedin-themen-liste {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  max-height: 420px;
}
.linkedin-themen-gruppe {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.linkedin-themen-kat {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 2px 4px;
}
.linkedin-thema-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  line-height: 1.4;
}
.linkedin-thema-item:hover { background: rgba(14,165,233,.1); border-color: rgba(56,189,248,.3); }
.linkedin-thema-item--posted { opacity: .75; }
.linkedin-thema-text { flex: 1; text-align: left; }
.li-status { flex-shrink: 0; font-size: 10px; font-weight: 600; letter-spacing: .03em; padding: 2px 7px; border-radius: 99px; white-space: nowrap; }
.li-status--draft  { background: rgba(100,116,139,.15); color: #94a3b8; }
.li-status--ready  { background: rgba(14,165,233,.15);  color: #38bdf8; }
.li-status--posted { background: rgba(34,197,94,.13);   color: #4ade80; }
.linkedin-thema-warn { flex: 1; font-size: 12px; color: #92400e; text-align: left; }
.linkedin-thema-confirm-btns { display: flex; gap: 6px; flex-shrink: 0; }
.linkedin-thema-ja, .linkedin-thema-nein { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 6px; border: none; cursor: pointer; }
.linkedin-thema-ja   { background: #0a66c2; color: #fff; }
.linkedin-thema-nein { background: rgba(255,255,255,.07); color: var(--text-2); }
.linkedin-themen-footer { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.linkedin-thema-zufall, .fb-thema-zufall {
  width: 100%;
  background: transparent;
  border: 1px dashed var(--border-2);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.linkedin-thema-zufall:hover, .fb-thema-zufall:hover { background: var(--surface-2); border-color: var(--text-3); }
.facebook-themen-wrap { display: flex; flex-direction: column; gap: 0; padding: 20px 16px 16px; min-height: 200px; }

/* ── LinkedIn Themenauswahl (neue Klassen — nach CDN-Deploy aktiv) ──────── */

.li-topic-picker {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px 16px 0;
  min-height: 200px;
  box-sizing: border-box;
}
.li-topic-header {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}
.li-topic-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* Filter-Chips */
.li-topic-filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.li-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
}
.li-filter-chip:hover {
  border-color: #0a66c2;
  color: #0a66c2;
}
.li-filter-chip--active {
  background: #0a66c2;
  border-color: #0a66c2;
  color: #fff;
}
.li-filter-chip--active:hover {
  background: #0856a8;
  color: #fff;
}
.li-filter-count {
  font-size: 11px;
  font-weight: 700;
  opacity: .85;
}

/* Suche */
.li-topic-search-wrap {
  position: relative;
  margin-bottom: 14px;
}
.li-topic-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.li-topic-search {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
  box-sizing: border-box;
}
.li-topic-search:focus {
  border-color: #0a66c2;
  background: var(--surface-1);
}

/* Liste */
.li-topic-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 8px;
}
.li-topic-gruppe {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.li-topic-kat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}
.li-topic-kat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-3);
}
.li-topic-kat-count {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 1px 7px;
}

/* Karten */
.li-topic-card {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-left-style: solid;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  font-family: inherit;
  transition: box-shadow var(--transition), border-color var(--transition), background var(--transition);
}
.li-topic-card:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.li-topic-card--ready  { border-left-color: #0a66c2; }
.li-topic-card--draft  { border-left-color: #94a3b8; }
.li-topic-card--posted { border-left-color: #22c55e; opacity: .82; }
.li-topic-card--posted:hover { opacity: 1; }

.li-topic-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.li-topic-card-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}
.li-topic-card-date {
  font-size: 11px;
  color: var(--text-3);
}
.li-topic-card-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
  margin-top: 2px;
}
.li-topic-badge--draft  { background: rgba(100,116,139,.15); color: #94a3b8; }
.li-topic-badge--ready  { background: rgba(14,165,233,.15);  color: #38bdf8; }
.li-topic-badge--posted { background: rgba(34,197,94,.13);   color: #4ade80; }

/* Bestätigung (bereits gepostet) */
.li-topic-card-confirm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}
.li-topic-confirm-text {
  flex: 1;
  font-size: 12px;
  color: #92400e;
  text-align: left;
}
.li-topic-confirm-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.li-confirm-ja,
.li-confirm-nein {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.li-confirm-ja   { background: #0a66c2; color: #fff; }
.li-confirm-nein { background: rgba(255,255,255,.07); color: var(--text-2); }

/* Leer-State */
.li-topic-leer {
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
  padding: 32px 16px;
  line-height: 1.7;
}

/* Footer */
.li-topic-footer {
  flex-shrink: 0;
  padding: 12px 0 16px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.li-topic-random {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: transparent;
  border: 1px dashed var(--border-2);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--transition);
}
.li-topic-random:hover {
  background: rgba(10,102,194,.12);
  border-color: rgba(10,102,194,.5);
  color: #60a5fa;
  border-style: solid;
}

/* ── Facebook ────────────────────────────────────── */

.facebook-loading {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 48px 24px;
  box-sizing: border-box;
}
.facebook-loading-logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #1877f2;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: facebookPulse 2s ease-in-out infinite;
}
@keyframes facebookPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(24,119,242,.5); }
  50%       { box-shadow: 0 0 0 12px rgba(24,119,242,0); }
}
.facebook-loading-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}
.facebook-loading-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 220px;
}
.facebook-step {
  font-size: 12px;
  color: var(--text-3);
  padding-left: 20px;
  position: relative;
}
.facebook-step::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background .3s;
}
.facebook-step.active { color: var(--text-1); font-weight: 500; }
.facebook-step.active::before {
  background: #1877f2;
  animation: facebookDot .8s ease-in-out infinite alternate;
}
.facebook-step.done { color: var(--text-3); }
.facebook-step.done::before { background: #1877f2; animation: none; }
@keyframes facebookDot {
  from { transform: translateY(-50%) scale(1); }
  to   { transform: translateY(-50%) scale(1.4); }
}

/* Facebook post card */
.fb-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
  overflow: hidden;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  margin: 8px 0 0;
}
.fb-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 8px;
}
.fb-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1877f2;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fb-card-meta { flex: 1; min-width: 0; }
.fb-card-name {
  font-size: 14px;
  font-weight: 700;
  color: #050505;
  line-height: 1.3;
}
.fb-card-sub {
  font-size: 12px;
  color: #65676b;
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 1px;
}
.fb-card-brand { flex-shrink: 0; opacity: .9; }
.fb-card-text {
  padding: 2px 16px 12px;
  font-size: 14px;
  color: #050505;
  line-height: 1.65;
}
.fb-card-hook { font-weight: 600; }
.fb-card-cta {
  margin: 0 16px 12px;
  padding: 8px 12px;
  background: #f0f2f5;
  border-radius: 6px;
  font-size: 12px;
  color: #65676b;
  font-style: italic;
}
.fb-card-reactions {
  display: flex;
  justify-content: space-between;
  padding: 6px 16px;
  font-size: 13px;
  color: #65676b;
}
.fb-reaction-count em { font-style: normal; font-weight: 600; }
.fb-card-divider {
  border: none;
  border-top: 1px solid #e4e6ea;
  margin: 0 16px;
}
.fb-card-actions {
  display: flex;
  padding: 4px 8px 8px;
}
.fb-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 4px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #65676b;
  transition: background .15s;
}
.fb-action-btn:hover { background: #f0f2f5; }

/* Facebook image wrap */
.facebook-preview-image-wrap {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
  max-width: 320px;
  margin: 0 auto;
  border-radius: var(--radius-sm);
}
.facebook-preview-img {
  width: 100%;
  display: block;
  aspect-ratio: 1;
  object-fit: cover;
  transition: opacity .3s, filter .3s;
}
.facebook-preview-img.loading { opacity: .5; transition: opacity .2s; }
.fb-img-btn--upload { background: rgba(24,119,242,.7) !important; }
.fb-img-btn--upload:hover:not(:disabled) { background: rgba(24,119,242,.9) !important; }
.fb-send-btn { background: #1877f2 !important; }
.fb-send-btn:hover:not(:disabled) { background: #1666d8 !important; }

/* Facebook Themen */
.facebook-themen-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}
.facebook-themen-kopf {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  padding: 16px 16px 8px;
  border-bottom: 1px solid var(--border);
}
.facebook-themen-ladehinweis { padding: 24px 16px; font-size: 13px; color: var(--text-3); }

/* Facebook Bild-Auswahl */
.facebook-bild-auswahl {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0 6px;
  flex-wrap: wrap;
}
.facebook-bild-auswahl-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .05em;
  flex-shrink: 0;
}
.facebook-bild-auswahl-ladehinweis { font-size: 11px; color: var(--text-3); }
.facebook-bild-galerie { display: flex; gap: 6px; flex-wrap: wrap; }
.facebook-bild-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.facebook-bild-thumb {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  border: 2px solid transparent;
  transition: border-color .15s;
}
.facebook-bild-thumb.laden {
  background: var(--surface-2);
  animation: shimmer 1.4s ease-in-out infinite;
}
.facebook-bild-option:hover .facebook-bild-thumb { border-color: #1877f2; }
.facebook-bild-option.aktiv .facebook-bild-thumb {
  border-color: #1877f2;
  box-shadow: 0 0 0 2px rgba(24,119,242,.3);
}
.facebook-bild-option-name {
  font-size: 10px;
  color: var(--text-3);
  max-width: 48px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.facebook-bild-option.aktiv .facebook-bild-option-name { color: #1877f2; }
.facebook-bild-option.loading .facebook-bild-thumb { opacity: .5; }
.fb-thema-zufall { border-color: #1877f2 !important; color: #1877f2 !important; }
.fb-thema-zufall:hover { background: rgba(24,119,242,.08) !important; }

/* ── Facebook Repost ─────────────────────────────── */
.fb-repost-content {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fb-repost-sub {
  font-size: .78rem;
  color: var(--text-3);
  margin: 0;
}
.fb-repost-slots { display: flex; flex-direction: column; gap: 12px; }
.fb-repost-slot { display: flex; gap: 10px; align-items: flex-start; }
.fb-repost-slot-nr {
  width: 22px;
  height: 22px;
  min-width: 22px;
  background: #1877f2;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  margin-top: 7px;
}
.fb-repost-slot-fields { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.fb-repost-url,
.fb-repost-msg {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  font-size: .82rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.fb-repost-url:focus,
.fb-repost-msg:focus {
  border-color: #1877f2;
  box-shadow: 0 0 0 3px rgba(24,119,242,.12);
}
.fb-repost-msg { resize: none; line-height: 1.4; }

/* ── AKQUISE-GENERATOR (Preview-Panel) ──────────── */

.akquise-form-wrap { padding: 20px; }
.akquise-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.akquise-field { display: flex; flex-direction: column; gap: 5px; }
.akquise-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-2);
}
.akquise-optional { font-weight: 400; color: var(--text-3); font-size: .74rem; }
.akquise-input {
  padding: 8px 11px;
  font-size: .86rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.akquise-input:focus {
  outline: none;
  border-color: #a78bfa;
  box-shadow: 0 0 0 3px rgba(167,139,250,.15);
}
.akquise-textarea { resize: vertical; min-height: 72px; }
.akquise-hint {
  padding: 16px 20px 0;
  font-size: .85rem;
  color: var(--text-2);
  line-height: 1.6;
}
.akquise-submit { width: 100%; justify-content: center; margin-top: 4px; }

.akquise-output { padding: 0 20px 20px; }
.akquise-stream-wrap { position: relative; }
.akquise-stream-text {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: .86rem;
  line-height: 1.75;
  color: var(--text);
  margin: 0 0 4px;
}
.akquise-cursor {
  display: inline-block;
  color: #a78bfa;
  animation: blink 1s step-end infinite;
}
.akquise-result-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.akquise-error {
  font-size: .83rem;
  color: #dc2626;
  line-height: 1.6;
  padding: 12px 0;
}
.akquise-error code {
  display: block;
  margin-top: 6px;
  font-size: .78rem;
  background: var(--surface-2);
  padding: 5px 8px;
  border-radius: 5px;
  color: var(--text);
}

/* ── Button-Ripple (Material) ────────────────────── */
@keyframes btn-ripple {
  to { transform: scale(5); opacity: 0; }
}
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.14);
  transform: scale(0);
  animation: btn-ripple .5s ease-out forwards;
  pointer-events: none;
}
