/* ==========================================================================
   Rankeo — Components
   Siehe docs/06_DESIGN_SYSTEM.md — Abschnitt 6
   ========================================================================== */

/* ---- Card ---- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.card-header {
  padding: var(--space-6) var(--space-6) 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.card-header-text { min-width: 0; }

.card-title {
  font-size: var(--text-md);
  line-height: var(--text-md-lh);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.card-description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.card-content { padding: var(--space-6); flex: 1; }
.card-content.is-flush { padding: 0; }

.card-footer {
  padding: 0 var(--space-6) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.info-dot {
  color: var(--color-text-subtle);
  display: inline-flex;
}

/* ---- Stat card ---- */
.stat-card .card-content { padding-top: var(--space-4); }

.stat-value-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* 1/3 Wert, 2/3 Canvas — gilt für alle Kombinationen aus Wert + Chart in einer stat-value-row */
.stat-value-row > *:first-child { flex: 0 0 33%; min-width: 0; }
.stat-value-row > *:last-child { flex: 0 0 67%; min-width: 0; }

.stat-value {
  font-size: var(--text-xl);
  line-height: var(--text-xl-lh);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.stat-caption {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.stat-sparkline { height: 80px; margin-left: -15px; position: relative; }
.stat-sparkline canvas { display: block; }

/* ---- Trend badge ---- */
.trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 8px 2px 6px;
  border-radius: var(--radius-full);
}

.trend svg { width: 11px; height: 11px; }

.trend--up { color: var(--color-positive); background: var(--color-positive-bg); }
.trend--down { color: var(--color-negative); background: var(--color-negative-bg); }
.trend--flat { color: var(--gray-600); background: var(--gray-100); border: 1px solid var(--gray-200); }

/* ---- Badge / chip ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge--neutral { color: var(--gray-700); background: var(--gray-100); }
.badge--positive { color: var(--color-positive); background: var(--color-positive-bg); border: 1.5px solid var(--color-positive-border); }
.badge--negative { color: var(--color-negative); background: var(--color-negative-bg); border: 1.5px solid var(--color-negative-border); }
.badge--warning { color: var(--color-warning); background: var(--color-warning-bg); border: 1.5px solid var(--color-warning-border); }
.badge--accent { color: var(--color-accent-fg); background: var(--color-accent); }

.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: background var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: var(--color-accent);
  color: var(--color-accent-fg);
}
.btn-primary:hover { background: var(--color-accent-hover); }

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover { background: var(--gray-50); border-color: var(--color-border-strong); }

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  padding: 6px 10px;
}
.btn-ghost:hover { background: var(--gray-100); color: var(--color-text); }

.btn-danger-text { color: var(--color-negative); }

.btn-icon { padding: 8px; }
.btn-sm { padding: 6px 10px; font-size: var(--text-xs); }

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

/* ---- Input ---- */
.input {
  width: 100%;
  padding: 8px 12px;
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-fast) var(--ease-out);
}
.input::placeholder { color: var(--color-text-subtle); }
.input:hover { border-color: var(--color-border-strong); }
.input:focus { border-color: var(--color-focus); }

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}
.input-group .icon {
  position: absolute;
  left: 11px;
  color: var(--color-text-subtle);
  pointer-events: none;
}
.input-group .input { padding-left: 34px; }

.kbd {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-subtle);
  background: var(--gray-100);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  position: absolute;
  right: 8px;
}

/* ---- Select (native, styled) ---- */
.select {
  appearance: none;
  padding: 8px 32px 8px 12px;
  font-size: var(--text-sm);
  background: var(--color-surface) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%2371717A" stroke-width="1.75"><path d="M6 9l6 6 6-6"/></svg>') no-repeat right 10px center / 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
}
.select:hover { border-color: var(--color-border-strong); }

/* ---- Tabs (segmented) ---- */
.tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--gray-100);
  padding: 3px;
  border-radius: var(--radius-md);
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  border-radius: calc(var(--radius-md) - 3px);
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
  background: transparent;
  border: none;
}

.tab svg { width: 15px; height: 15px; }

.tab:hover { color: var(--color-text); }

.tab.is-active {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

.tab.is-disabled { color: var(--color-text-subtle); cursor: default; }
.tab.is-disabled:hover { color: var(--color-text-subtle); }

.tab-soon {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-subtle);
  background: var(--gray-200);
  padding: 1px 5px;
  border-radius: var(--radius-full);
  margin-left: 2px;
}

/* Kleinere Tab-Variante, z. B. Metrik-Switcher im Card-Header */
.tabs-sm { padding: 2px; }
.tabs-sm .tab { padding: 5px 10px; font-size: var(--text-xs); }

/* ---- Series toggle chips (Wettbewerber an-/abwählen) ---- */
.series-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-4);
}

.series-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text);
  background: var(--gray-50);
  border: 1px solid var(--color-border);
  padding: 4px 10px 4px 8px;
  border-radius: var(--radius-full);
  transition: opacity var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.series-toggle:hover { border-color: var(--color-border-strong); }

.series-toggle-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.series-toggle.is-fixed {
  background: transparent;
  border-color: transparent;
  padding-left: 2px;
  cursor: default;
}

.series-toggle.is-off {
  opacity: 0.45;
}
.series-toggle.is-off .series-toggle-dot { background: var(--gray-300) !important; }

/* ---- Table ---- */
.table-wrap { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table thead th {
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--gray-50);
  /* Projektweiter Tabellenstandard seit 01.09.2026 (Nutzer-Vorgabe) — vorher nur auf den drei
     Dashboard-Tabellen (Top Keywords/Übersicht+SEO, Themen-Gap-Analyse/GEO) gescoped, siehe
     09_AENDERUNGSLISTE.md Punkt 54/69: niedrigere th-Höhe + Border oben statt nur unten. */
  padding: var(--space-2) var(--space-4);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

/* Erste Spalte bündig zur Kachel-Überschrift (padding: var(--space-6) = 24px vom Kachelrand)
   statt zum normalen th/td-Padding (var(--space-4) = 16px) — Vorbild: Top-Keywords-Tabellen im
   Dashboard, jetzt projektweiter Standard (Nutzer-Vorgabe 01.09.2026). Checkbox-Spalten (36px
   breite Auswahl-th/td, z. B. kunden.php/kategorien.php/protokoll.php/keywords-gerankt.php)
   bewusst ausgenommen — 25px links würde die Checkbox in der schmalen Spalte verschieben. */
.table thead th:first-child,
.table tbody td:first-child {
  padding-left: 25px;
}
.table thead th:first-child:has(input[type="checkbox"]),
.table tbody td:first-child:has(input[type="checkbox"]) {
  padding-left: var(--space-4);
}

.table thead th.is-numeric { text-align: right; }
.table thead th.is-sortable { cursor: pointer; user-select: none; }
.table thead th.is-sortable:hover { color: var(--color-text); }
.table .sort-icon { width: 11px; height: 11px; margin-left: 4px; opacity: 0.5; vertical-align: -1px; }

.table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  vertical-align: middle;
}

.table tbody td.is-numeric { text-align: right; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--gray-50); }
.table tbody tr.is-selected { background: var(--gray-50); }

.table .cell-muted { color: var(--color-text-muted); }
.table .cell-truncate { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--color-border-strong);
  accent-color: var(--color-accent);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.avatar-lg { width: 56px; height: 56px; font-size: var(--text-md); }

/* ---- Favicon-Avatar: echtes Favicon über der Initialen-Kachel, per onerror-Fallback ---- */
.avatar-favicon { position: relative; overflow: hidden; }
.avatar-favicon .avatar-fallback-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font: inherit;
}
.avatar-favicon .avatar-fallback-icon { color: var(--color-text-subtle); }
.avatar-favicon img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: #fff;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
}
.list-row:last-child { border-bottom: none; }

.list-row-main { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.list-row-name { font-size: var(--text-sm); font-weight: 500; }
.list-row-meta { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 1px; }
.list-row-text { min-width: 0; }
.list-row-text .list-row-name, .list-row-text .list-row-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Empty / loading / error states ---- */
.state-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-3);
  padding: var(--space-10) var(--space-6);
  color: var(--color-text-muted);
}

.state-block .icon-lg { width: 32px; height: 32px; color: var(--color-text-subtle); }
.state-block-title { font-size: var(--text-sm); font-weight: 500; color: var(--color-text); }
.state-block-desc { font-size: var(--text-sm); color: var(--color-text-muted); max-width: 320px; }

.state-block.is-error .icon-lg { color: var(--color-negative); }

.skeleton {
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  animation: skeleton-sweep 1.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .skeleton::after { animation: none; }
}
@keyframes skeleton-sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ---- Divider ---- */
.divider { height: 1px; background: var(--color-border); border: none; margin: 0; }

/* ---- GEO: Engine-Scorekarten (neben dem Radar) ---- */
.engine-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: opacity var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);
}
.engine-row:hover { background: var(--gray-50); }
.engine-row.is-off { opacity: 0.4; }

.engine-row-main { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.engine-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.engine-name { font-size: var(--text-sm); font-weight: 500; }
.engine-meta { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 1px; }
.engine-score-block { text-align: right; flex-shrink: 0; }
.engine-score { font-size: var(--text-md); font-weight: 600; }

/* ---- GEO: Prompt-Accordion ---- */
.prompt-list-toolbar {
  display: flex;
  gap: var(--space-3);
  padding: 0 var(--space-6) var(--space-4);
}

.prompt-item {
  border-bottom: 1px solid var(--color-border);
}
.prompt-item:last-child { border-bottom: none; }

.prompt-item summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.prompt-item summary::-webkit-details-marker { display: none; }
.prompt-item summary:hover { background: var(--gray-50); }

.prompt-question { font-size: var(--text-sm); font-weight: 500; }
.prompt-meta { display: flex; align-items: center; gap: var(--space-3); flex-shrink: 0; }
.prompt-engine-tags { display: flex; gap: 4px; }
.prompt-engine-tag {
  width: 22px; height: 22px;
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700;
  color: #fff;
}
.prompt-chevron { color: var(--color-text-subtle); transition: transform var(--duration-fast) var(--ease-out); flex-shrink: 0; }
.prompt-item[open] .prompt-chevron { transform: rotate(180deg); }

.prompt-body {
  padding: 0 var(--space-6) var(--space-6);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-5);
}

.prompt-engine-head {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

.prompt-company { padding: var(--space-2) 0; }
.prompt-company + .prompt-company { border-top: 1px solid var(--color-border); }

.prompt-company-name {
  font-size: var(--text-sm);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}
.prompt-company-rank {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-subtle);
  width: 14px;
  flex-shrink: 0;
}
.prompt-company-reason {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
  line-height: 1.5;
  padding-left: 20px;
}

.prompt-own-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-positive);
  background: var(--color-positive-bg);
  border: 1px solid var(--color-positive-border);
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

/* ---- Formulare (Account-/Einstellungsseiten) ---- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: var(--text-sm); font-weight: 500; color: var(--color-text); }
.field-hint { font-size: var(--text-xs); color: var(--color-text-muted); }

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
}
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-meta-row {
  display: flex;
  gap: var(--space-8);
  flex-wrap: wrap;
  padding-top: var(--space-5);
  margin-top: var(--space-5);
  border-top: 1px solid var(--color-border);
}
.form-meta-label { font-size: var(--text-xs); color: var(--color-text-muted); }
.form-meta-value { font-size: var(--text-sm); font-weight: 500; margin-top: 2px; }

.input-with-action { display: flex; gap: var(--space-2); }
.input-with-action .input { flex: 1; }

/* ---- Tabellen-Aktionslinks (Team-Verwaltung) ---- */
.row-actions { display: flex; gap: var(--space-4); justify-content: flex-end; white-space: nowrap; }
.row-action { font-size: var(--text-sm); color: var(--color-text-muted); }
.row-action:hover { color: var(--color-text); text-decoration: underline; }
.row-action.is-danger { color: var(--color-negative); }
.row-action.is-danger:hover { color: var(--color-negative); }

/* ---- Auth-Seiten (Login) ---- */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: var(--color-bg);
}

.auth-logo { height: 30px; width: auto; margin-bottom: var(--space-8); }

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-8);
}

.auth-title { font-size: var(--text-lg); font-weight: 600; text-align: center; }
.auth-subtitle { font-size: var(--text-sm); color: var(--color-text-muted); text-align: center; margin-top: var(--space-1); margin-bottom: var(--space-6); }

.auth-form { display: flex; flex-direction: column; gap: var(--space-4); }

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-sm);
}

.auth-checkbox { display: flex; align-items: center; gap: 8px; color: var(--color-text-muted); }
.auth-link { color: var(--color-text); font-weight: 500; }
.auth-link:hover { text-decoration: underline; }

.auth-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--color-negative);
  background: var(--color-negative-bg);
  border: 1px solid var(--color-negative-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: var(--space-5);
}
.auth-error svg { flex-shrink: 0; margin-top: 1px; }

.auth-footer {
  margin-top: var(--space-6);
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  text-align: center;
}
.auth-footer a { color: var(--color-text-muted); }
.auth-footer a:hover { color: var(--color-text); }

/* ---- Status-Punkt (Aktiv/Inaktiv) ---- */
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.status-dot--active { background: var(--color-positive); }
.status-dot--inactive { background: var(--gray-300); }

/* ---- Listen-Toolbar (Suche, Filter, Bulk-Aktionen) ---- */
.list-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.list-toolbar-search { flex: 1; min-width: 220px; max-width: 360px; }
.list-toolbar-spacer { flex: 1; }

.bulk-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
}
.bulk-bar[hidden] { display: none; }
.bulk-bar .btn-ghost { color: #fff; opacity: 0.85; }
.bulk-bar .btn-ghost:hover { background: rgba(255,255,255,0.12); opacity: 1; }
.bulk-bar-danger { color: #fca5a5; }
.bulk-bar-danger:hover { color: #fecaca; }

/* ---- "Mehr laden"-Button (Nutzer-Vorgabe 2026-08-18: ersetzt früheres Infinite Scroll/
   Zahlen-Pagination app-weit, siehe CLAUDE.md "Bekannte Fallstricke") ---- */
.load-more-row {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.list-count {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ---- Scrollbar (subtle) ---- */
.table-wrap::-webkit-scrollbar { height: 6px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: var(--radius-full); }

/* ---- Ausfahrfeld (Accordion): ganze Karte klappt auf/zu, z. B. Jobs/Kurzanalyse im Admin-Bereich.
   Schließt sich NUR per Klick auf den Header/Chevron, nie durch Klick woanders hin. ---- */
.accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-6);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}
.accordion-header:hover { background: var(--gray-50); }
.accordion-title { font-size: var(--text-md); line-height: var(--text-md-lh); font-weight: 600; }
.accordion-desc { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: 2px; }
.accordion-chevron { width: 18px; height: 18px; color: var(--color-text-subtle); transition: transform var(--duration-fast) var(--ease-out); flex-shrink: 0; }
.accordion.is-open .accordion-chevron { transform: rotate(180deg); }
.accordion-body { max-height: 0; overflow: hidden; transition: max-height var(--duration-fast) ease; }
.accordion.is-open .accordion-body { max-height: 3000px; }
.accordion-body-inner { padding: 0 var(--space-6) var(--space-6); }

/* Textfelder innerhalb eines Ausfahrfelds starten mit derselben Höhe wie Whitelist/Blacklist
   (siehe .field-expandable textarea unten) und wachsen beim Öffnen per JS auf die volle
   Inhaltslänge — readonly ausgenommen (Kurzanalyse hat ihre eigene feste Höhe via rows="12"). */
.accordion-body textarea.input:not([readonly]) { height: 128px; transition: height var(--duration-fast) ease; }

/* ---- Ausfahrfeld für Textfelder (Prompts/Whitelist/Blacklist): Feld bleibt sichtbar
   (ca. 5 Zeilen), Klick auf den Toggle verlängert es auf die volle Inhaltslänge. ---- */
.field-expandable textarea {
  height: 128px;
  transition: height var(--duration-fast) ease;
}
.field-expand-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
}
.field-expand-toggle:hover { color: var(--color-text); }
.field-expand-toggle .accordion-chevron { width: 13px; height: 13px; }
.field-expandable.is-open .field-expand-toggle .accordion-chevron { transform: rotate(180deg); }

/* ---- Modal / Dialog (neues Grundmuster, eingeführt 2026-08-19 für "Beiträge erstellen") ----
   Anders als das Ausfahrfeld (Regel: nur eigener Toggle schließt) darf ein Modal per Klick auf
   den Overlay-Hintergrund ODER per Escape schließen -- das ist die erwartete Konvention für ein
   waschechtes Formular-Popup, nicht für ein Inline-Ausfahrfeld. Seitenspezifischer Inhalt bleibt
   in der jeweiligen Page-Datei, hier nur der wiederverwendbare Rahmen. */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, 0.4);
  display: flex; align-items: flex-start; justify-content: center;
  padding: var(--space-8) var(--space-4);
  overflow-y: auto;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 640px; margin: auto 0;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--color-border);
}
.modal-title { font-size: var(--text-md); font-weight: 600; margin: 0; }
.modal-close {
  width: 28px; height: 28px; border-radius: var(--radius-md); border: none;
  background: transparent; color: var(--color-text-muted); font-size: 20px; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.modal-close:hover { background: var(--gray-100); color: var(--color-text); }
.modal-body { padding: var(--space-6); max-height: 70vh; overflow-y: auto; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: var(--space-2);
  padding: var(--space-4) var(--space-6); border-top: 1px solid var(--color-border);
}
