/* Wiederverwendbare UI-Bausteine: Karten, Buttons, Badges, Formulare, Navigation. */

/* ── Karten ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--sp-5);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: var(--sp-4); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}
.card-title    { font-size: 0.9rem; font-weight: 700; }
.card-subtitle { font-size: var(--text-sm); color: var(--text-2); margin-top: 2px; }

/* ── Statistik-Karten ────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--sp-5);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.stat-label {
  font-size: var(--text-xs);
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}
.stat-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 9px var(--sp-4);
  border-radius: var(--r-sm);
  border: none;
  font-size: 0.84rem;
  font-weight: 600;
  font-family: inherit;
  transition: background var(--dur-fast), box-shadow var(--dur-fast),
              transform var(--dur-fast), color var(--dur-fast);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn-sm  { padding: 6px 11px; font-size: var(--text-sm); }
.btn-lg  { padding: 13px var(--sp-6); font-size: var(--text-lg); border-radius: var(--r); }
.btn-block { width: 100%; }

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { background: var(--grad-hover); box-shadow: 0 4px 20px rgba(124,58,237,0.36); }

.btn-ghost {
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border-2);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-3); }

.btn-soft { background: var(--surface-2); color: var(--accent); }
.btn-soft:hover { background: var(--surface-3); }

.btn-danger  { background: var(--red-bg);   color: var(--red);   border: 1px solid rgba(220,38,38,0.2); }
.btn-danger:hover  { background: rgba(220,38,38,0.17); }
.btn-success { background: var(--green-bg); color: var(--green); border: 1px solid rgba(5,150,105,0.2); }
.btn-success:hover { background: rgba(5,150,105,0.18); }

.btn-icon { width: 21px; height: 21px; stroke: currentColor; fill: none;
            stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.btn-icon-sm { width: 16px; height: 16px; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-active, .badge-done, .badge-published { background: var(--green-bg);  color: var(--green); }
.badge-paused, .badge-queued               { background: var(--yellow-bg); color: var(--yellow); }
.badge-pending                             { background: var(--surface-2); color: var(--accent); }
.badge-review, .badge-processing           { background: var(--orange-bg); color: var(--orange); }
.badge-failed, .badge-disconnected         { background: var(--red-bg);    color: var(--red); }

.badge-instagram { background: rgba(225,48,108,0.1); color: #be185d; }
.badge-facebook  { background: rgba(59,89,152,0.1);  color: #1d4ed8; }
.badge-tiktok    { background: rgba(0,0,0,0.07);     color: #374151; }
.badge-youtube   { background: rgba(220,38,38,0.1);  color: #b91c1c; }
.badge-pinterest { background: rgba(230,0,35,0.1);   color: #b91c1c; }
.badge-linkedin  { background: rgba(10,102,194,0.1); color: #1d4ed8; }
.badge-google    { background: rgba(66,133,244,0.1); color: #1d4ed8; }

/* ── Listenzeilen ────────────────────────────────────────── */
.list { display: flex; flex-direction: column; gap: var(--sp-3); }
.list-row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: var(--sp-4);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.list-row:hover { border-color: var(--border-3); box-shadow: var(--shadow); }
.list-avatar {
  width: 38px; height: 38px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}
.list-avatar svg { width: 19px; height: 19px; stroke: currentColor; fill: none;
                   stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.list-title { font-size: var(--text-md); font-weight: 600; }
.list-sub   { font-size: var(--text-sm); color: var(--text-2); margin-top: 1px; }

/* ── Formulare ───────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.form-group > label { font-size: var(--text-sm); color: var(--text-2); font-weight: 600; }
.form-hint  { font-size: var(--text-xs); color: var(--text-3); }

/* Alle Eingabefelder tragen dasselbe Aussehen — unabhängig davon, ob sie in
   einer .form-group stehen. Vorher hing das Design daran, was ein einzelnes
   vergessenes Elternelement genügen ließ, damit ein Feld im Browser-Standard
   erschien. */
textarea,
select,
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]),
.input {
  background: var(--surface);
  border: 1.5px solid var(--border-2);
  border-radius: var(--r-sm);
  padding: 11px var(--sp-4);
  font-size: var(--text-md);
  font-family: inherit;
  color: var(--text);
  width: 100%;
  display: block;
  /* Eingabefelder bringen eine eingebaute Mindestbreite mit — beim
     textarea rund 20 Zeichen. In Raster- und Flex-Layouts gewinnt diese
     gegen width: 100% und schiebt die ganze Seite breiter als den
     Bildschirm. min-width: 0 hebt das auf. */
  min-width: 0;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast),
              background var(--dur-fast);
}

textarea::placeholder,
input::placeholder { color: var(--text-3); }

textarea:hover,
select:hover,
input:not([type=checkbox]):not([type=radio]):not([type=color]):hover {
  border-color: var(--border-3);
}

textarea:focus,
select:focus,
input:focus,
.input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea {
  resize: vertical;
  min-height: 92px;
  line-height: 1.6;
}

/* Auswahlfelder brauchen einen sichtbaren Hinweis, dass sie aufklappen —
   der Standardpfeil des Browsers passt farblich nicht zum Rest. */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%236b5e8a' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-4) center;
  padding-right: calc(var(--sp-4) * 2 + 12px);
  cursor: pointer;
}

/* Zeitfelder zeigen im Browser ein eigenes Symbol — es soll die Akzentfarbe
   tragen statt in Systemblau zu erscheinen. */
input[type=time]::-webkit-calendar-picker-indicator,
input[type=datetime-local]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.55;
  transition: opacity var(--dur-fast);
}
input[type=time]::-webkit-calendar-picker-indicator:hover,
input[type=datetime-local]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* ── Schalter ────────────────────────────────────────────── */
.toggle {
  width: 42px; height: 24px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  position: relative;
  transition: background var(--dur);
  flex-shrink: 0;
  border: none;
  padding: 0;
}
.toggle::after {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: var(--r-full);
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform var(--dur) var(--ease);
}
.toggle.on { background: var(--grad); }
.toggle.on::after { transform: translateX(18px); }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row h4 { font-size: var(--text-md); font-weight: 600; }
.toggle-row p  { font-size: var(--text-sm); color: var(--text-2); margin-top: 2px; }

/* ── Navigation ──────────────────────────────────────────── */
.nav-tabs { display: flex; gap: 2px; margin-left: auto; }
.nav-tab {
  padding: 7px var(--sp-4);
  border-radius: var(--r-sm);
  border: none;
  background: none;
  color: var(--text-2);
  font-size: var(--text-md);
  font-weight: 500;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.nav-tab:hover  { color: var(--text); background: var(--surface-2); }
.nav-tab.active { color: var(--accent); background: var(--surface-2); font-weight: 700; }

.sub-tabs {
  display: flex;
  gap: var(--sp-1);
  margin-bottom: var(--sp-5);
  overflow-x: auto;
  scrollbar-width: none;
}
.sub-tabs::-webkit-scrollbar { display: none; }
.sub-tab {
  padding: 7px var(--sp-4);
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: none;
  color: var(--text-2);
  font-size: 0.84rem;
  font-weight: 500;
  flex-shrink: 0;
  transition: all var(--dur-fast);
}
.sub-tab:hover  { color: var(--text); background: var(--surface-2); }
.sub-tab.active { color: var(--accent); background: var(--surface-2);
                  border-color: var(--border-2); font-weight: 700; }

/* Mobile Bottom-Navigation */
.bottom-nav { display: none; }
@media (max-width: 780px) {
  .nav-tabs { display: none; }
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 200;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 16px rgba(124,58,237,0.08);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .bnav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 9px 2px 10px;
    border: none;
    background: none;
    color: var(--text-2);
    font-family: inherit;
    font-size: 0.66rem;
    font-weight: 600;
    position: relative;
    transition: color var(--dur-fast);
  }
  .bnav-btn svg {
    width: 21px; height: 21px;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  }
  .bnav-btn.active { color: var(--accent); }
  .bnav-btn.active::before {
    content: '';
    position: absolute; top: 0; left: 24%; right: 24%;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--grad);
  }
}

/* ── Zustände: leer, laden ───────────────────────────────── */
.empty {
  text-align: center;
  padding: var(--sp-8) var(--sp-6);
  color: var(--text-2);
  font-size: var(--text-md);
}
.empty svg {
  width: 40px; height: 40px;
  margin: 0 auto var(--sp-3);
  stroke: var(--text-3); fill: none;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}

.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--border-2);
  border-top-color: var(--accent);
  border-radius: var(--r-full);
  animation: spin 0.7s linear infinite;
}
.spinner-lg { width: 28px; height: 28px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Ladeplatzhalter — verhindert Layout-Sprünge (CLS). */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Toast ───────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: var(--sp-6);
  left: 50%;
  transform: translateX(-50%) translateY(90px);
  background: #fff;
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow-lg);
  padding: 11px var(--sp-5);
  border-radius: var(--r-sm);
  font-size: var(--text-md);
  font-weight: 600;
  transition: transform var(--dur) var(--ease), opacity var(--dur);
  opacity: 0;
  z-index: 999;
  max-width: calc(100vw - 32px);
}
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
#toast.ok  { border-color: rgba(5,150,105,0.35); color: var(--green); }
#toast.err { border-color: rgba(220,38,38,0.35); color: var(--red); }
@media (max-width: 780px) { #toast { bottom: calc(var(--bottomnav-h) + 16px); } }

/* ── Mobile Anpassungen ──────────────────────────────────── */
@media (max-width: 780px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--sp-3); }
  .stat-card { padding: var(--sp-4); }
  .stat-value { font-size: 1.6rem; }
  .stat-label { font-size: 0.66rem; letter-spacing: 0.04em; }
  .card { padding: var(--sp-4); }
  .list-row { padding: var(--sp-3) var(--sp-4); gap: var(--sp-3); }
}

/* ── Funnel: Trigger-Wörter und DM-Vorschau ──────────────── */
.trigger-list {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
  min-height: 26px; align-items: center;
}
.trigger-chip {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  padding: 4px 6px 4px 11px;
  font-size: var(--text-sm);
  font-weight: 500;
}
.trigger-del {
  border: none; background: none; color: var(--text-3);
  font-size: 1.05rem; line-height: 1; padding: 0 3px;
  transition: color var(--dur-fast);
}
.trigger-del:hover { color: var(--red); }

.dm-preview {
  font-size: var(--text-sm);
  color: var(--text-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface-2);
  border-radius: var(--r-sm);
  border-left: 3px solid var(--border-3);
  line-height: 1.55;
}

/* ── Platzhalter für Bereiche in Portierung ──────────────── */
.pending-card { text-align: left; }
.pending-badge {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  background: var(--grad-soft);
  color: var(--accent);
  border-radius: var(--r-full);
  padding: 5px var(--sp-3);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pending-title {
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: var(--sp-3) 0 var(--sp-2);
}
.pending-text { color: var(--text-2); font-size: var(--text-md); max-width: 60ch; }
.pending-list { list-style: none; display: flex; flex-direction: column; gap: var(--sp-2); }
.pending-list li {
  display: flex; align-items: flex-start; gap: var(--sp-2);
  font-size: var(--text-md);
  color: var(--text-2);
}
.pending-list li svg { color: var(--green); flex-shrink: 0; margin-top: 3px; }

/* ── Verfeinerte Interaktion ─────────────────────────────────
   Flächen heben sich beim Überfahren leicht an und der Schatten wandert
   mit — das lässt sie greifbar wirken statt aufgemalt. */

.card {
  transition: box-shadow var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}

.btn-primary {
  position: relative;
  overflow: hidden;
}
/* Ein heller Streifen wandert beim Überfahren über den Knopf.
   Nur transform — läuft auf dem Compositor. */
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg,
    transparent 20%, rgba(255,255,255,0.22) 50%, transparent 80%);
  transform: translateX(-100%);
  transition: transform 0.55s var(--ease);
}
.btn-primary:hover::after { transform: translateX(100%); }

/* Nav-Wechsel: der aktive Reiter bekommt seine Fläche weich unterlegt. */
.nav-tab, .sub-tab, .pill {
  position: relative;
  transition: color var(--dur-fast), background var(--dur-fast),
              border-color var(--dur-fast), transform var(--dur-fast) var(--ease);
}
.nav-tab:active, .sub-tab:active, .pill:active { transform: scale(0.96); }

/* Listenzeilen rücken beim Überfahren leicht nach rechts — deutet an,
   dass sie zu etwas führen. */
.list-row {
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast),
              transform var(--dur-fast) var(--ease);
}
.list-row:hover { transform: translateX(3px); }

/* Schalter: der Knopf federt beim Umlegen leicht nach. */
.toggle::after {
  transition: transform var(--dur) cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Eingabefelder heben sich beim Fokus minimal. */
.input:focus, .form-group input:focus,
.form-group textarea:focus, .form-group select:focus {
  transform: translateY(-1px);
}

/* Vorschaubilder zoomen im Rahmen statt den Rahmen zu vergrößern. */
.thumb img { transition: transform var(--dur-slow) var(--ease); }
.thumb:hover img { transform: scale(1.06); }

/* Toast kommt mit leichtem Überschwingen. */
#toast {
  transition: transform var(--dur) cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity var(--dur);
}

/* ── Leadmagnete ─────────────────────────────────────────── */
.lm-card { margin-bottom: var(--sp-3); }
.lm-facts { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.lm-fact {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-sm);
  background: var(--surface-2);
  padding: 4px 11px;
  border-radius: var(--r-full);
  color: var(--text-2);
  text-decoration: none;
}
.lm-fact b { color: var(--accent); font-family: var(--font-mono); }
a.lm-fact:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }

/* ── Nachrichtenserie ────────────────────────────────────── */
.dm-step {
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: var(--sp-3);
  margin-bottom: var(--sp-2);
  /* Linke Kante zeigt die Reihenfolge an. */
  border-left: 3px solid var(--border-3);
}
.dm-step-head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
  flex-wrap: wrap;
}
.dm-step-nr {
  width: 22px; height: 22px;
  border-radius: var(--r-full);
  background: var(--grad);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}
.dm-step-cond {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-2);
}
.dm-step-delay {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--text-3);
}
.dm-step-text {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-sm);
  width: 100%;
  resize: vertical;
  line-height: 1.5;
}
.dm-step-text:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Zeitraum-Auswahl in den Statistiken ─────────────────────
   Die grauen Umriss-Knöpfe waren kaum als Auswahl erkennbar. Jetzt eine
   zusammenhängende Leiste: Das gewählte Feld hebt sich deutlich ab, die
   übrigen treten zurück. */
.pill-row.segmented {
  display: inline-flex;
  gap: 0;
  background: var(--surface-2);
  border-radius: var(--r-full);
  padding: 3px;
}
.pill-row.segmented .pill {
  border: none;
  background: none;
  box-shadow: none;
  padding: 7px var(--sp-4);
  color: var(--text-2);
}
.pill-row.segmented .pill.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.pill-row.segmented .pill:hover:not(.active) { color: var(--text); }

/* ── Feld mit anschließendem Knopf ───────────────────────────
   Kommt mehrfach vor: Stichwort eingeben und hinzufügen. Beide Teile
   sollen wie ein zusammengehöriges Element wirken. */
.field-with-button {
  display: flex;
  gap: var(--sp-2);
  align-items: stretch;
}
.field-with-button input { flex: 1; }
.field-with-button .btn { flex-shrink: 0; }

/* Textfelder in aufgeklappten Bereichen etwas kompakter — dort ist der
   Platz knapper und die Texte sind kurz. */
.dm-step-text {
  min-height: 68px;
  font-size: var(--text-sm);
  padding: var(--sp-2) var(--sp-3);
}

/* ── KI-Hilfe ────────────────────────────────────────────── */
.ai-help {
  background: var(--grad-soft);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: var(--sp-4);
  margin-top: var(--sp-4);
}
.ai-help-head {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.ai-help-head svg { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.ai-help-head strong { display: block; font-size: var(--text-md); }
.ai-help-head p {
  font-size: var(--text-sm);
  color: var(--text-2);
  margin-top: 2px;
  line-height: 1.5;
}
.ai-help textarea { margin-bottom: var(--sp-3); background: var(--surface); }

/* ── Abschneiden statt Überlaufen ────────────────────────────
   .truncate braucht einen Elternteil, der schrumpfen darf. In Flex-Zeilen
   ist das nicht selbstverständlich: Ohne min-width: 0 behält der Text seine
   volle Breite und schiebt die Zeile über den Rand. */
.list-row > .grow,
.list-row .list-title,
.list-row .list-sub {
  min-width: 0;
  max-width: 100%;
}
.list-title.truncate,
.list-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Aktionsknöpfe unter Karten dürfen umbrechen statt hinauszuragen. */
.slot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.slot-actions .btn { flex: 0 1 auto; min-width: 0; }

/* ── Konten verbinden ────────────────────────────────────── */
.connect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-2);
}
.connect-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1.5px solid var(--border-2);
  border-radius: var(--r-sm);
  text-align: left;
  min-width: 0;
  transition: border-color var(--dur-fast), transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast);
}
.connect-card:hover:not(:disabled) {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
/* Bereits verbundene Plattformen treten zurück — der Knopf dient dann nur
   noch zum Hinzufügen eines weiteren Kontos. */
.connect-card.is-connected { background: var(--surface-2); border-style: dashed; }

.connect-icon {
  width: 34px; height: 34px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  background: var(--grad-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.connect-icon svg {
  width: 17px; height: 17px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.connect-name  { display: block; font-size: var(--text-md); font-weight: 700; }
.connect-state { display: block; font-size: var(--text-xs); color: var(--text-2); margin-top: 1px; }
.connect-check {
  width: 16px; height: 16px;
  stroke: var(--green); fill: none; stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}

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