﻿:root {
  --color-primary: #9CD78C;
  --color-primary-light: #e8f6e4;
  --color-primary-dark: #2f6a23;
  --color-bg: #eef3ec;
  --color-surface: #ffffff;
  --color-text: #1a2e1a;
  --color-text-secondary: #4a5a4b;
  --color-border: #aebfa9;
  --color-border-light: #c9d6c5;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);
  --transition: .18s ease;
}

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

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
header.app-header {
  background: #9CD78C;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(47,106,31,.25);
  position: relative;
  z-index: 10;
}
header.app-header h1 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #1a3a14;
  letter-spacing: -.01em;
  cursor: default;
  transition: text-shadow var(--transition);
}
header.app-header h1:hover { text-shadow: 0 2px 12px rgba(26,58,20,.25); }
header.app-header .muted {
  color: rgba(26,58,20,.82);
  font-size: .82rem;
}

/* ── Tabs ── */
nav.tabs {
  display: flex;
  gap: .5rem;
  padding: .65rem 1.5rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 9;
}
nav.tabs button {
  border: none;
  background: transparent;
  padding: .5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: all var(--transition);
}
nav.tabs button:hover { background: var(--color-primary-light); color: var(--color-primary-dark); transform: translateY(-1px); }
nav.tabs button:active { transform: translateY(0); }
nav.tabs button.active {
  background: var(--color-primary);
  color: #1a2e1a;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(156,215,140,.4);
}

/* ── Main ── */
main {
  padding: 1.25rem 1.5rem 3rem;
  max-width: 1100px;
  margin: 0 auto;
}

/* Sidebar-Layout: main verlagert sich neben die Sidebar */
body.has-sidebar main.app-main {
  margin-left: var(--sidebar-width, 200px);
  max-width: none;
  padding: 1.25rem 1.75rem 3rem 1.5rem;
  background: #fff;
  min-height: 100vh;
  transition: margin-left var(--transition);
}
body.has-sidebar.sidebar-collapsed main.app-main { margin-left: 60px; }

/* Tabellen als Safety-Net horizontal scrollbar */
#summary-table-wrap,
#model-detail-table-wrap,
#run-detail-table-wrap,
#finder-result-wrap,
#runs-table-wrap { overflow-x: auto; }

/* ── Panels ── */
.panel {
  display: none;
  border-left: 3px solid var(--color-primary);
  box-shadow: 0 2px 6px rgba(156,215,140,.35);
  border-radius: 10px;
}
.panel.active { display: block; }

/* ── Cards ── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border);
  transform: translateY(-1px);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
  gap: .75rem;
  flex-wrap: wrap;
  /* Gemeinsame Reihenhöhe: Titel und Action-Buttons liegen auf gleicher Höhe
     und haben dadurch den gleichen Abstand zur oberen Card-Border. */
  min-height: 2.25rem;
}
.card-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  line-height: 1.2;
}
.card-header .actions {
  display: flex;
  gap: .5rem;
  flex-wrap: nowrap;
  align-items: center;
  min-height: 2.25rem;
}

.task-more-menu { position: relative; }
.task-more-popover {
  position: absolute;
  top: calc(100% + .35rem);
  right: 0;
  z-index: 20;
  min-width: 180px;
  padding: .3rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}
.task-more-popover[hidden] { display: none; }
.task-more-item {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  background: transparent;
  color: var(--color-text);
  box-shadow: none;
  font-weight: 500;
}
.task-more-item:hover { background: var(--color-primary-light); }
.task-more-danger { color: #b42318; }
.task-more-danger:hover { background: #ffebee; }
html[data-theme="dark"] .task-more-danger { color: #fca5a5; }
html[data-theme="dark"] .task-more-danger:hover { background: #3a1717; }

/* ── Zurück-Navigation ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: none;
  border: none;
  padding: .3rem .55rem;
  margin-left: -.55rem;
  margin-bottom: .5rem;
  cursor: pointer;
  border-radius: 5px;
  transition: color var(--transition), background var(--transition);
}
.back-link:hover {
  color: var(--color-primary-dark);
  background: var(--color-primary-light);
}
.back-link:active { background: #d0ebc6; }
.back-link i { font-size: .9em; }

/* ── Buttons ── */
button, .btn {
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  border: none;
  border-radius: 7px;
  padding: .5rem 1rem;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-primary);
  color: #1a2e1a;
  box-shadow: 0 1px 4px rgba(156,215,140,.3);
}
.btn-primary:hover {
  background: #7bc46a;
  color: #fff;
  box-shadow: 0 4px 12px rgba(123,196,106,.45);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 1px 3px rgba(123,196,106,.3); }
.btn-secondary {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}
.btn-secondary:hover { background: #d0ebc6; transform: translateY(-1px); }
.btn-secondary:active { transform: translateY(0); }
.btn-ghost {
  background: #f3f4f3;
  color: var(--color-text);
  padding: .35rem .65rem;
  border: 1px solid var(--color-border, #d4d4d4);
}
.btn-ghost:hover { background: #e7eae6; color: var(--color-text); border-color: #7a8d75; }
.btn-ghost:active { background: #d8ddd5; }
.btn-ghost:disabled,
.btn-ghost[disabled] { background: #f4f4f4; color: #6b7066; border-color: #d6d8d4; cursor: not-allowed; }
.btn-danger {
  background: #ffebee;
  color: #c62828;
}
.btn-danger:hover { background: #ffcdd2; transform: translateY(-1px); }
.btn-danger:active { transform: translateY(0); }
.btn-sm { font-size: .78rem; padding: .3rem .65rem; }
.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 1rem;
}

/* Busy-Indicator für Icon-Buttons ohne Beschriftung: das eingebettete
   Icon dreht sich, der Button bleibt klick-sicher (disabled). */
@keyframes kb-icon-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.btn-icon.is-busy {
  pointer-events: none;
  opacity: .7;
}
.btn-icon.is-busy .mnh-icon,
.btn-icon.is-busy .mnh-icon-solid {
  display: inline-block;
  animation: kb-icon-spin .9s linear infinite;
}

/* ── Forms ── */
.form-group { margin-bottom: .85rem; }
.form-group label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: .3rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: .85rem;
}
.project-allow-pickers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .85rem;
  margin: 0 0 .75rem;
}
.project-allow-picker-col {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.project-allow-picker-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-text-secondary);
}
/* Toolbar liegt außerhalb des Scroll-Containers, damit die Aktionen
   ("Alle/Keine" + Zähler) IMMER sichtbar sind und nichts hinter ihnen
   verschwinden kann. */
.project-allow-picker-host {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.project-allow-picker-toolbar {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  padding: .45rem .7rem;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  background: var(--color-surface);
  font-size: .78rem;
}
.project-allow-picker-toolbar .picker-count {
  color: var(--color-text-secondary);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.project-allow-picker-toolbar .btn-link {
  background: none;
  border: 0;
  padding: .15rem .45rem;
  color: var(--color-primary-dark);
  cursor: pointer;
  font-size: .78rem;
  font-weight: 600;
  border-radius: 4px;
}
.project-allow-picker-toolbar .btn-link:hover {
  background: var(--color-primary-light);
}
.project-allow-picker-toolbar .btn-link[disabled] {
  opacity: .4;
  cursor: default;
}
.project-allow-picker-toolbar .btn-link[disabled]:hover { background: none; }
.project-allow-picker .empty-state {
  margin: 0;
  background: transparent;
  border: 0;
}
/* Provider-Gruppen-Kopf im Modell-Picker bleibt beim Scrollen sichtbar,
   damit man weiss, welchem Provider die aktuellen Modelle gehören. */
.project-allow-picker .model-picker-group-head {
  position: sticky;
  top: -.85rem;
  z-index: 1;
  background: var(--color-surface);
  padding: .35rem 0 .25rem;
  margin: 0 0 .3rem;
  border-bottom: 1px solid var(--color-border-light);
}
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="datetime-local"],
input[type="date"],
input[type="time"],
input:not([type]),
select,
textarea {
  width: 100%;
  padding: .55rem .75rem;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: var(--color-bg);
  font-family: inherit;
  font-size: .88rem;
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
input[type="text"]:hover,
input[type="password"]:hover,
input[type="email"]:hover,
input[type="search"]:hover,
input[type="url"]:hover,
input[type="tel"]:hover,
input[type="number"]:hover,
input[type="datetime-local"]:hover,
input[type="date"]:hover,
input[type="time"]:hover,
input:not([type]):hover,
select:hover,
textarea:hover {
  border-color: var(--color-primary);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(156,215,140,.25);
}
textarea { min-height: 80px; resize: vertical; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th, td {
  padding: .55rem .75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--color-border-light);
}
th {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-text-secondary);
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th .sort-arrow {
  opacity: .5;
  margin-left: .35em;
  font-size: .8em;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  transition: opacity var(--transition), color var(--transition);
}
th:hover .sort-arrow { opacity: .8; }
th.sort-asc .sort-arrow,
th.sort-desc .sort-arrow { opacity: 1; color: var(--color-primary-dark); font-weight: 700; }
th { transition: color var(--transition), background var(--transition); }
th:hover { color: var(--color-primary-dark); background: var(--color-primary-light); }
td { transition: background var(--transition); }
tr:hover td { background: var(--color-primary-light); }
tr.run-row { cursor: pointer; }
tr.run-row:hover td { background: #dcf0d5; }
tr.run-row:active td { background: #c8e6be; }
td .row-actions { display: flex; gap: .35rem; }

/* ── Test-Liste: Batch-Zeilen ── */
tr.run-batch-row { cursor: pointer; }
tr.run-batch-row:hover td { background: #dcf0d5; }
tr.run-batch-row.expanded td { background: #eef7ea; }
tr.run-batch-row.expanded:hover td { background: #dcf0d5; }
tr.run-batch-child td { background: #e8efe5; }
tr.run-batch-child:hover td { background: #ecf6e6; }
.run-batch-toggle-cell { width: 28px; padding-right: 0; }
.run-batch-toggle { background: transparent; border: none; padding: .2rem; color: #444; }
.run-batch-toggle:hover { background: #e3efdc; color: #1f2328; }
tr.run-batch-row.expanded .run-batch-toggle i { transform: rotate(0deg); }

/* ── Flash Messages ── */
.flash {
  padding: .65rem 1rem;
  border-radius: 7px;
  margin-bottom: 1rem;
  font-size: .88rem;
  font-weight: 500;
  animation: flashIn .25s ease;
}
@keyframes flashIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
@keyframes flashOut { from { opacity:1; transform:translateY(0); } to { opacity:0; transform:translateY(-6px); } }
.flash.ok { background: var(--color-primary-light); color: var(--color-primary-dark); border: 1px solid #9CD78C; }
.flash.err { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }

/* Toast-Stapel: fixiert, zentriert, außerhalb des Dokumentflusses — schiebt
   den Seiteninhalt nie nach unten. */
#flash-overlay {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  width: auto;
  min-width: 280px;
  max-width: 90vw;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}
#flash-overlay .flash {
  pointer-events: auto;
  cursor: pointer;
  margin-bottom: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
#flash-overlay .flash.flash-leaving { animation: flashOut .25s ease forwards; }

/* Alt-Container im Dokumentfluss — wird nicht mehr befüllt, daher unsichtbar. */
#global-flash { display: none; }

/* ── Subtabs ── */
nav.subtabs {
  display: flex;
  gap: .25rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--color-border-light);
  padding-bottom: 0;
}
nav.subtabs button {
  border: none;
  background: transparent;
  padding: .5rem 1rem;
  font-size: .88rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  border-radius: 0;
}
nav.subtabs button:hover { color: var(--color-primary-dark); border-bottom-color: rgba(156,215,140,.4); }
nav.subtabs button.active {
  color: var(--color-primary-dark);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}
nav.subtabs button .count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.1rem;
  padding: 0 .35rem;
  margin-left: .35rem;
  font-size: .72rem;
  font-weight: 600;
  line-height: 1;
  color: var(--color-text);
  background: #d6e2d2;
  border-radius: 999px;
}
nav.subtabs button.active .count {
  color: var(--color-primary-dark);
  background: rgba(156,215,140,.28);
}

/* ── Sub-panels ── */
.task-subpanel { display: none; }
.task-subpanel.active { display: block; }
.prov-subpanel { display: none; }
.prov-subpanel.active { display: block; }

/* ── Model Picker ── */
.model-picker {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  max-height: 320px;
  overflow: auto;
  background: var(--color-surface);
}
.model-picker-toolbar {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  padding: 0 0 .65rem;
  margin: 0 0 .75rem;
  border-bottom: 1px solid var(--color-border-light);
  font-size: .78rem;
}
.model-picker-toolbar .picker-count {
  color: var(--color-text-secondary);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.model-picker-toolbar .btn-link {
  background: none;
  border: 0;
  padding: .15rem .45rem;
  color: var(--color-primary-dark);
  cursor: pointer;
  font-size: .78rem;
  font-weight: 600;
  border-radius: 4px;
}
.model-picker-toolbar .btn-link:hover { background: var(--color-primary-light); }
.model-picker-group { margin-bottom: .85rem; }
.model-picker-group:last-child { margin-bottom: 0; }
.model-picker-group-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .4rem;
}
.model-picker-group-head h4 {
  margin: 0;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-primary-dark);
}
.model-picker-group-head .group-count {
  color: var(--color-text-secondary);
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
}
.model-picker-group-head .btn-link {
  margin-left: auto;
  background: none;
  border: 0;
  padding: .1rem .4rem;
  color: var(--color-primary-dark);
  cursor: pointer;
  font-size: .72rem;
  font-weight: 600;
  border-radius: 4px;
}
.model-picker-group-head .btn-link:hover { background: var(--color-primary-light); }
.model-picker-group h4 {
  margin: 0 0 .4rem;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-primary-dark);
}
.model-picker label.model-pick {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 400;
  font-size: .85rem;
  margin: 0;
  cursor: pointer;
  padding: .3rem .5rem;
  border-radius: 5px;
  transition: background var(--transition);
}
.model-picker label.model-pick:hover { background: var(--color-primary-light); }
.model-picker label.model-pick input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  flex-shrink: 0;
  margin: 0;
  cursor: pointer;
}
.model-pick-title {
  font-family: 'SF Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .8rem;
  word-break: break-all;
}

/* ── Muted ── */
.muted { color: var(--color-text-secondary); font-size: .85rem; }
.mono {
  font-family: 'SF Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .8rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .15rem .55rem;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
  transition: filter var(--transition), transform var(--transition);
}
.badge:hover { filter: brightness(.92); transform: scale(1.04); }
.badge-success { background: var(--color-primary-light); color: var(--color-primary-dark); }
.badge-muted { background: #dde3e6; color: #37474f; }
.badge-key { background: #fff3e0; color: #e65100; font-family: monospace; }
.badge-warn { background: #fff3e0; color: #e65100; }
.badge-danger { background: #ffebee; color: #c62828; }
.badge-warning { background: #fff4d6; color: #a07500; }
.badge-info { background: #e6f0ff; color: #2a4a80; }
.role-badge { text-transform: uppercase; font-size: .7rem; }

/* ── Rollen-Toggle & Modul-Chips (Benutzerverwaltung) ── */
.role-toggle {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: #f0f2f5;
  border: 1px solid var(--color-border, #dfe3e8);
  border-radius: 999px;
}
.role-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .85rem;
  border: none;
  background: transparent;
  color: #3b4754;
  font-size: .82rem;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
.role-toggle-btn:hover:not(:disabled):not(.active) {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}
.role-toggle-btn.active {
  background: var(--color-primary);
  color: #1e3216;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}
.role-toggle-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.role-toggle-btn .mnh-icon { font-size: 1em; }

.module-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.module-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--color-border, #dfe3e8);
  background: #fff;
  color: #3b4754;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}
.module-chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
  background: var(--color-primary-light);
}
.module-chip.active {
  background: var(--color-primary);
  color: #1e3216;
  border-color: var(--color-primary);
}
.module-chip.active:hover {
  filter: brightness(.96);
  transform: translateY(-1px);
}
.module-chip .mnh-icon { font-size: .95em; }

/* Admin-Zustand: Chips sind eingefroren (alle aktiv, kein Hover-Wechsel) */
.module-chips.role-admin .module-chip {
  cursor: not-allowed;
  opacity: .85;
}
.module-chips.role-admin .module-chip:hover {
  transform: none;
  filter: none;
}

/* "Alle Module"-Indikator in der Benutzertabelle (nur-Anzeige, kein Button) */
.module-chip-all {
  cursor: default;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  border-color: var(--color-primary);
}
.module-chip-all:hover {
  transform: none;
  filter: none;
}

.user-modules-list {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  max-width: 320px;
}

/* ── Score Badges ── */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: .15rem .5rem;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.score-badge { transition: transform var(--transition), box-shadow var(--transition); }
.score-badge:hover { transform: scale(1.1); box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.score-good { background: var(--color-primary-light); color: var(--color-primary-dark); }
.score-ok   { background: #fff3e0; color: #e65100; }
.score-bad  { background: #ffebee; color: #c62828; }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--color-text-secondary);
}
.empty-state .icon { font-size: 2rem; margin-bottom: .5rem; opacity: .5; }

/* ── Inline-Banner für Run-Fehlertexte ── */
.run-detail-banner {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  padding: .65rem .85rem;
  border-radius: 6px;
  font-size: .9rem;
  line-height: 1.35;
  border: 1px solid transparent;
}
.run-detail-banner .mnh-icon { flex: 0 0 auto; margin-top: .1rem; }
.run-detail-banner .banner-title { font-weight: 700; margin-right: .35rem; }
.run-detail-banner.banner-error   { background: #ffebee; color: #c62828; border-color: #f5b7b1; }
.run-detail-banner.banner-warning { background: #fff4d6; color: #a07500; border-color: #f0d488; }
html[data-theme="dark"] .run-detail-banner.banner-error   { background: #3a1f1f; color: #ffb4ac; border-color: #5c2828; }
html[data-theme="dark"] .run-detail-banner.banner-warning { background: #2e2818; color: #e6c477; border-color: #5c4a1f; }

/* ── Modal / Popup ── */
body.modal-open { overflow: hidden; }

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(3px);
  z-index: 100;
  animation: fadeIn .2s ease;
}
.modal-backdrop.open { display: flex; align-items: center; justify-content: center; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--color-surface);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  width: 95%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlide .25s ease;
}
@keyframes modalSlide { from { opacity:0; transform:translateY(16px) scale(.97); } to { opacity:1; transform:translateY(0) scale(1); } }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border-light);
}
.modal-head h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.modal-head .close-modal {
  width: 30px; height: 30px;
  border: none; background: transparent;
  font-size: 1.2rem; cursor: pointer;
  color: var(--color-text-secondary);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.modal-head .close-modal:hover { background: #ffebee; color: #c62828; }
.modal-head .close-modal:active { background: #ffcdd2; }
.modal-body { padding: 1rem 1.25rem 1.25rem; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  padding: .85rem 1.25rem;
  border-top: 1px solid var(--color-border-light);
}

/* ── App-Dialoge (alert/confirm/prompt-Ersatz) ── */
.app-dialog .modal { max-width: 440px; }
.app-dialog-msg {
  margin: 0;
  white-space: pre-line;            /* \n aus den Meldungen als Zeilenumbruch */
  color: var(--color-text);
  font-size: .92rem;
  line-height: 1.55;
}
.app-dialog-input { margin-top: .9rem; }
/* Danger-Variante: bleibt .btn-primary (Enter-Support), nur rote Optik. */
.app-dialog-ok.app-dialog-danger {
  background: #e5484d;
  color: #fff;
  box-shadow: 0 1px 4px rgba(229,72,77,.3);
}
.app-dialog-ok.app-dialog-danger:hover {
  background: #d13438;
  box-shadow: 0 4px 12px rgba(209,52,56,.45);
}
html[data-theme="dark"] .app-dialog-ok.app-dialog-danger { background: #c93b3f; }
html[data-theme="dark"] .app-dialog-ok.app-dialog-danger:hover { background: #dc4c50; }

/* ── App-Tabs (geöffnete Aufgaben) ── */
.app-tabs-bar {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: .55rem .75rem 0 .75rem;
  margin: -1.25rem -1.75rem 1.25rem -1.5rem;
  background: linear-gradient(180deg, #eef2ea 0%, #e6ece1 100%);
  border-bottom: 1px solid #cfd7c8;
  box-shadow: inset 0 -1px 0 #cfd7c8, 0 1px 2px rgba(0, 0, 0, 0.02);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: #c9d2c4 transparent;
  min-height: 44px;
}
.app-tabs-bar::-webkit-scrollbar { height: 6px; }
.app-tabs-bar::-webkit-scrollbar-track { background: transparent; }
.app-tabs-bar::-webkit-scrollbar-thumb { background: #c9d2c4; border-radius: 3px; }
.app-tabs-bar::-webkit-scrollbar-thumb:hover { background: #b5bfae; }

.app-tab {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
  max-width: 260px;
  min-width: 0;
  padding: .5rem .85rem .55rem .85rem;
  background: rgba(255, 255, 255, 0.45);
  color: #4a5544;
  border: 1px solid transparent;
  border-bottom: none;
  border-top-left-radius: 9px;
  border-top-right-radius: 9px;
  font-size: .85rem;
  line-height: 1.25;
  cursor: pointer;
  position: relative;
  bottom: -1px;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    transform .12s ease-out;
  user-select: none;
}
.app-tab:hover {
  background: rgba(255, 255, 255, 0.8);
  color: #1f2e1f;
}
.app-tab:active {
  transform: translateY(1px);
}
.app-tab.active {
  background: #ffffff;
  color: #1f2328;
  border-color: #cfd7c8;
  font-weight: 500;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.05);
  z-index: 2;
}
/* Aktiver Tab "verschmilzt" optisch mit dem Content darunter */
.app-tab.active::after {
  content: '';
  position: absolute;
  left: -1px;
  right: -1px;
  bottom: -2px;
  height: 3px;
  background: #ffffff;
}
/* Akzentlinie oben am aktiven Tab */
.app-tab.active::before {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  top: 0;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px 2px 0 0;
  opacity: .85;
}
.app-tab .app-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: #6b7665;
  transition: color var(--transition);
}
.app-tab.active .app-tab-icon {
  color: var(--color-primary-dark);
}
.app-tab .app-tab-icon i { font-size: 1rem; line-height: 1; }
.app-tab .app-tab-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 200px;
  letter-spacing: .01em;
}
.app-tab .app-tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-left: .15rem;
  color: #8a9285;
  font-size: 1rem;
  line-height: 1;
  opacity: .6;
  transition:
    background var(--transition),
    color var(--transition),
    opacity var(--transition);
}
.app-tab:hover .app-tab-close { opacity: 1; }
.app-tab .app-tab-close:hover {
  background: #d5dcd0;
  color: #1f2328;
  opacity: 1;
}
.app-tab.active .app-tab-close { opacity: .75; }
.app-tab.active .app-tab-close:hover {
  background: #ecefe6;
  color: var(--color-primary-dark);
}
.app-tab-home {
  background: rgba(255, 255, 255, 0.55);
}
.app-tab-home .app-tab-label { font-weight: 500; }
/* Dezenter Separator zwischen Home-Tab und Aufgaben-Tabs */
.app-tab-home:not(.active) {
  margin-right: 2px;
}

/* ── Divider ── */
.section-divider {
  margin: 1.5rem 0;
  border: 0;
  border-top: 1px solid var(--color-border-light);
}

/* ── Pipeline-Sektion (Task-Editor) ── */
.pipeline-section {
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  padding: .55rem .75rem;
  background: #fafbfa;
  margin: .5rem 0 1rem;
}
.pipeline-section[open] {
  background: #fff;
}
.pipeline-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .9rem;
  font-weight: 600;
  user-select: none;
}
.pipeline-summary::-webkit-details-marker { display: none; }
.pipeline-summary::before {
  content: "▸";
  display: inline-block;
  transition: transform .15s ease;
  font-size: .75rem;
  color: #888;
}
.pipeline-section[open] > .pipeline-summary::before {
  transform: rotate(90deg);
}
.pipeline-summary-label { flex: 0 0 auto; }
.pipeline-summary-count { font-weight: 400; font-size: .8rem; }
.pipeline-stages { display: flex; flex-direction: column; gap: .65rem; margin: .4rem 0 .6rem; }
.pipeline-stage {
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  padding: .55rem .7rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.pipeline-stage-header {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.pipeline-stage-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 .35rem;
  border-radius: 999px;
  background: var(--color-primary-light, #e7f3e1);
  color: #2a5c1f;
  font-size: .78rem;
  font-weight: 700;
}
.pipeline-stage-name {
  flex: 1;
  font-size: .88rem;
  font-weight: 600;
  border: 1px solid transparent;
  background: transparent;
  padding: .15rem .3rem;
  border-radius: 4px;
}
.pipeline-stage-name:focus {
  outline: none;
  border-color: var(--color-border-light);
  background: #fff;
}
.pipeline-stage-actions { display: inline-flex; gap: .2rem; }
.pipeline-stage-actions .btn-icon { font-size: .95rem; }
.pipeline-stage textarea.pipeline-stage-prompt {
  min-height: 58px;
  font-family: inherit;
  font-size: .84rem;
}
.pipeline-stage-footer { display: flex; justify-content: flex-end; }
.pipeline-stage-footer .btn-sm { font-size: .78rem; }
.pipeline-stage-criteria-hint { color: #888; font-size: .78rem; }
.pipeline-stage-criteria-hint.has-custom { color: #2a5c1f; }

/* Erfahrungs-Filter pro Stufe (+ Base-Stage) */
.pipeline-stage-filter,
.base-stage-filter {
  margin-top: .55rem;
  border: 1px dashed var(--color-border-light, #e0e0e0);
  border-radius: 6px;
  padding: .25rem .55rem;
  background: #fafafa;
}
.pipeline-stage-filter > summary,
.base-stage-filter > summary {
  list-style: none;
  cursor: pointer;
  font-size: .82rem;
  padding: .2rem 0;
  display: flex;
  align-items: center;
  gap: .35rem;
  color: #444;
}
.pipeline-stage-filter > summary::-webkit-details-marker,
.base-stage-filter > summary::-webkit-details-marker { display: none; }
.pipeline-stage-filter[open] > summary,
.base-stage-filter[open] > summary { margin-bottom: .35rem; }
.pipeline-stage-filter-summary { font-weight: 500; }
.pipeline-stage-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .45rem .65rem;
  padding: .25rem 0 .35rem;
}
.pipeline-stage-filter-grid label {
  display: flex;
  flex-direction: column;
  font-size: .76rem;
  color: #555;
  gap: .2rem;
}
.pipeline-stage-filter-grid input {
  font-size: .84rem;
  padding: .25rem .4rem;
  border: 1px solid var(--color-border-light, #dadada);
  border-radius: 4px;
  background: #fff;
}
.pipeline-stage-filter-hint { font-size: .76rem; margin: .15rem 0 .35rem; }

.pipeline-stage-history {
  margin-top: .25rem;
  padding: .4rem .55rem;
  background: #fff;
  border: 1px solid var(--color-border-light, #eee);
  border-radius: 6px;
  font-size: .8rem;
}
.pipeline-stage-history-title {
  font-weight: 600;
  color: #444;
  margin-bottom: .25rem;
  font-size: .78rem;
}
.pipeline-stage-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .6rem;
}
.pipeline-stage-history-list li {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .78rem;
}
.history-badge {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  padding: .05rem .4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .75rem;
  background: #eee;
  color: #333;
}
.history-badge.good { background: #d9f0e0; color: #1f6b3a; }
.history-badge.ok   { background: #fff5d1; color: #8a6a00; }
.history-badge.bad  { background: #ffe0dc; color: #a1392c; }

/* ── Referenzantwort-Chip (Prompt-Item-Liste) ── */
.expected-answer-chip {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  padding: .12rem .5rem;
  border-radius: 999px;
  background: #e7f3e1;
  color: #2a5c1f;
  font-size: .74rem;
  font-weight: 600;
  margin: 0 .35rem;
  white-space: nowrap;
}
.expected-answer-chip .mnh-icon { font-size: .85rem; }

/* ── Inputs-Bibliothek ── */
.library-kind-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .12rem .5rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
}
.library-kind-chip .mnh-icon { font-size: .85rem; }
.library-kind-text { background: #eef3fb; color: #28558c; }
.library-kind-file { background: #fff2e0; color: #8a4b00; }
.library-ref-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .1rem .45rem;
  border-radius: 999px;
  background: #f0ecff;
  color: #5b3dbf;
  font-size: .7rem;
  font-weight: 600;
  margin: 0 .35rem;
  white-space: nowrap;
}
.library-ref-chip .mnh-icon { font-size: .8rem; }
.library-picker-list {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--color-border-light, #e6e6e6);
  border-radius: 6px;
  background: #fff;
  padding: .2rem;
}
.library-picker-list-inner { list-style: none; margin: 0; padding: 0; }
.library-picker-item {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  padding: .5rem .6rem;
  border-radius: 4px;
  cursor: pointer;
}
.library-picker-item:hover { background: #f7f7f5; }
.library-picker-item input[type="checkbox"] { margin-top: .25rem; }
.library-picker-label { flex: 1; font-size: .88rem; }
.library-picker-label strong { font-weight: 600; }

/* ── Run-Detail: Pipeline-Gruppen ── */
.pipeline-table tbody.pipeline-group + tbody.pipeline-group {
  border-top: 1px solid var(--color-border-light, #e6e6e6);
}
.pipeline-group-head td {
  background: #f4f7fb;
  font-weight: 600;
}
.pipeline-group-head:hover td {
  background: #eaf1fa;
}
.pipeline-chev {
  transition: transform .15s ease;
  color: #5a6a82;
}
.pipeline-group.collapsed .pipeline-chev {
  transform: rotate(-90deg);
}
.pipeline-stage-row td {
  background: #fbfcfe;
}
.pipeline-stage-cell-index { width: 30px; }

/* ── Run-Detail: Pipeline Fan-out Baum ── */
.result-tree {
  padding: .25rem .4rem;
  font-size: .9rem;
}
.result-tree .tree-node {
  position: relative;
  padding: .4rem 0 .4rem 0;
}
.result-tree > .tree-node {
  border-bottom: 1px solid var(--color-border-light, #e6e6e6);
}
.result-tree > .tree-node:last-child {
  border-bottom: none;
}
.tree-node-head {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
  padding: .35rem .5rem;
  border-radius: 6px;
  background: #f7f9fc;
  border: 1px solid #e4eaf1;
}
.tree-node-head:hover {
  background: #eef3f9;
}
.tree-stage-chip {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 999px;
  background: #eaf3ff;
  color: #1e4a85;
  font-weight: 600;
  font-size: .78rem;
  white-space: nowrap;
}
.tree-model { display: inline-flex; align-items: center; gap: .4rem; }
.tree-effort { display: inline-flex; align-items: center; }

/* Effort-Override Chip + Popover (Block 1.5/Teil 2) */
.active-model-effort-chip {
  font-size: .7rem;
  padding: .15rem .55rem;
  margin-left: .25rem;
}
.effort-popover {
  font-size: .85rem;
  background: #fff;
  border: 1px solid #c8cdd5;
  border-radius: 8px;
  padding: .7rem .8rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
  min-width: 340px;
  max-width: min(400px, calc(100vw - 24px));
}
.effort-popover-section {
  padding: .35rem 0;
  border-bottom: 1px solid #eef0f3;
}
.effort-popover-section:last-of-type {
  border-bottom: none;
}
.effort-popover-section-label {
  font-weight: 600;
  margin-bottom: .35rem;
}
.effort-popover-section-label .muted {
  font-weight: 400;
  font-size: .78rem;
}

/* Reasoning-Switch (Achse 1) */
.effort-popover-toggle {
  display: flex;
  align-items: center;
  gap: .65rem;
}
.effort-popover-toggle-label {
  font-weight: 600;
}
.effort-popover-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}
.effort-popover-switch input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.effort-popover-slider {
  width: 38px;
  height: 22px;
  background: #c8cdd5;
  border-radius: 999px;
  position: relative;
  transition: background-color .15s ease;
  flex-shrink: 0;
}
.effort-popover-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform .15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.effort-popover-switch input[type="checkbox"]:checked ~ .effort-popover-slider {
  background: #2e7d32;
}
.effort-popover-switch input[type="checkbox"]:checked ~ .effort-popover-slider::after {
  transform: translateX(16px);
}
.effort-popover-switch input[type="checkbox"]:disabled ~ .effort-popover-slider {
  opacity: .45;
}
.effort-popover-switch-text::before {
  content: "Aus";
  color: #6b7280;
  font-size: .82rem;
}
.effort-popover-switch input[type="checkbox"]:checked ~ .effort-popover-switch-text::before {
  content: "An";
  color: #1b5e20;
}

/* Auto-Override-Checkbox am Ende */
.effort-popover-auto {
  background: #f4f6f9;
  margin: .35rem -.4rem -.35rem;
  padding: .4rem .55rem;
  border-radius: 0 0 6px 6px;
}

.effort-popover-radio {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  cursor: pointer;
  line-height: 1.3;
}
.effort-popover-radio input[type="checkbox"],
.effort-popover-radio input[type="radio"] {
  margin-top: .15rem;
  flex-shrink: 0;
}
.effort-popover-radio .muted {
  font-weight: 400;
  font-size: .78rem;
}

/* Stufen-Auswahl (Achse 2) */
.effort-popover-levels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .3rem .8rem;
  margin: .15rem 0 .1rem 0;
  padding: 0;
}
.effort-popover-levels.is-disabled {
  opacity: .45;
}
.effort-popover-level {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  cursor: pointer;
  min-width: 0;
}
.effort-popover-levels.is-disabled .effort-popover-level {
  cursor: pointer; /* Klick im disabled-Zustand schaltet Auto aus */
}
.effort-popover-level span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.effort-popover-hint {
  font-size: .76rem;
  margin: .15rem 0 .15rem 0;
  line-height: 1.35;
}

.effort-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: .4rem;
  margin-top: .55rem;
  border-top: 1px solid #eee;
  padding-top: .5rem;
}
.activity-effort-hint {
  font-size: .78rem;
  color: #1e4a85;
}
html[data-theme="dark"] .effort-popover {
  background: #1f242c;
  border-color: #3a4452;
  color: #e6e9ee;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .55);
}
html[data-theme="dark"] .effort-popover-section {
  border-bottom-color: #2c343f;
}
html[data-theme="dark"] .effort-popover-actions {
  border-top-color: #2c343f;
}
html[data-theme="dark"] .effort-popover-slider {
  background: #4b5563;
}
html[data-theme="dark"] .effort-popover-switch input[type="checkbox"]:checked ~ .effort-popover-slider {
  background: #66bb6a;
}
html[data-theme="dark"] .effort-popover-switch-text::before {
  color: #94a3b8;
}
html[data-theme="dark"] .effort-popover-switch input[type="checkbox"]:checked ~ .effort-popover-switch-text::before {
  color: #a5d6a7;
}
html[data-theme="dark"] .effort-popover-auto {
  background: #262d36;
}
.tree-score { font-weight: 600; }
.tree-meta { color: #5a6a82; font-size: .8rem; }
.tree-err-badge {
  color: #c62828;
  display: inline-flex;
  align-items: center;
}
.tree-expand {
  border: none;
  background: transparent;
  cursor: pointer;
  color: #5a6a82;
  padding: 2px 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.tree-expand:hover { background: #e4eaf1; }
.tree-expand .mnh-icon { transition: transform .15s ease; }
.tree-expand-spacer {
  display: inline-block;
  width: 22px;
  height: 22px;
}
.tree-node-body {
  padding: .35rem .6rem .2rem 2.1rem;
}
.tree-response {
  font-size: .85rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 960px;
}
.tree-notes {
  font-size: .78rem;
  margin-top: .2rem;
  max-width: 960px;
}
.tree-children {
  position: relative;
  margin-left: 18px;
  padding-left: 18px;
  border-left: 2px solid #d7dee7;
}
.tree-children > .tree-node::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 18px;
  width: 14px;
  height: 2px;
  background: #d7dee7;
}
.tree-node.collapsed > .tree-children,
.tree-node.collapsed > .tree-node-body {
  display: none;
}

/* Pfad-Gesamt-Summary am Ende eines Pipeline-Pfads (Leaf) */
.tree-path-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: .5rem;
  padding: .4rem .7rem;
  border-radius: 8px;
  background: linear-gradient(90deg, #eaf7ee 0%, #f4faff 100%);
  border: 1px solid #c9e5d4;
  max-width: 960px;
}
.tree-path-label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-weight: 600;
  color: #1f6b3a;
  font-size: .82rem;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.tree-path-label .mnh-icon { color: #2a8a4c; }
.tree-path-score {
  font-weight: 700;
  font-size: 1rem;
  color: #1f3a5c;
}
.tree-path-meta {
  color: #446077;
  font-size: .78rem;
  margin-left: auto;
}

/* Leaf eines echten Pipeline-Pfads visuell hervorheben, damit User zwischen
   Pfad-Endergebnis und einzelner Zwischenstufe unterscheiden kann. */
.tree-node.tree-node-path-leaf > .tree-node-head {
  background: #f2faf4;
  border-color: #c9e5d4;
  border-left: 3px solid #2a8a4c;
}
.tree-node.tree-node-path-leaf > .tree-node-head .tree-stage-chip {
  background: #d9f0e0;
  color: #1f6b3a;
}

/* ── Run Status Animations ── */
.run-pending td {
  background: #fff8e1 !important;
}
@keyframes runHighlight {
  0%   { background: var(--color-primary-light); }
  100% { background: transparent; }
}
.run-highlight td {
  animation: runHighlight 4s ease forwards;
}


/* ── Top Result Cards ── */
.top-result-card {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  margin-bottom: .65rem;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.top-result-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border);
  transform: translateY(-2px);
}
.top-result-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .35rem;
  font-weight: 600;
}
.top-result-rank { font-size: 1.15rem; min-width: 1.5em; }
.top-result-meta { font-size: .78rem; margin-bottom: .5rem; }
.top-result-body { margin-top: .4rem; font-size: .82rem; }
.top-result-body strong { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--color-text-secondary); display: block; margin-bottom: .2rem; }
.top-result-text {
  background: var(--color-bg);
  border-radius: 6px;
  padding: .5rem .65rem;
  max-height: 120px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'SF Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .8rem;
  line-height: 1.5;
}
.top-result-note {
  background: var(--color-primary-light);
  border-radius: 6px;
  padding: .4rem .65rem;
  font-size: .8rem;
  line-height: 1.4;
  color: var(--color-text-secondary);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c0c8c0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a0a8a0; }

/* ── Expandable text ── */
.expandable-text { display: inline; }
.exp-full { display: none; }
.btn-expand {
  display: inline;
  background: none;
  border: none;
  color: #3a8f29;
  cursor: pointer;
  font-size: .8rem;
  padding: 0 .2rem;
  text-decoration: underline;
  font-weight: 500;
}
.btn-expand:hover { color: #2c6e1f; }

/* ── User-Prompt Inbox (Tabs + Liste) ── */
nav.prompt-inbox-tabs {
  margin-bottom: .5rem;
  gap: .35rem;
}
nav.prompt-inbox-tabs button.prompt-inbox-tab {
  padding: .35rem .75rem;
  font-size: .82rem;
}
.prompt-items-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.prompt-item-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: nowrap;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  padding: .45rem .55rem;
  background: var(--color-bg);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.prompt-item-row:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(156,215,140,.18);
  background: #f0f7ee;
}
.prompt-item-row .prompt-item-label {
  flex: 1;
  min-width: 0;
  font-size: .88rem;
  margin: 0;
}
.prompt-item-row .prompt-item-select {
  flex-shrink: 0;
  margin: 0;
  cursor: pointer;
}
.prompt-item-row-actions {
  display: flex;
  align-items: center;
  gap: .2rem;
  flex-shrink: 0;
}
button.prompt-item-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
button.prompt-item-icon-btn:hover {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}
button.prompt-item-icon-btn.prompt-item-delete:hover,
button.prompt-item-icon-btn.prompt-item-delete-new:hover {
  background: #ffebee;
  color: #c62828;
}
button.prompt-item-icon-btn svg {
  display: block;
}

.prompt-file-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
}
.prompt-file-field .prompt-file-hint {
  font-size: .78rem;
}
label.prompt-file-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 600;
}
.prompt-file-names { margin-top: .4rem; }
.prompt-file-name-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .5rem;
}
.prompt-file-name-list li {
  background: #e8f5e4;
  border: 1px solid #c4e2bb;
  border-radius: 4px;
  padding: .15rem .5rem;
  font-size: .8rem;
  color: #2c6e1f;
}
.prompt-file-input-native {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

/* ── Favoriten-Verwaltung ── */
.fav-provider-group { margin-bottom: 1rem; }
.fav-provider-title { font-size: .88rem; margin: 0 0 .35rem; font-weight: 700; }

/* Toolbar: Suche */
.prov-models-toolbar {
  display: flex; gap: .5rem; align-items: center; margin-bottom: .5rem; flex-wrap: wrap;
}
.prov-model-filter {
  flex: 1; min-width: 160px; max-width: 320px;
  font-size: .82rem; padding: .35rem .6rem;
  border: 1px solid var(--color-border, #ddd); border-radius: 6px;
  background: var(--color-bg, #fff);
}
.prov-models-count { font-size: .78rem; margin-left: auto; }

/* Anbieter-Liste: Modell-Zähler (aktiv / alt / blockiert) */
.provider-model-counts {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .4rem;
}
.provider-model-count-live {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.provider-model-count-meta {
  font-size: .78rem;
  white-space: nowrap;
}

/* Budget-Zelle in der Projektliste:
   Mini-Fortschrittsbalken + "verbraucht / Limit (Prozent)"-Text.
   Bei unbegrenztem Budget fällt der Balken weg, es bleibt nur Text. */
.budget-cell {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  min-width: 9rem;
}
.budget-bar {
  width: 100%;
  max-width: 10rem;
  height: 6px;
  background: #e6e8eb;
  border-radius: 3px;
  overflow: hidden;
}
.budget-bar-fill {
  display: block;
  height: 100%;
  background: #4caf50;
  transition: width .2s ease;
}
.budget-cell.warn .budget-bar-fill { background: #f0ad4e; }
.budget-cell.over .budget-bar-fill { background: #c0392b; }
.budget-cell.over .budget-bar { background: #f7d7d2; }
.budget-text {
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.budget-cell.over .budget-text { color: #c0392b; font-weight: 600; }
.budget-cell.warn .budget-text { color: #b8651b; }
.budget-pct {
  color: #888;
  font-weight: 400;
}
html[data-theme="dark"] .budget-bar { background: #2a2d33; }
html[data-theme="dark"] .budget-cell.over .budget-bar { background: #4a1f1c; }
html[data-theme="dark"] .budget-pct { color: #aaa; }

/* Anbieter-Modell-Tabelle */
.prov-models-table tr.fav-row-active td { background: #eef7eb; }
.prov-models-table .warn-text { color: #c0392b; }

/* Gesperrte Modelle (unterhalb der Tabelle) */
.blocked-models-section { margin-top: .75rem; }
.blocked-models-summary {
  font-size: .82rem; font-weight: 600; color: #c0392b; cursor: pointer;
  padding: .35rem 0; user-select: none;
}
.blocked-models-summary .muted { font-weight: 400; color: #888; }
.blocked-models-list { display: flex; flex-direction: column; gap: 1px; margin-top: .35rem; }
.blocked-model-item {
  display: flex; align-items: center; gap: .5rem; padding: .3rem .5rem;
  border-radius: 5px; background: #f6f6f6; font-size: .82rem; color: #777;
}
.blocked-models-table { margin-top: .35rem; font-size: .82rem; }
.blocked-models-table td { color: #777; }
.blocked-models-table .blocked-model-reason { display: inline-block; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.blocked-model-name { color: #888; }
.blocked-model-reason { font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }
.fav-star {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: #ccc;
  padding: 0;
  line-height: 1;
  transition: color .15s;
  flex-shrink: 0;
}
.fav-star:hover { color: #e8a800; }
.fav-star.fav-active { color: #e8a800; }

.fav-star-inline {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .95rem;
  color: #ccc;
  padding: 0 2px;
  line-height: 1;
  vertical-align: middle;
  transition: color .15s;
}
.fav-star-inline:hover { color: #e8a800; }
.fav-star-inline.fav-active { color: #e8a800; }
/* Im Modell-Picker (Projekt-Allowlist) sitzt der Stern zwischen Checkbox
   und Modellname und darf nicht gestaucht werden. */
.model-pick .fav-star-inline { flex-shrink: 0; margin: 0; }

/* ── Model-Picker Preis ── */
.model-pick-price {
  min-width: 110px;
  text-align: right;
  font-size: .72rem;
  color: #888;
  white-space: nowrap;
  font-family: 'SF Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  flex-shrink: 0;
  margin-left: auto;
}

/* ── Aktive Modelle (Aufgaben-Detail) ── */
.active-model-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: min(55vh, 520px);
  overflow-y: auto;
  padding-right: .25rem;
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  background: #fff;
  /* In schmalen Grid-Spalten (linke Kriterien-Spalte breit) sonst durch
     überlange Modellnamen aus dem Container gedrückt. */
  min-width: 0;
}
.active-model-list::-webkit-scrollbar { width: 8px; }
.active-model-list::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}
.active-model-list::-webkit-scrollbar-track { background: transparent; }
.active-model-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .5rem;
  border-radius: 5px;
  background: #f8faf7;
  border: 1px solid #e8e8e8;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
  /* Wenn Provider-Badge + Modellname + Modality-Chip + Preis + Remove-Button
     nicht in eine Zeile passen, brechen sie sauber um — sonst wird der Name
     in der rechten Tasks-Spalte auf 0px gequetscht. */
  flex-wrap: wrap;
  min-width: 0;
}
.active-model-row:hover {
  background: #eef5eb;
  border-color: #c4debb;
  box-shadow: 0 1px 4px rgba(156,215,140,.15);
}
.active-model-name {
  font-size: .82rem;
  flex: 1 1 12ch;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.active-model-row .btn-ghost {
  color: #c44; font-size: .78rem; padding: .1rem .3rem; flex-shrink: 0;
  border: none; background: transparent;
}
.active-model-row .btn-ghost:hover { background: #f0f0f0; color: #a33; }

/* Icon-only Ghost-Buttons: der Rand der allgemeinen Ghost-Buttons stört
   bei reinen Icon-Knöpfen. btn-icon-Instanzen bleiben randlos. */
.btn-icon.btn-ghost { border: none; background: transparent; }
.btn-icon.btn-ghost:hover { background: #f0f0f0; }
.active-model-fav { width: 1.1rem; flex-shrink: 0; text-align: center; font-size: .9rem; color: #e8a800; }

/* ── Modell-Hinzufügen Popup ── */
.add-model-row {
  display: grid;
  grid-template-columns: auto 1fr 130px auto;
  align-items: center;
  gap: .5rem;
  padding: .3rem .5rem;
  border-radius: 5px;
  cursor: default;
}
.add-model-row { transition: background var(--transition); }
.add-model-row:hover { background: #eef5eb; }
.add-model-row.model-added { opacity: .5; pointer-events: none; }
.add-model-row.model-added .pick-model-btn { background: var(--color-primary); color: #fff; cursor: default; }
.add-col-provider { font-size: .72rem; flex-shrink: 0; justify-self: start; }
.add-col-name { display: flex; align-items: center; gap: .3rem; min-width: 0; overflow: hidden; }
.add-model-label { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.add-model-id { font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.add-col-price {
  display: flex; align-items: center; justify-content: flex-end; gap: .2rem;
  font-size: .75rem; color: #666;
  font-family: 'SF Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: nowrap;
}
.add-model-row .pick-model-btn { padding: .15rem .5rem; font-size: .78rem; justify-self: end; }

/* ── Benachrichtigungen ── */
.notif-bell {
  position: relative;
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: .1rem .3rem;
  line-height: 1;
}
.notif-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: #e74c3c;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}
.notif-dropdown {
  position: fixed;
  bottom: 70px;
  left: calc(var(--sidebar-width) + 8px);
  width: 340px;
  max-height: 420px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
  z-index: 1000;
}
body.sidebar-collapsed .notif-dropdown { left: 68px; }
.notif-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .45rem .6rem;
  border-bottom: 1px solid #e8e8e8;
  gap: .5rem;
}
.notif-dropdown-actions {
  display: flex;
  gap: .25rem;
  margin-left: auto;
}
#notif-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.notif-item {
  padding: .6rem .85rem;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background var(--transition), padding-left var(--transition);
}
.notif-item:hover { background: #f5faf3; padding-left: 1rem; }
.notif-item.notif-unread { background: #eef7eb; font-weight: 500; }
.notif-item-title { font-size: .85rem; margin-bottom: .15rem; }
.notif-item-body { font-size: .78rem; color: #666; }
.notif-item-time { font-size: .72rem; color: #999; }
.notif-item-foot {
  margin-top: .35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.notif-item.notif-has-detail { cursor: pointer; }
.notif-detail-btn { flex: 0 0 auto; }
.notif-item-archive-btn { flex: 0 0 auto; }
.notif-item.notif-archived {
  background: #f8f8f8;
}
.notif-empty { padding: 1.5rem; text-align: center; color: #999; font-size: .85rem; }

/* ── Init-Qualified Detail-Popup ── */
.qualified-model {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: .75rem .85rem;
  margin-bottom: .6rem;
  background: var(--color-surface, #fff);
}
.qualified-model:last-child { margin-bottom: 0; }
.qualified-model-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .5rem;
}
.qualified-model-ident { min-width: 0; }
.qualified-model-name {
  font-weight: 600;
  font-size: .95rem;
  word-break: break-all;
}
.qualified-model-provider { font-size: .78rem; color: #777; }
.qualified-model-score {
  display: inline-flex;
  align-items: baseline;
  gap: .25rem;
  padding: .2rem .55rem;
  background: #eef7eb;
  color: #2f6a1f;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  white-space: nowrap;
}
.qualified-model-score-label { font-size: .75rem; font-weight: 500; opacity: .8; }
.qualified-tasks {
  width: 100%;
  border-collapse: collapse;
  margin: .25rem 0 .5rem;
  font-size: .82rem;
}
.qualified-tasks thead th {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #888;
  font-weight: 600;
  padding: .2rem .35rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}
.qualified-tasks tbody td {
  padding: .28rem .35rem;
  border-bottom: 1px solid #f1f1f1;
}
.qualified-tasks tbody tr:last-child td { border-bottom: 0; }
.qualified-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .35rem;
}
.qualified-task-row {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .25rem .15rem;
  cursor: pointer;
  border-radius: 4px;
}
.qualified-task-row:hover { background: #f5faf3; }
.qualified-task-row input[type="checkbox"] { margin: 0; }
.qualified-task-name { font-size: .85rem; }

html[data-theme="dark"] .qualified-model { background: #1d1d20; border-color: #2c2c30; }
html[data-theme="dark"] .qualified-model-provider { color: #9a9aa0; }
html[data-theme="dark"] .qualified-model-score { background: #1e3a17; color: #c4e9b4; }
html[data-theme="dark"] .qualified-tasks thead th { color: #9a9aa0; border-bottom-color: #2c2c30; }
html[data-theme="dark"] .qualified-tasks tbody td { border-bottom-color: #242428; }
html[data-theme="dark"] .qualified-task-row:hover { background: #232327; }

/* ── Tags ── */
.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .18rem .6rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.4;
  cursor: default;
  white-space: nowrap;
  transition: filter var(--transition), transform var(--transition), box-shadow var(--transition);
}
.tag-badge:hover {
  filter: brightness(.88);
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.tag-badge .tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin: -1px -3px -1px 0;
  border-radius: 50%;
  background: rgba(0,0,0,.12);
  color: inherit;
  font-size: .6rem;
  line-height: 1;
  cursor: pointer;
  border: none;
  padding: 0;
  transition: background var(--transition), transform var(--transition);
}
.tag-badge .tag-remove:hover { background: rgba(0,0,0,.3); transform: scale(1.15); }

/* Tag Input (Chip-Input mit Autocomplete) */
.tag-input-wrap {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem;
  padding: .35rem .5rem;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: var(--color-bg);
  cursor: text;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.tag-input-wrap:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(156,215,140,.25);
}
.tag-input-chips { display: contents; }
.tag-input-field {
  flex: 1;
  min-width: 80px;
  border: none !important;
  background: transparent !important;
  padding: .15rem .25rem !important;
  font-size: .85rem;
  outline: none !important;
  box-shadow: none !important;
}
.tag-suggestions {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  max-height: 200px;
  overflow-y: auto;
  z-index: 50;
}
.tag-suggestions.open { display: block; }
.tag-suggestion {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .65rem;
  cursor: pointer;
  font-size: .84rem;
  transition: background var(--transition);
}
.tag-suggestion:first-child { border-radius: 7px 7px 0 0; }
.tag-suggestion:last-child { border-radius: 0 0 7px 7px; }
.tag-suggestion:hover, .tag-suggestion.highlighted { background: var(--color-primary-light); }
.tag-suggestion-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tag-suggestion-create { font-style: italic; color: var(--color-primary-dark); }

/* Tag Filter (Aufgabenliste) */
.tag-filter-btn {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  opacity: .55;
}
.tag-filter-btn:hover { opacity: .85; transform: scale(1.05); }
.tag-filter-btn.active { opacity: 1; border-color: rgba(0,0,0,.15); box-shadow: 0 1px 4px rgba(0,0,0,.1); }

/* Tag Manager */
.tag-manager-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .5rem;
  border-radius: 7px;
  margin-bottom: 3px;
  transition: background var(--transition);
}
.tag-manager-row:hover { background: var(--color-bg); }
.tag-manager-row .tag-manager-name {
  flex: 1;
  min-width: 0;
  font-size: .85rem;
  padding: .2rem .4rem;
  border: 1px solid transparent;
  border-radius: 5px;
  transition: border-color var(--transition);
}
.tag-manager-row .tag-manager-name:focus { border-color: var(--color-border); }
.tag-manager-row .tag-color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,.08);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--transition), box-shadow var(--transition);
}
.tag-manager-row .tag-color-swatch:hover { transform: scale(1.15); box-shadow: 0 0 0 3px rgba(0,0,0,.08); }
.tag-manager-row .tag-manager-usage {
  flex-shrink: 0;
  font-size: .76rem;
  white-space: nowrap;
}

/* Zwei-Spalten-Layout: Kriterien neben Modellen */
.task-props-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
.task-props-col { min-width: 0; }
.task-props-col + .task-props-col {
  padding-left: 1.5rem;
  border-left: 1px solid var(--color-border, #e5e7eb);
}
@media (max-width: 1100px) {
  .task-props-grid { grid-template-columns: 1fr; gap: 1rem; }
  .task-props-col + .task-props-col {
    padding-left: 0;
    border-left: none;
    border-top: 1px solid var(--color-border, #e5e7eb);
    padding-top: 1rem;
  }
}

/* Bewertungskriterien */
.criteria-list { display: flex; flex-direction: column; gap: .55rem; }
.criteria-row {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: .65rem .8rem;
  background: #fafdf8;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: box-shadow var(--transition);
}
.criteria-row:hover { box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.criteria-row .criteria-head { display: flex; align-items: center; gap: .55rem; }
.criteria-row .criteria-color-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(0,0,0,.05);
}
.criteria-row .crit-name {
  flex: 1 1 auto;
  padding: .3rem .5rem;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: .9rem;
  font-weight: 600;
  background: transparent;
}
.criteria-row .crit-name:hover { border-color: var(--color-border); background: #fff; }
.criteria-row .crit-name:focus { border-color: var(--color-primary); background: #fff; outline: none; }
.criteria-row .crit-weight-display {
  min-width: 48px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: .95rem;
  color: var(--color-primary-dark, #2f6a1f);
}
.criteria-row .crit-del {
  color: #b82c2c;
  padding: .2rem .5rem;
  font-size: .9rem;
  opacity: .55;
  transition: opacity var(--transition);
}
.criteria-row .crit-del:hover { opacity: 1; }
.criteria-row .crit-desc {
  width: 100%;
  padding: .3rem .5rem;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: .82rem;
  color: #555;
  background: transparent;
}
.criteria-row .crit-desc:hover { border-color: var(--color-border); background: #fff; }
.criteria-row .crit-desc:focus { border-color: var(--color-primary); background: #fff; outline: none; }

/* Custom Slider */
.criteria-row .crit-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--crit-color, #9CD78C) 0%, var(--crit-color, #9CD78C) calc(var(--val, 0) * 1%), #e5eadf calc(var(--val, 0) * 1%), #e5eadf 100%);
  outline: none;
  margin: .15rem 0 .05rem;
  cursor: pointer;
}
.criteria-row .crit-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: transparent;
}
.criteria-row .crit-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--crit-color, #9CD78C);
  margin-top: -6px;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  cursor: grab;
  transition: transform var(--transition);
}
.criteria-row .crit-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.criteria-row .crit-slider::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.25); }
.criteria-row .crit-slider::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: #e5eadf;
}
.criteria-row .crit-slider::-moz-range-progress {
  height: 6px;
  border-radius: 3px;
  background: var(--crit-color, #9CD78C);
}
.criteria-row .crit-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--crit-color, #9CD78C);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  cursor: grab;
}

/* Stacked Bar */
.criteria-bar-wrap { margin-top: .75rem; }
.criteria-bar {
  display: flex;
  width: 100%;
  height: 22px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: #f0f0f0;
}
.crit-bar-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
  transition: width .15s ease-out;
  overflow: hidden;
  white-space: nowrap;
}

.text-danger { color: #b82c2c !important; }

/* Running-Status: Pulseffekt auf Zeile + animierter Badge + Spinner */
@keyframes run-row-pulse {
  0%, 100% { background-color: rgba(244, 199, 82, 0.12); }
  50%      { background-color: rgba(244, 199, 82, 0.28); }
}
@keyframes run-spinner-rot {
  to { transform: rotate(360deg); }
}
tr.run-row-running td { animation: run-row-pulse 1.6s ease-in-out infinite; }
.badge-running {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: #f4c752;
  color: #4a3a00;
  border: 1px solid #d8ac39;
  padding: .18rem .55rem;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
}
.run-spinner {
  width: 10px; height: 10px;
  border: 2px solid rgba(74, 58, 0, .25);
  border-top-color: #4a3a00;
  border-radius: 50%;
  display: inline-block;
  animation: run-spinner-rot .7s linear infinite;
}

tr.run-result-pending td {
  background: #fafbfc;
  border-top: 1px dashed #e3e6ea;
}

.run-detail-live-badge {
  margin-left: .5rem;
  vertical-align: middle;
  font-size: .78rem;
}

@keyframes run-result-row-in {
  from { background-color: #fff7dc; }
  to   { background-color: transparent; }
}
tr.run-result-row.run-result-new td {
  animation: run-result-row-in 1.4s ease-out 1;
}

/* Konsistenz-Info Box in Modell-Detail */
.consistency-info {
  background: #f3faf0;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: 6px;
  padding: .65rem .85rem;
  margin-bottom: .75rem;
  font-size: .88rem;
}
.consistency-stats > div { margin: .2rem 0; }

/* Modell-Finder */
.finder-ai-box {
  background: #f0f7ea;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: 6px;
  padding: .65rem .85rem;
  margin-top: .75rem;
  font-size: .88rem;
}
.finder-tag-chip { user-select: none; opacity: .55; }
.finder-tag-chip.active { opacity: 1 !important; border-color: #1a4010 !important; box-shadow: 0 0 0 2px rgba(26,64,16,.25); }

.finder-provider-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .7rem;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
.finder-provider-chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}
.finder-provider-chip.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary-dark);
}
.finder-provider-chip .chip-lock {
  font-size: .7rem;
  opacity: .7;
}
.finder-provider-chip .chip-gdpr {
  display: inline-flex;
  align-items: center;
  font-size: .85rem;
  color: #2a7f2a;
}
.finder-provider-chip.active .chip-gdpr { color: #fff; }
.finder-provider-chip.disabled,
.finder-provider-chip[disabled] {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}
.finder-provider-chip.disabled:hover { border-color: var(--color-border); color: var(--color-text-secondary); }

/* DSGVO-Toggle im Finder */
.finder-gdpr-toggle {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .6rem;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: .78rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  user-select: none;
  transition: all var(--transition);
}
.finder-gdpr-toggle input[type="checkbox"] { width: auto; margin: 0; cursor: pointer; }
.finder-gdpr-toggle:hover { border-color: var(--color-primary); color: var(--color-primary-dark); }
.finder-gdpr-toggle:has(input:checked) {
  background: #eaf6e3;
  border-color: var(--color-primary-dark);
  color: var(--color-primary-dark);
}

/* Kriterien-Gewichtung */
.finder-minscore .finder-minscore-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-top: .25rem;
}
.finder-minscore input[type="range"] { flex: 1; }
.finder-minscore input[type="range"].disabled { opacity: .35; }
#finder-min-score-off.active { background: #fff5d1; color: #8a6a00; }

.finder-weights {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  background: #f7fbf2;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: .75rem .9rem;
}
.finder-weight-row {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.finder-weight-head {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: .55rem;
  font-size: .88rem;
}
.finder-weight-icon { font-size: 1.05rem; }
.finder-weight-name { font-weight: 600; color: #1a3a14; }
.finder-weight-desc { color: #597052; font-size: .8rem; }
.finder-weight-val {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #1a3a14;
  min-width: 1.8rem;
  text-align: right;
  padding: .15rem .5rem;
  background: #e7f4dc;
  border-radius: 4px;
  font-size: .85rem;
}
.finder-weight-slider {
  width: 100%;
  accent-color: var(--color-primary);
}

/* Top-5 Karten */
.finder-top-list {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.finder-card {
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: 8px;
  padding: .7rem .9rem;
  background: #fff;
}
.finder-card-head {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}
.finder-card-rank {
  font-size: 1.4rem;
  font-weight: 700;
  min-width: 2rem;
  text-align: center;
}
.finder-card-model { flex: 1 1 auto; word-break: break-all; }
.finder-card-rankscore {
  margin-left: auto;
  font-size: 1.2rem;
  color: #1a3a14;
  padding: .2rem .55rem;
  background: #e7f4dc;
  border-radius: 6px;
}
.finder-card-rankscore small { font-size: .75rem; color: #597052; font-weight: 400; }
.finder-card-body {
  margin-top: .55rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .4rem .9rem;
}
.finder-metric {
  display: grid;
  grid-template-columns: 110px 1fr 3rem;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
}
.finder-metric-label { color: #1a3a14; font-weight: 500; }
.finder-metric-bar {
  height: 8px;
  background: #ecf4e3;
  border-radius: 4px;
  overflow: hidden;
}
.finder-metric-fill {
  height: 100%;
  background: var(--color-primary);
}
.finder-metric-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #1a3a14;
  font-weight: 600;
}
.finder-card-foot {
  margin-top: .6rem;
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .9rem;
  font-size: .8rem;
}

/* Finder: Cluster-Belegkette (welche Prompts sind ins Ranking eingeflossen) */
.finder-cluster {
  margin: .25rem 0 .75rem;
  padding: .4rem .6rem;
  background: #f6f8fb;
  border: 1px solid #e2e6ec;
  border-radius: 6px;
}
.finder-cluster > summary {
  cursor: pointer;
  font-size: .85rem;
  color: #394148;
  font-weight: 600;
  list-style: none;
}
.finder-cluster > summary::-webkit-details-marker { display: none; }
.finder-cluster > summary::before {
  content: '▸';
  display: inline-block;
  margin-right: .35rem;
  transition: transform .15s ease;
}
.finder-cluster[open] > summary::before { transform: rotate(90deg); }
.finder-cluster-list {
  list-style: none;
  margin: .5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.finder-cluster-list > li {
  display: grid;
  grid-template-columns: 3rem 12rem 1fr;
  gap: .5rem;
  align-items: baseline;
  font-size: .8rem;
  padding: .2rem 0;
  border-bottom: 1px dashed #e5e8ed;
}
.finder-cluster-list > li:last-child { border-bottom: none; }
.finder-cluster-sim {
  display: inline-block;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--color-primary-dark, #1a3a14);
}
.finder-cluster-label { font-weight: 600; color: #2a3138; }
.finder-cluster-preview {
  grid-column: 2 / -1;
  font-size: .72rem;
  color: #6b7077;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Finder: Unerprobte Modelle visuell absetzen */
.finder-card-unproven {
  border-style: dashed;
  background: #fbfaf5;
}
.finder-card-unproven .finder-card-rank {
  color: #a9823c;
}
.finder-card-unproven .finder-card-rankscore strong {
  color: #6e5a2f;
}
.badge.badge-warn {
  background: #fff4d6;
  color: #6e5a2f;
  border: 1px solid #e7c97a;
}

/* Finder: Call-to-Action zum Anlegen eines Tickets direkt aus der Suche */
.finder-ticket-cta {
  margin-top: 1rem;
  padding: .75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
  background: #f6f8fb;
  border: 1px dashed #c9d0d8;
  border-radius: 8px;
}
.finder-ticket-cta-text {
  flex: 1 1 20rem;
  font-size: .88rem;
  color: #3a4148;
}
.finder-ticket-cta .btn {
  flex: 0 0 auto;
}

/* Teil-Scores in Ergebnistabellen */
.sub-scores-list {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .2rem;
}
.sub-score-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .1rem .45rem;
  background: #eef1f4;
  border: 1px solid #d5dae0;
  border-radius: 10px;
  font-size: .72rem;
  font-weight: 600;
  color: #3a4148;
}
.sub-score-chip .chip-val { font-weight: 700; }

.sub-score-chip.score-good {
  background: var(--color-primary-light);
  border-color: #bfe0b1;
  color: var(--color-primary-dark);
}
.sub-score-chip.score-good .chip-val { color: var(--color-primary-dark); }

.sub-score-chip.score-ok {
  background: #fff3e0;
  border-color: #ffd6a3;
  color: #e65100;
}
.sub-score-chip.score-ok .chip-val { color: #e65100; }

.sub-score-chip.score-bad {
  background: #ffebee;
  border-color: #f5c2c7;
  color: #c62828;
}
.sub-score-chip.score-bad .chip-val { color: #c62828; }

/* Dauer-Anzeige: ms oben, Sekunden dezent darunter */
.dur {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}
.dur-ms {
  font-variant-numeric: tabular-nums;
}
.dur-s {
  font-size: .72rem;
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  main { padding: 1rem; }
  .card { padding: 1rem; }
  .form-row { grid-template-columns: 1fr; }
  nav.tabs { padding: .5rem 1rem; gap: .25rem; }
  nav.tabs button { padding: .4rem .65rem; font-size: .82rem; }
}

/* ═══════════════════════════════════════════════════════
   Sidebar-Navigation (v2)
   ═══════════════════════════════════════════════════════ */

:root { --sidebar-width: 210px; }

body.has-sidebar { padding: 0; background: #fff; }
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: #ffffff;
  color: #1f2328;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e5e7eb;
  z-index: 50;
  transition: width var(--transition);
  overflow: hidden;
}
body.sidebar-collapsed .sidebar { width: 60px; }

.sidebar-top {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem .9rem;
  border-bottom: 1px solid #eef0f2;
}
.sidebar-brand {
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  color: #1f2328;
  font-size: .95rem;
}
.sidebar-toggle {
  border: none;
  background: transparent;
  color: #4b5058;
  padding: .25rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  transition: background var(--transition), transform var(--transition);
}
.sidebar-toggle:hover { background: #f1f2f4; color: #1f2328; }
.sidebar-toggle:hover .sidebar-logo { transform: scale(1.06); }
.sidebar-toggle:active .sidebar-logo { transform: scale(.94); }
.sidebar-logo {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
  pointer-events: none;
  transition: transform var(--transition);
}
body.sidebar-collapsed .sidebar-logo { width: 30px; height: 30px; }
body.sidebar-collapsed .sidebar-brand { display: none; }
body.sidebar-collapsed .sidebar-top {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: .5rem .5rem;
  gap: .1rem;
  flex: 1;
}
.sidebar-bottom {
  padding: .5rem .5rem .75rem;
  border-top: 1px solid #eef0f2;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}
.sidebar-logout {
  margin: .35rem 0 0;
  padding-top: .5rem;
  border-top: 1px solid #eef0f2;
}
.sidebar-logout button.side-link {
  width: 100%;
  color: #4b5058;
  font-weight: 500;
}
.sidebar-logout button.side-link:hover {
  background: #fbeaea;
  color: #b42318;
}
.sidebar-logout button.side-link:hover .side-icon { color: #b42318; }

.side-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .55rem .75rem;
  color: #3d4248;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 500;
  text-align: left;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}
.side-link:hover { background: #f3f4f6; color: #1f2328; }
.side-link.active {
  background: #eef0f2;
  color: #1f2328;
  font-weight: 700;
}
.side-link.active:hover { background: #e8eaee; }
.side-link.active .side-icon { color: var(--color-primary-dark); }
.side-icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  text-align: center;
  font-size: 1.2rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7078;
  transition: color var(--transition);
}
.side-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  display: block;
}
.side-icon .mnh-icon,
.side-icon .mnh-icon-solid {
  font-size: 1.2rem;
  line-height: 1;
  color: inherit;
  display: inline-block;
}
body.sidebar-collapsed .side-icon svg { width: 22px; height: 22px; }
body.sidebar-collapsed .side-icon .mnh-icon,
body.sidebar-collapsed .side-icon .mnh-icon-solid { font-size: 1.35rem; }

/* Generisches Badge für beliebige Sidebar-Items, analog zur Action-Center-Badge */
.side-badge {
  margin-left: auto;
  background: var(--color-primary-dark);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
}
.side-badge.badge-danger { background: #e53935; }
.side-badge.badge-muted { background: #9aa0a6; }
body.sidebar-collapsed .side-badge {
  position: absolute;
  top: 2px;
  right: 4px;
  margin-left: 0;
  padding: 0 4px;
  min-width: 14px;
  font-size: .6rem;
}
body.sidebar-collapsed .side-icon { font-size: 1.35rem; width: 28px; }

/* Collapsed: Icons exakt in der schmalen Sidebar zentrieren */
body.sidebar-collapsed .side-link,
body.sidebar-collapsed .user-chip,
body.sidebar-collapsed .sidebar .notif-bell {
  justify-content: center;
  gap: 0;
  padding-left: 0;
  padding-right: 0;
}
body.sidebar-collapsed .sidebar-nav,
body.sidebar-collapsed .sidebar-bottom,
body.sidebar-collapsed .sidebar-logout { padding-left: 0; padding-right: 0; }
body.sidebar-collapsed .side-icon { width: 28px; margin: 0 auto; }
.sidebar-toggle { font-size: 1.2rem; }
.side-label { overflow: hidden; text-overflow: ellipsis; }
body.sidebar-collapsed .side-label { display: none; }

.user-chip {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .4rem .7rem;
  color: #6b7078;
  font-size: .82rem;
  position: relative;
}
body.sidebar-collapsed .user-chip .side-label { display: none; }

/* Aktivität: Sidebar-Badge + Panel.
   Die Render-Funktionen liefern Klassennamen mit Präfix `activity-`
   (z.B. `.activity-row`, `.activity-bar`). Wir behalten die alten
   `.robot-activity-*`-Klassen als Alias, damit bestehender Render-Code
   weiterhin funktioniert. Neuer Code soll `.activity-*` verwenden. */

/* Sidebar-Badge */
.side-link .side-badge.activity-badge {
  background: #e69c00;
  color: #fff;
}
.side-link .side-badge.activity-badge.badge-stalled { background: #c62828; }
.side-link .side-badge.activity-badge.badge-stalled-pulse {
  animation: kb-stall-pulse 1.2s ease-in-out infinite;
}
@keyframes kb-stall-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.55); }
  70%  { box-shadow: 0 0 0 6px rgba(198, 40, 40, 0); }
  100% { box-shadow: 0 0 0 0 rgba(198, 40, 40, 0); }
}

/* Live-Banner im Panel-Header (nur sichtbar, wenn etwas hängt).
   Wichtig: ``display:flex`` überschreibt den User-Agent-Default
   ``[hidden] { display:none }``; deshalb die Klassen-Regel explizit
   nur dann anwenden, wenn das ``hidden``-Attribut NICHT gesetzt ist.
   Sonst bleibt der statische Banner-Text dauerhaft sichtbar, auch wenn
   gar keine Aufgabe hängt. */
.activity-banner[hidden] {
  display: none !important;
}
.activity-banner {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .75rem;
  border-radius: 6px;
  font-size: .9rem;
  margin: 0 0 .75rem;
}
.activity-banner.danger {
  background: #fff5f5;
  border: 1px solid #f5b8b8;
  color: #8a1f1f;
}
html[data-theme="dark"] .activity-banner.danger {
  background: #3a1d1d;
  border-color: #6b2c2c;
  color: #ffb1b1;
}

/* Toolbar + Sections + Listen + Rows */
.activity-toolbar,
.robot-activity-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-bottom: .5rem;
  margin-bottom: .75rem;
  border-bottom: 1px solid var(--color-border-light, #e5e5e5);
}
.activity-summary,
.robot-activity-summary {
  font-size: .85rem;
  color: #4b5058;
  font-weight: 500;
}
.activity-section,
.robot-activity-section { margin-bottom: 1rem; }
.activity-section h3,
.activity-section h4,
.robot-activity-section h4 {
  margin: 0 0 .35rem;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #6b7078;
  font-weight: 600;
}
.activity-list,
.robot-activity-list {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.activity-empty,
.robot-activity-empty {
  display: flex;
  align-items: center;
  /* Auf ungefähr Request-Zeilenhöhe halten, damit der Wechsel zwischen
     „keine laufenden …" und einer einzelnen Zeile die Panel-Höhe nicht
     springen lässt (UI-Konsistenz). */
  min-height: 64px;
  padding: .65rem .75rem;
  background: #f6f7f9;
  border: 1px solid #eceef1;
  border-radius: 6px;
  color: #5b6066;
  font-size: .85rem;
  animation: activityRowIn .22s ease;
}
.activity-row,
.robot-activity-row {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: .55rem .7rem;
  background: #f7f8fa;
  border: 1px solid #e9ebee;
  border-radius: 6px;
  font-size: .85rem;
  /* Sanftes Erscheinen neuer Zeilen (nur bei DOM-Neuerstellung — die
     keyed Reconciliation lässt bestehende Zeilen stehen, daher kein
     Flackern beim In-Place-Patch). */
  animation: activityRowIn .22s ease;
}
@keyframes activityRowIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* Übergang Warteschlange -> aktiv: kurzer grüner Glow-Puls (box-shadow, damit
   es in beiden Themes ohne Hintergrund-Flackern funktioniert). Überschreibt
   die einfache Einblend-Animation für genau diese eine Row-Neuerstellung. */
.activity-row--activated,
.robot-activity-row--activated {
  animation: activityRowActivated .7s ease;
}
@keyframes activityRowActivated {
  0%   { box-shadow: 0 0 0 0 rgba(76,175,80,0); transform: scale(0.99); }
  30%  { box-shadow: 0 0 0 3px rgba(76,175,80,.5); transform: scale(1); }
  100% { box-shadow: 0 0 0 0 rgba(76,175,80,0); transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .activity-empty, .robot-activity-empty,
  .activity-row, .robot-activity-row,
  .activity-row--activated, .robot-activity-row--activated { animation: none; }
}
.activity-row.is-stalled,
.robot-activity-row.is-stalled {
  background: #fff5f5;
  border-color: #f5b8b8;
}
.activity-row-head,
.robot-activity-row-head {
  display: flex;
  align-items: center;
  gap: .5rem;
}
/* Typ-Badge pro Card (sagt, was der Eintrag ist: Testlauf/Bewertung/…). */
.activity-type-badge {
  flex: 0 0 auto;
  display: inline-block;
  padding: .08rem .4rem;
  border-radius: 4px;
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  background: #e6e8eb;
  color: #4a4f56;
  white-space: nowrap;
}
.activity-type-badge.type-run    { background: #e3f0ff; color: #1f5aa8; }
.activity-type-badge.type-judge  { background: #efe6ff; color: #5a3aa8; }
.activity-type-badge.type-api    { background: #e3f7ec; color: #1f7a4d; }
.activity-type-badge.type-testrun { background: #e3f7ec; color: #1f7a4d; }
.activity-type-badge.type-probe  { background: #fff1db; color: #a8641f; }
.activity-type-badge.type-ws     { background: #e6e8eb; color: #4a4f56; }
html[data-theme="dark"] .activity-type-badge { background: #2a2b30; color: #c6c6c9; }
html[data-theme="dark"] .activity-type-badge.type-run   { background: #16283f; color: #7db3ee; }
html[data-theme="dark"] .activity-type-badge.type-judge { background: #251a3d; color: #b79aeb; }
html[data-theme="dark"] .activity-type-badge.type-api   { background: #14301f; color: #6fce9b; }
html[data-theme="dark"] .activity-type-badge.type-testrun { background: #14301f; color: #6fce9b; }
html[data-theme="dark"] .activity-type-badge.type-probe { background: #3a2a12; color: #e0a860; }
html[data-theme="dark"] .activity-type-badge.type-ws    { background: #2a2b30; color: #c6c6c9; }
.activity-row-title,
.robot-activity-row-title {
  font-weight: 600;
  color: #1f2328;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-row-meta,
.robot-activity-row-meta {
  color: #6b7078;
  font-size: .78rem;
}
.activity-row-meta strong,
.robot-activity-row-meta strong {
  font-weight: 600;
  color: #1f2328;
}
.activity-row-meta .stalled-flag,
.robot-activity-row-meta .stalled-flag {
  color: #c62828;
  font-weight: 700;
}
.activity-bar,
.robot-activity-bar {
  position: relative;
  height: 6px;
  background: #e5e7ea;
  border-radius: 3px;
  overflow: hidden;
}
.activity-bar-fill,
.robot-activity-bar-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #4caf50, #66bb6a);
  width: 0%;
  transition: width .25s ease;
}
.activity-bar-fill.indeterminate,
.robot-activity-bar-fill.indeterminate {
  /* Aktiv (Fortschritt unbekannt, z. B. laufender API-Request): grüner
     Sweep — signalisiert „läuft", nicht das frühere neutrale Grau. */
  background: linear-gradient(90deg, transparent 0%, #66bb6a 30%, #4caf50 70%, transparent 100%);
  animation: activityBarSweep 1.6s linear infinite;
  width: 30%;
}
/* In der Warteschlange: ruhiger grauer Balken ohne Animation — der Eintrag
   wartet, es passiert gerade nichts (kein grüner Sweep, der „läuft" suggeriert). */
.activity-bar-fill.is-queued {
  background: #c4c7cc;
  width: 100%;
  animation: none;
}
html[data-theme="dark"] .activity-bar-fill.is-queued { background: #4a4a50; }
@keyframes activityBarSweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}
@keyframes robotActivityBarSweep { /* alter Name als Alias */
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}
.activity-row-actions,
.robot-activity-row-actions {
  display: flex;
  gap: .35rem;
  margin-top: .25rem;
}
/* Immer sichtbare Pro-Modell-Chips einer Run-Card. */
.activity-model-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .35rem;
}
.activity-model-chips:empty { display: none; }
/* Gruppe pro Modell: Modellname einmal, daneben eine Effort-Pille je Stufe.
   Dezente Klammer, damit die Zusammengehörigkeit sichtbar ist. */
.am-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .3rem;
  padding: .1rem .35rem .1rem .5rem;
  border-radius: 10px;
  background: #f4f5f7;
  border: 1px solid #e5e7ea;
}
.am-group-name {
  font-weight: 600;
  font-size: .74rem;
  color: #3a3f46;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html[data-theme="dark"] .am-group { background: #202024; border-color: #2f2f33; }
html[data-theme="dark"] .am-group-name { color: #c6c8cd; }
.am-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .08rem .45rem;
  border-radius: 999px;
  font-size: .74rem;
  line-height: 1.5;
  background: #eef0f3;
  color: #3a3f46;
  border: 1px solid transparent;
  max-width: 16rem;
}
.am-chip .am-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-chip .am-cnt { font-variant-numeric: tabular-nums; opacity: .7; font-size: .68rem; }
.am-chip .am-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.am-chip.am-queued { background: #eef0f3; color: #6b7078; }
.am-chip.am-ok     { background: #e3f7ec; color: #1f7a4d; }
.am-chip.am-fail   { background: #fdecea; color: #c0392b; }
.am-chip.am-run    { background: #e6f0fb; color: #1f5aa8; }
.am-chip.am-judged { background: #efe6ff; color: #5a3aa8; }
.am-chip.am-run .am-dot { animation: amDotPulse 1.1s ease-in-out infinite; }
@keyframes amDotPulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .am-chip.am-run .am-dot { animation: none; } }
html[data-theme="dark"] .am-chip         { background: #26272b; color: #b9bcc2; }
html[data-theme="dark"] .am-chip.am-queued { background: #26272b; color: #9498a0; }
html[data-theme="dark"] .am-chip.am-ok     { background: #14301f; color: #6fce9b; }
html[data-theme="dark"] .am-chip.am-fail   { background: #3a1d1d; color: #ffb4ac; }
html[data-theme="dark"] .am-chip.am-run    { background: #16283f; color: #7db3ee; }
html[data-theme="dark"] .am-chip.am-judged { background: #251a3d; color: #b79aeb; }
html[data-theme="dark"] .activity-row,
html[data-theme="dark"] .robot-activity-row { background: #232327; border-color: #2f2f33; }
html[data-theme="dark"] .activity-row.is-stalled,
html[data-theme="dark"] .robot-activity-row.is-stalled { background: #3a1d1d; border-color: #6b2c2c; }
html[data-theme="dark"] .activity-row-title,
html[data-theme="dark"] .robot-activity-row-title { color: var(--color-text); }
html[data-theme="dark"] .activity-empty,
html[data-theme="dark"] .robot-activity-empty { background: #1f1f22; color: #8a8a8e; border-color: #2f2f33; }
html[data-theme="dark"] .activity-summary,
html[data-theme="dark"] .robot-activity-summary { color: #8a8a8e; }
html[data-theme="dark"] .activity-row-meta,
html[data-theme="dark"] .robot-activity-row-meta { color: #a0a0a4; }
html[data-theme="dark"] .activity-row-meta strong,
html[data-theme="dark"] .robot-activity-row-meta strong { color: var(--color-text); }
html[data-theme="dark"] .activity-row-meta .stalled-flag,
html[data-theme="dark"] .robot-activity-row-meta .stalled-flag { color: #ffb4ac; }
html[data-theme="dark"] .activity-bar,
html[data-theme="dark"] .robot-activity-bar { background: #2f2f33; }

/* API-Key-Karte im Dark-Mode: dezent gegenüber der umgebenden Card
   (--color-surface ist hier #17171a) aufgehellt, damit der Block sich
   absetzt und der monospaced Klartext gut lesbar bleibt. */
html[data-theme="dark"] .api-key-card {
  background: #1f1f23;
  border-color: var(--color-border);
}
html[data-theme="dark"] .api-key-card-hint { color: var(--color-text-secondary); }

/* Mini-Status-Indikator für den Robot-WebSocket. Sitzt rechts im
   user-chip, ist nur für Admins sichtbar. Klick triggert manuellen
   Reconnect-Versuch über RobotWs.forceReconnect(). */
.ws-status-dot {
  margin-left: auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  position: relative;
  flex: 0 0 auto;
  background: #cbd5d8;
  transition: background var(--transition), box-shadow var(--transition);
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
}
.ws-status-dot:focus-visible { outline: 2px solid var(--color-primary-dark); outline-offset: 2px; }
.ws-status-pulse { display: none; }
.ws-status-open    { background: #2e7d32; }
.ws-status-warn    { background: #f9a825; }
.ws-status-warn .ws-status-pulse {
  display: block;
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(249, 168, 37, 0.5);
  animation: wsStatusPulse 1.4s ease-out infinite;
}
.ws-status-error   { background: #c62828; }
.ws-status-idle    { background: #cbd5d8; }
@keyframes wsStatusPulse {
  0%   { transform: scale(1);   opacity: .6; }
  100% { transform: scale(2.4); opacity: 0; }
}
/* Eingeklappt: Punkt bleibt am Benutzer-Symbol (oben rechts am zentrierten Icon). */
body.sidebar-collapsed .user-chip .ws-status-dot {
  margin-left: 0;
  position: absolute;
  left: calc(50% + 6px);
  right: auto;
  top: 4px;
  z-index: 1;
}
html[data-theme="dark"] .ws-status-idle { background: #3a3d40; }

.sidebar .notif-bell {
  position: relative;
  background: transparent;
  color: #3d4248;
  border: none;
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .7rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: .88rem;
  text-align: left;
  width: 100%;
}
.sidebar .notif-bell:hover { background: #e8eaee; color: #1c1f23; }
.sidebar .notif-bell .notif-badge {
  position: absolute;
  top: 2px;
  left: 26px;
  right: auto;
  bottom: auto;
  background: #ff5252;
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 8px;
  min-width: 8px;
  height: auto;
  width: auto;
  box-sizing: content-box;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
body.sidebar-collapsed .sidebar .notif-bell .notif-badge { left: 28px; top: 0; }

/* ═══════════════════════════════════════════════════════
   Auth-Seiten
   ═══════════════════════════════════════════════════════ */

body.auth-page {
  background: linear-gradient(135deg, #e8f6e4 0%, #cddcc8 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.auth-wrap { width: 100%; max-width: 420px; }
.auth-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 2rem 1.75rem;
}
.auth-title {
  margin: 0 0 .25rem;
  font-size: 1.4rem;
  color: var(--color-primary-dark);
  font-weight: 700;
}
.auth-sub { margin: 0 0 1.25rem; color: var(--color-text-secondary); font-size: .88rem; }
.auth-foot { margin-top: 1rem; font-size: .82rem; color: var(--color-text-secondary); text-align: center; }
.auth-foot a { color: var(--color-primary-dark); font-weight: 600; }

/* Dark-Mode: Hintergrund-Gradient und Karte sind im Light-Design hart hell
   gesetzt und brauchen daher explizite dunkle Varianten. Titel/Text/Inputs
   laufen bereits über var(--color-*) und passen sich selbst an. */
html[data-theme="dark"] body.auth-page {
  /* Neutral wie die App im Dark (kein Grünstich); subtiler Verlauf für Tiefe. */
  background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-bg) 100%);
}
html[data-theme="dark"] .auth-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
}

/* ═══════════════════════════════════════════════════════
   Dashboard
   ═══════════════════════════════════════════════════════ */

.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.dashboard-tile {
  background: var(--color-primary-light);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.dashboard-tile h4 {
  margin: 0;
  font-size: .78rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.dashboard-tile .tile-value {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.1;
}
.dashboard-tile .tile-sub { color: var(--color-text-secondary); font-size: .82rem; }
.dashboard-tile.wide { grid-column: 1 / -1; background: #fff; }

/* ── Projekt-Auswertung-Reiter ─────────────────────────────────────── */
/* Zweispaltiges Karten-Grid (Auswertung/Analyse); bricht mobil um. */
.auswertung-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 980px) {
  .auswertung-grid-2 { grid-template-columns: 1fr; }
}

.auswertung-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: .75rem;
}
.auswertung-kpis .dashboard-tile { padding: .75rem .9rem; }
.auswertung-kpis .dashboard-tile .tile-value { font-size: 1.4rem; }
.auswertung-paging .muted { flex: 1; text-align: center; }
table.auswertung-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
table.auswertung-table th,
table.auswertung-table td {
  padding: .35rem .55rem;
  border-bottom: 1px solid var(--color-border-light);
  text-align: left;
  vertical-align: middle;
}
table.auswertung-table th {
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  position: sticky;
  top: 0;
}
table.auswertung-table td.num,
table.auswertung-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.auswertung-table tr.req-row:hover { background: var(--color-primary-light); }
table.auswertung-table tr.req-row td { white-space: nowrap; }
.auswertung-req-status {
  display: inline-block;
  padding: .05rem .45rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
}
.auswertung-req-status.status-ok { background: var(--color-primary-light); color: var(--color-primary-dark); }
.auswertung-req-status.status-failed,
.auswertung-req-status.status-timeout,
.auswertung-req-status.status-budget_exceeded { background: #ffebee; color: #c62828; }
.auswertung-req-status.status-rate_limited,
.auswertung-req-status.status-cancelled { background: #fff4d6; color: #a07500; }

/* Badge am Refresh-Button: "N neue Requests" — wird durch WS-Events
   inkrementiert und beim Klick auf den Refresh-Button geleert. */
.auswertung-refresh-badge {
  display: none;
  margin-left: .35rem;
  padding: 0 .45rem;
  height: 18px;
  line-height: 18px;
  font-size: .72rem;
  font-weight: 700;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  vertical-align: middle;
  animation: auswertung-pulse 2s ease-in-out infinite;
}
.auswertung-refresh-badge.visible { display: inline-block; }

/* Kostenverteilung: zwei Donuts nebeneinander, auf schmalen Screens untereinander. */
.auswertung-donut-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.auswertung-donut-box h4 { margin: 0 0 .35rem; font-size: .9rem; }

/* Zuverlässigkeit & Routing: drei kleine Spalten. */
.auswertung-reliability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.auswertung-reliability-grid h4 { margin: 0 0 .35rem; font-size: .9rem; }

/* Aufgaben-Drilldown: aufklappbare Zeilen in der "Pro Aufgabe"-Tabelle. */
table.auswertung-table tr.task-row { cursor: pointer; }
table.auswertung-table tr.task-row:hover { background: var(--color-primary-light); }
table.auswertung-table tr.task-detail-row > td {
  background: var(--color-surface);
  padding: .6rem .8rem .8rem;
  white-space: normal;
}
.task-detail-grid {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) minmax(180px, 1fr);
  gap: 1rem;
}
@media (max-width: 900px) {
  .task-detail-grid { grid-template-columns: 1fr; }
}
.task-detail-grid h5 { margin: 0 0 .3rem; font-size: .82rem; color: var(--color-text-secondary); }
.task-detail-grid table.auswertung-table { font-size: .8rem; }

/* Horizontale Mini-Balken (Resolver-Pfade / Fehlerarten). */
.auswertung-bar-list { display: flex; flex-direction: column; gap: .35rem; font-size: .82rem; }
.auswertung-bar-item .bar-label { display: flex; justify-content: space-between; gap: .5rem; }
.auswertung-bar-item .bar-track {
  height: 6px;
  border-radius: 3px;
  background: var(--color-border-light);
  overflow: hidden;
  margin-top: 2px;
}
.auswertung-bar-item .bar-fill { height: 100%; border-radius: 3px; }

@keyframes auswertung-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(106,168,79,.55); }
  60%  { box-shadow: 0 0 0 6px rgba(106,168,79,0); }
  100% { box-shadow: 0 0 0 0 rgba(106,168,79,0); }
}

.dashboard-bottom {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.dashboard-bottom .card { margin: 0; }
.dashboard-bottom .card-header { padding: .75rem 1rem; border-bottom: 1px solid var(--color-border-light); }
.dashboard-bottom .dashboard-list { padding: .5rem .75rem .75rem; }

.dashboard-list { display: flex; flex-direction: column; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.dashboard-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .45rem .6rem;
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  font-size: .85rem;
}
.dashboard-list li.running { background: #fff9e0; border-color: #e7d69a; }
.dashboard-list .rank {
  display: inline-block;
  min-width: 26px;
  padding: 2px 6px;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 700;
  text-align: center;
  margin-right: .4rem;
}

/* ── Score-Pills (farbcodiert) ── */
.score-pill {
  display: inline-block;
  min-width: 2.4em;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .85rem;
  text-align: center;
  background: #f0f0f0;
  color: #333;
}
.score-pill.score-good { background: var(--color-primary-light); color: var(--color-primary-dark); }
.score-pill.score-mid  { background: #fff4d6; color: #a07500; }
.score-pill.score-low  { background: #fde4e4; color: #a42020; }

/* ── Modell-Vergleichstabelle ── */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.comparison-table th,
.comparison-table td {
  padding: .55rem .6rem;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}
.comparison-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}
.comparison-table tbody tr:hover { background: var(--color-primary-light); }

/* ── Task × Modell-Matrix ── */
.matrix-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.matrix-table th,
.matrix-table td {
  padding: .45rem .55rem;
  border-bottom: 1px solid var(--color-border-light);
  border-right: 1px solid var(--color-border-light);
}
.matrix-table thead th {
  white-space: nowrap;
}
.matrix-table .matrix-task-col {
  position: sticky;
  left: 0;
  background: var(--color-surface);
  z-index: 1;
  min-width: 180px;
  max-width: 260px;
  border-right: 2px solid var(--color-border);
}
.matrix-table thead .matrix-task-col { z-index: 3; }
.matrix-table .matrix-model-col { min-width: 110px; }
.matrix-table .matrix-model-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
}
.matrix-table .matrix-model-name {
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}
.matrix-table .matrix-cell { text-align: center; vertical-align: middle; }
.matrix-table tbody tr:hover td { background: var(--color-primary-light); }
.matrix-table tbody tr:hover .matrix-task-col { background: var(--color-primary-light); }

/* ═══════════════════════════════════════════════════════
   Results-Grid (Summary + Bestenliste nebeneinander)
   ═══════════════════════════════════════════════════════ */

.results-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.results-grid .results-summary { min-width: 0; }
.results-grid .results-bestlist { min-width: 0; }
@media (max-width: 1080px) { .results-grid { grid-template-columns: 1fr; } }

/* ═══════════════════════════════════════════════════════
   Zentrierte Zahlen-Spalten + Sortierpfeile mittig
   ═══════════════════════════════════════════════════════ */

th.num, td.num { text-align: center; }
th.num { position: relative; }

.result-identity { font-weight: 600; }
.result-score {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}
.result-score .score-badge {
  min-width: 46px;
  padding: .25rem .55rem;
  font-size: .95rem;
}
td.result-secondary {
  color: var(--color-text-secondary);
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}
td.result-secondary .score-badge {
  min-width: 0;
  padding: 0;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: .82rem;
  font-weight: 600;
}
html[data-theme="dark"] td.result-secondary .score-badge {
  background: transparent;
  color: var(--color-text-secondary);
}
td.result-secondary .score-badge:hover { transform: none; box-shadow: none; }

th.sortable {
  cursor: pointer;
  user-select: none;
}
/* Sort-Pfeile inline im Header – gleiche Höhe wie der Header-Text. */
th.sortable .sort-arrow {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: .35em;
  font-size: .8em;
  line-height: 1;
  opacity: .4;
}
th.sortable.sort-asc .sort-arrow,
th.sortable.sort-desc .sort-arrow { opacity: 1; color: var(--color-primary-dark); }

/* Eigene, datengetriebene Sortier-Header der Init-Test-Modell-Übersicht.
   Bewusst getrennt von .sortable, weil diese Tabelle gruppierte Zeilen
   (Modell + Effort-Sub-Zeilen) hat und NICHT per generischer DOM-Sortierung
   umsortiert werden darf. */
th.initial-sort-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th.initial-sort-th .initial-sort-arrow {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: .35em;
  font-size: .8em;
  line-height: 1;
  opacity: .4;
  transition: opacity var(--transition), color var(--transition);
}
th.initial-sort-th:hover .initial-sort-arrow { opacity: .75; }
th.initial-sort-th .initial-sort-arrow.active {
  opacity: 1;
  color: var(--color-primary-dark);
}
th.initial-sort-th .initial-sort-arrow .mnh-icon {
  font-size: .9em;
  line-height: 1;
}

/* Konsistenz-Tooltip */
.score-with-hint {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.15;
}
.score-with-hint .score-primary { font-weight: 700; font-size: 1rem; }
.score-with-hint .score-hint {
  font-size: .72rem;
  color: var(--color-text-secondary);
  cursor: help;
  border-bottom: 1px dotted var(--color-text-secondary);
}

/* ═══════════════════════════════════════════════════════
   Sub-Score Chips (erweitert)
   ═══════════════════════════════════════════════════════ */

.sub-score-chips {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 3px;
  align-items: stretch;
  margin-top: 4px;
}
/* Chips nehmen die volle Zellbreite ein und zeigen Label links, Wert rechts */
.sub-score-chips .sub-score-chip {
  justify-content: space-between;
  width: 100%;
  font-size: .72rem;
  line-height: 1.15;
  padding: .12rem .45rem;
}
.sub-score-chips .sub-score-chip .chip-val { margin-left: .5rem; }

/* ═══════════════════════════════════════════════════════
   Icon-Buttons (Font Icons: munnichit-icons)
   ═══════════════════════════════════════════════════════ */

/* Icon innerhalb eines Buttons (Icon+Text) neben dem Text */
button .mnh-icon,
button .mnh-icon-solid,
.btn-icon .mnh-icon,
.btn-icon .mnh-icon-solid {
  font-size: 1.05em;
  line-height: 1;
  vertical-align: -2px;
}
/* Abstand zwischen Icon und Text/anderem Element im Button.
   Wir nutzen margin-right auf dem Icon, damit es auch vor Text-Nodes greift. */
button > .mnh-icon:not(:only-child),
button > .mnh-icon-solid:not(:only-child) { margin-right: .35em; }
/* Icon-only Buttons behalten kein extra Margin */
.btn-icon > .mnh-icon,
.btn-icon > .mnh-icon-solid { margin-right: 0 !important; }

/* Kompakter, quadratischer Icon-only-Button */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-text-secondary, #6b7078);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.btn-icon:hover {
  background: var(--color-border-light, #e2ede0);
  color: var(--color-primary-dark, #1b5e20);
}
.btn-icon:disabled { opacity: .5; cursor: not-allowed; }
.btn-icon .mnh-icon,
.btn-icon .mnh-icon-solid { font-size: 1.05rem; vertical-align: 0; }
.btn-icon + .btn-icon { margin-left: 2px; }

/* Kleinere Variante (Tabellen-Aktionen) */
.btn-icon.btn-sm {
  width: 26px;
  height: 26px;
}
.btn-icon.btn-sm .mnh-icon,
.btn-icon.btn-sm .mnh-icon-solid { font-size: .95rem; }

/* Farbliche Varianten für Icon-only-Buttons */
.btn-icon.danger { color: #c62828; }
.btn-icon.danger:hover { background: #fdecea; color: #b71c1c; }
.btn-icon.primary { color: var(--color-primary-dark, #1b5e20); }
.btn-icon.primary:hover { background: var(--color-border-light, #e2ede0); }
.btn-icon.warning { color: #b26a00; }
.btn-icon.warning:hover { background: #fff4e0; color: #8a4b00; }
.btn-icon.warning:disabled,
.btn-icon.warning[disabled] { color: inherit; background: transparent; }

/* Empty-State-Icon (großes Symbol) */
.empty-state .icon .mnh-icon,
.empty-state .icon .mnh-icon-solid { font-size: 2rem; opacity: .55; }

/* Sort-Pfeile (th): Icon-Font statt Unicode – Höhe an Header-Text ausrichten */
th.sortable .sort-arrow .mnh-icon {
  font-size: .9em;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

/* Stern-Buttons (Favorit): Icon-Font */
.fav-star .mnh-icon,
.fav-star .mnh-icon-solid { font-size: 1rem; vertical-align: 0; }

/* Aufgaben-Tickets */
.ticket-list {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.ticket-card {
  background: #fff;
  border: 1px solid var(--color-border-light, #e5e5e5);
  border-radius: 8px;
  padding: .65rem .8rem;
  cursor: pointer;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.ticket-card:hover {
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
  border-color: #cfcfcf;
}
.ticket-card-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.ticket-card-head .ticket-title {
  font-weight: 600;
  margin-right: auto;
}
.ticket-card-head .ticket-meta {
  font-size: .8rem;
  white-space: nowrap;
}
.ticket-priority {
  font-size: .72rem;
  font-weight: 600;
  padding: .1rem .45rem;
  border-radius: 999px;
  background: #eee;
  color: #333;
}
.ticket-priority.priority-high { background: #ffe0dc; color: #a1392c; }
.ticket-priority.priority-low  { background: #e6f0ff; color: #2a4a80; }
.ticket-priority.priority-normal { background: #f2f2f2; color: #555; }

.ticket-card-body {
  margin-top: .45rem;
  font-size: .85rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.ticket-card-linked {
  margin-top: .35rem;
  font-size: .8rem;
}
.ticket-card-notes {
  margin-top: .5rem;
  padding: .45rem .6rem;
  background: #f7fbff;
  border-left: 3px solid #3a86c5;
  border-radius: 4px;
  font-size: .85rem;
  white-space: pre-wrap;
}
.ticket-card-actions {
  margin-top: .5rem;
  display: flex;
  gap: .35rem;
  justify-content: flex-end;
}

/* Konsistenz-Aufschlüsselung pro (Prompt, Stufe) */
.consistency-breakdown > summary {
  cursor: pointer;
  list-style: none;
  padding: .35rem 0;
  font-size: .88rem;
}
.consistency-breakdown > summary::marker,
.consistency-breakdown > summary::-webkit-details-marker { display: none; }
.consistency-breakdown > summary::before {
  content: "▸";
  display: inline-block;
  width: 1em;
  margin-right: .25rem;
  transition: transform .15s ease;
}
.consistency-breakdown[open] > summary::before {
  transform: rotate(90deg);
}
.consistency-breakdown-table {
  margin-top: .4rem;
  font-size: .82rem;
  border-collapse: collapse;
  width: 100%;
}
.consistency-breakdown-table th,
.consistency-breakdown-table td {
  padding: .25rem .45rem;
  border-bottom: 1px solid var(--color-border-light, #eee);
}
.consistency-breakdown-table th {
  text-align: left;
  font-weight: 600;
  color: #555;
}
.consistency-breakdown-table td.num,
.consistency-breakdown-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── API-Key-Karte im Projekt-Detail (1:1) ──
   Sitzt innerhalb einer .card (Surface) und soll leicht abgesetzt
   wirken. Benutzt deshalb --color-bg im Light-Mode (heller Hintergrund
   wärmer als das umgebende Weiss); im Dark-Mode wird sie über den
   Block ganz unten dezent aufgehellt, damit sie nicht in der dunklen
   Surface verschwindet. */
.api-key-card {
  margin: 0 0 1rem;
  padding: .75rem 1rem;
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  background: var(--color-bg);
}
.api-key-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}
.api-key-card-head h3 {
  margin: 0;
  font-size: .92rem;
  font-weight: 700;
  color: var(--color-text);
}
.api-key-card-hint {
  margin: 0 0 .5rem;
  font-size: .8rem;
}
.api-key-card-field {
  margin-bottom: .4rem;
}
.api-key-card-input-row {
  display: flex;
  gap: .4rem;
  align-items: stretch;
}
input.api-key-plaintext {
  flex: 1;
  font-family: 'Fira Code', Consolas, 'Liberation Mono', monospace;
}

/* ── Tabellen-Pagination ──
   Generischer Pager, der direkt nach jeder paginierten <table> eingefügt
   wird. Drei-Spalten-Grid: links die Eintrags-Info, exakt mittig die
   Seiten-Navigation, rechts die Seitengrößen-Wahl. Bei schmalen Viewports
   brechen die drei Bereiche zentriert untereinander. */
.table-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .6rem .9rem;
  margin: .6rem 0 1.1rem;
  padding: .45rem .65rem;
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  background: var(--color-surface, #fff);
  font-size: .82rem;
  color: var(--color-text-secondary);
}
.table-pagination-info {
  justify-self: start;
  min-width: 0;
}
.table-pagination-controls {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  justify-self: center;
}
.table-pagination-controls .btn-sm {
  min-width: 2rem;
  justify-content: center;
  padding: .3rem .55rem;
  font-variant-numeric: tabular-nums;
}
.table-pagination-controls .tp-page.is-active {
  background: var(--color-primary);
  color: #1a2e1a;
  border-color: var(--color-primary);
  font-weight: 600;
  pointer-events: none;
}
.table-pagination-controls .tp-ellipsis {
  padding: 0 .25rem;
  color: var(--color-text-secondary);
  user-select: none;
}
.table-pagination-size {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  justify-self: end;
}
.table-pagination-size label {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: 0;
  font-size: .8rem;
  color: var(--color-text-secondary);
}
.table-pagination-size select {
  padding: .25rem .4rem;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface, #fff);
  color: var(--color-text);
  font-size: .8rem;
}

@media (max-width: 640px) {
  .table-pagination {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .table-pagination-info,
  .table-pagination-controls,
  .table-pagination-size {
    justify-self: center;
    justify-content: center;
    text-align: center;
  }
}

/* ═══════════════════════════════════════════════════════
   Dark Mode
   Identisches Layout wie Light-Mode – nur die Farben sind
   dunkle Äquivalente (Schwarz/Dunkelgrau mit grünen Akzenten).
   ═══════════════════════════════════════════════════════ */

html[data-theme="dark"],
html[data-theme="dark"] body {
  color-scheme: dark;
}

/* Variablen: gleiche Rollen wie im Light-Mode, nur mit dunklen Farben.
   Primary bleibt Grün, damit alle grünen Akzente (Buttons, Panel-Border,
   Hover-Töne, aktiver App-Tab-Oberbalken) identisch funktionieren. */
html[data-theme="dark"] {
  --color-primary: #9CD78C;          /* gleich wie Light */
  --color-primary-light: #1d2a1c;    /* aus #e8f6e4 → dunkle Variante */
  --color-primary-dark: #b9e5a8;     /* aus #4a8a3c → für Dark-Bg invertiert */
  --color-bg: #0e0e10;               /* aus #f6f8f5 */
  --color-surface: #17171a;          /* aus #ffffff */
  --color-text: #ececec;             /* aus #1a2e1a */
  --color-text-secondary: #a0a0a4;   /* aus #5f7060 */
  --color-border: #2d2d31;           /* aus #cddcc8 */
  --color-border-light: #232327;     /* aus #e2ede0 */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.55), 0 1px 2px rgba(0,0,0,.45);
  --shadow-md: 0 4px 14px rgba(0,0,0,.65), 0 2px 4px rgba(0,0,0,.5);
  --shadow-lg: 0 14px 40px rgba(0,0,0,.75), 0 4px 12px rgba(0,0,0,.55);
  --mnh-surface: #1c1c20;
  --mnh-surface-muted: #141418;
  --mnh-border: #2d2d31;
  --mnh-muted: #a0a0a4;
}

/* Grundflächen (im Light: body weiss, main weiss) */
html[data-theme="dark"] { background: var(--color-bg); }
html[data-theme="dark"] body.has-sidebar { background: var(--color-surface); }
html[data-theme="dark"] body.has-sidebar main.app-main { background: var(--color-surface); }

/* Sidebar (im Light: #ffffff, Hovers in Grautönen) */
html[data-theme="dark"] .sidebar {
  background: #141417;
  color: var(--color-text);
  border-right: 1px solid var(--color-border);
}
html[data-theme="dark"] .sidebar-top,
html[data-theme="dark"] .sidebar-bottom,
html[data-theme="dark"] .sidebar-logout { border-color: var(--color-border); }
html[data-theme="dark"] .sidebar-brand { color: var(--color-text); }
html[data-theme="dark"] .sidebar-toggle { color: #a0a0a4; }
html[data-theme="dark"] .sidebar-toggle:hover { background: #232327; color: var(--color-text); }
html[data-theme="dark"] .sidebar-logo { filter: drop-shadow(0 0 2px rgba(255, 255, 255, .12)); }
html[data-theme="dark"] .side-link { color: #c6c6c9; }
html[data-theme="dark"] .side-link:hover { background: #232327; color: var(--color-text); }
html[data-theme="dark"] .side-link.active { background: #2a2a2f; color: var(--color-text); }
html[data-theme="dark"] .side-link.active:hover { background: #33333a; }
html[data-theme="dark"] .side-icon { color: #8a8a8e; }
html[data-theme="dark"] .sidebar-logout button.side-link { color: #a0a0a4; }
html[data-theme="dark"] .sidebar-logout button.side-link:hover { background: #3a1f1f; color: #ff9a90; }
html[data-theme="dark"] .sidebar-logout button.side-link:hover .side-icon { color: #ff9a90; }
html[data-theme="dark"] .user-chip { color: #8a8a8e; }
html[data-theme="dark"] .sidebar .notif-bell { color: #c6c6c9; }
html[data-theme="dark"] .sidebar .notif-bell:hover { background: #232327; color: var(--color-text); }
html[data-theme="dark"] .notif-badge { background: #c8453a; color: #fff; box-shadow: 0 0 0 1px #141417; }
html[data-theme="dark"] .notif-dropdown {
  background: #17171a;
  border-color: var(--color-border);
  box-shadow: 0 10px 28px rgba(0,0,0,.55);
}
html[data-theme="dark"] .notif-dropdown-header { border-bottom-color: #2a2a2f; }
html[data-theme="dark"] .notif-item { border-bottom-color: #232327; }
html[data-theme="dark"] .notif-item:hover { background: #202329; }
html[data-theme="dark"] .notif-item.notif-unread { background: #1d2a1c; }
html[data-theme="dark"] .notif-item-body { color: #b2b2b6; }
html[data-theme="dark"] .notif-item-time { color: #8f8f94; }
html[data-theme="dark"] .notif-item.notif-archived { background: #1a1a1d; }
html[data-theme="dark"] .notif-empty { color: #8f8f94; }
/* Typabhängiger Inhaltsblock im Benachrichtigungs-Detail. */
.notif-detail-block {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 6px;
  padding: .6rem;
  font-size: .88rem;
  background: var(--color-bg-soft, #f8f8f8);
  border: 1px solid var(--color-border);
}
.notif-detail-block.is-danger {
  background: rgba(198, 40, 40, .06);
  border-color: rgba(198, 40, 40, .35);
}
html[data-theme="dark"] .notif-detail-block {
  background: #111114;
  border-color: #2a2b30;
  color: var(--color-text);
}
html[data-theme="dark"] .notif-detail-block.is-danger {
  background: rgba(198, 40, 40, .12);
  border-color: rgba(198, 40, 40, .45);
}

/* App-Tab-Bar – gleiche Geometrie, dunkler Verlauf; aktiver Tab
   verschmilzt optisch mit der Content-Fläche darunter (--color-surface). */
html[data-theme="dark"] .app-tabs-bar {
  background: linear-gradient(180deg, #131316 0%, #101013 100%);
  border-bottom-color: var(--color-border);
  box-shadow: inset 0 -1px 0 var(--color-border), 0 1px 2px rgba(0,0,0,.25);
  scrollbar-color: #3a3a3e transparent;
}
html[data-theme="dark"] .app-tabs-bar::-webkit-scrollbar-thumb { background: #3a3a3e; }
html[data-theme="dark"] .app-tabs-bar::-webkit-scrollbar-thumb:hover { background: #55555a; }
html[data-theme="dark"] .app-tab { background: rgba(255,255,255,0.035); color: #c6c6c9; }
html[data-theme="dark"] .app-tab:hover { background: rgba(255,255,255,0.07); color: var(--color-text); }
html[data-theme="dark"] .app-tab.active {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
  box-shadow: 0 -2px 6px rgba(0,0,0,.35);
}
html[data-theme="dark"] .app-tab.active::after { background: var(--color-surface); }
html[data-theme="dark"] .app-tab .app-tab-icon { color: #8a8a8e; }

/* Tabellen – Grundstile im Dark Mode */
html[data-theme="dark"] th {
  color: #a0a0a4;
  background: var(--color-surface);
  border-bottom-color: #3a3a3f;
}
html[data-theme="dark"] th:hover { background: #222228; color: var(--color-primary-dark); }
html[data-theme="dark"] td { border-bottom-color: var(--color-border-light); }
html[data-theme="dark"] tr:hover td { background: #1d241b; }
html[data-theme="dark"] tbody tr:nth-child(even) td { background: rgba(255,255,255,.015); }
html[data-theme="dark"] tbody tr:nth-child(even):hover td { background: #1d241b; }

/* Vergleichstabelle */
html[data-theme="dark"] .comparison-table tbody tr:hover td { background: #1d241b; }
html[data-theme="dark"] .matrix-table th,
html[data-theme="dark"] .matrix-table td { border-color: var(--color-border-light); }
html[data-theme="dark"] .matrix-table tbody tr:hover td { background: #1d241b; }
html[data-theme="dark"] .matrix-table tbody tr:hover .matrix-task-col { background: #1d241b; }

/* Konsistenz-Aufschlüsselung */
html[data-theme="dark"] .consistency-breakdown-table th { color: #a0a0a4; }
html[data-theme="dark"] .consistency-breakdown-table th,
html[data-theme="dark"] .consistency-breakdown-table td { border-bottom-color: var(--color-border-light); }

/* Dashboard-Kacheln & -Listen */
html[data-theme="dark"] .dashboard-tile { background: var(--color-surface); border-color: var(--color-border); }
html[data-theme="dark"] .dashboard-tile.wide { background: var(--color-surface); }
html[data-theme="dark"] .dashboard-list li { background: #1c1c20; border-color: var(--color-border-light); }
html[data-theme="dark"] .dashboard-list li.running { background: #2e2818; border-color: #5c4a1f; }

/* Tabellen – Hovers mappen auf die dunkle primary-light-Variante */
html[data-theme="dark"] tr.run-row:hover td { background: #232d20; }
html[data-theme="dark"] tr.run-row:active td { background: #2a3628; }
html[data-theme="dark"] tr.run-batch-row:hover td { background: #232d20; }
html[data-theme="dark"] tr.run-batch-row.expanded td { background: #1a221a; }
html[data-theme="dark"] tr.run-batch-row.expanded:hover td { background: #232d20; }
html[data-theme="dark"] tr.run-batch-child td { background: #141418; }
html[data-theme="dark"] tr.run-batch-child:hover td { background: #1a221a; }
html[data-theme="dark"] .run-batch-toggle { color: #c6c6c9; }
html[data-theme="dark"] .run-batch-toggle:hover { background: #232327; color: var(--color-text); }

/* Buttons (Light nutzt hartcodierte Hellfarben für Ghost/Danger/Close) */
html[data-theme="dark"] .btn-ghost {
  background: #1f2024;
  border-color: #3a3c42;
  color: var(--color-text-secondary);
}
html[data-theme="dark"] .btn-ghost:hover { background: #2a2b30; color: var(--color-text); border-color: #50525a; }
html[data-theme="dark"] .btn-ghost:active { background: #1c1c1f; }
html[data-theme="dark"] .btn-ghost:disabled,
html[data-theme="dark"] .btn-ghost[disabled] { background: #1a1a1d; color: #6b6f76; border-color: #2a2b30; }

/* Tabellen-Pagination im Dark-Mode */
html[data-theme="dark"] .table-pagination {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text-secondary);
}
html[data-theme="dark"] .table-pagination-size select {
  background: #1f2024;
  border-color: #3a3c42;
  color: var(--color-text);
}
html[data-theme="dark"] .table-pagination-controls .tp-page.is-active {
  background: var(--color-primary);
  color: #0e1a0c;
  border-color: var(--color-primary);
}
html[data-theme="dark"] .active-model-list {
  background: var(--color-bg-soft, #1a1a1d);
  border-color: var(--color-border, #2a2b30);
}
html[data-theme="dark"] .active-model-row {
  background: #1e1f23;
  border-color: #2a2b30;
  color: var(--color-text, #e0e0e0);
}
html[data-theme="dark"] .active-model-row:hover {
  background: #1c2a1a;
  border-color: #2f5b2f;
  box-shadow: 0 1px 4px rgba(80,140,70,.15);
}
html[data-theme="dark"] .active-model-name { color: var(--color-text, #e0e0e0); }
html[data-theme="dark"] .active-model-row .btn-ghost { background: transparent; border: none; }
html[data-theme="dark"] .active-model-row .btn-ghost:hover { background: #232327; }
html[data-theme="dark"] .btn-icon.btn-ghost { background: transparent; border: none; }
html[data-theme="dark"] .btn-icon.btn-ghost:hover { background: #232327; }
html[data-theme="dark"] .btn-icon.danger { color: #ff9a90; }
html[data-theme="dark"] .btn-icon.danger:hover { background: #3a1f1f; color: #ffb4ac; }
html[data-theme="dark"] .btn-secondary:hover { background: #2a3a25; }
html[data-theme="dark"] .btn-danger { background: #3a1f1f; color: #ff9a90; }
html[data-theme="dark"] .btn-danger:hover { background: #4a2828; }
html[data-theme="dark"] .modal-head .close-modal:hover { background: #3a1f1f; color: #ff9a90; }
html[data-theme="dark"] .modal-head .close-modal:active { background: #4a2828; }

/* Flash-Messages (Light: hellgrüner/hellroter Background) */
html[data-theme="dark"] .flash.ok { background: #1d2a1c; color: #b9e5a8; border-color: #2f5b2f; }
html[data-theme="dark"] .flash.err { background: #3a1f1f; color: #ffb4ac; border-color: #6a2a2a; }

/* Tickets */
html[data-theme="dark"] .ticket-card {
  background: #1c1c20;
  border-color: var(--color-border);
}
html[data-theme="dark"] .ticket-card:hover {
  border-color: #3e3e44;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
html[data-theme="dark"] .ticket-card-head .ticket-title { color: var(--color-text); }
html[data-theme="dark"] .ticket-card-body { color: #a0a0a4; }
html[data-theme="dark"] .ticket-card-linked { color: #a0a0a4; }
html[data-theme="dark"] .ticket-card-linked strong { color: var(--color-text); }
html[data-theme="dark"] .ticket-card-notes { background: #1a2530; border-left-color: #4a90c5; color: #d8e8f4; }
html[data-theme="dark"] .ticket-card-notes strong { color: #a8cff0; }
html[data-theme="dark"] .ticket-priority { background: #232327; color: #c6c6c9; }
html[data-theme="dark"] .ticket-priority.priority-high { background: #3a1f1f; color: #ffb4ac; }
html[data-theme="dark"] .ticket-priority.priority-low { background: #1a2530; color: #a8cff0; }
html[data-theme="dark"] .ticket-priority.priority-normal { background: #232327; color: #c6c6c9; }
html[data-theme="dark"] .badge-warning { background: #2e2818; color: #e6c477; }
html[data-theme="dark"] .badge-info { background: #1a2530; color: #a8cff0; }
html[data-theme="dark"] .badge-muted { background: #2a2a2e; color: #c6c6c9; }

/* Scrollbar allgemein (WebKit) */
html[data-theme="dark"] ::-webkit-scrollbar { background: #0e0e10; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #2f2f33; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #454549; }

/* Pipeline-Sektion (Task-Editor) */
html[data-theme="dark"] .pipeline-section { background: #131316; border-color: var(--color-border); }
html[data-theme="dark"] .pipeline-section[open] { background: var(--color-surface); }
html[data-theme="dark"] .pipeline-summary::before { color: var(--color-text-secondary); }
html[data-theme="dark"] .pipeline-stage { background: var(--color-surface); border-color: var(--color-border); }
html[data-theme="dark"] .pipeline-stage-index { background: #1d2a1c; color: #b9e5a8; }
html[data-theme="dark"] .pipeline-stage-name:focus { background: var(--color-surface); border-color: var(--color-border); }
html[data-theme="dark"] .pipeline-stage-criteria-hint { color: var(--color-text-secondary); }
html[data-theme="dark"] .pipeline-stage-criteria-hint.has-custom { color: #b9e5a8; }
html[data-theme="dark"] .pipeline-stage-filter,
html[data-theme="dark"] .base-stage-filter { background: #131316; border-color: var(--color-border); }
html[data-theme="dark"] .pipeline-stage-filter > summary,
html[data-theme="dark"] .base-stage-filter > summary { color: var(--color-text-secondary); }
html[data-theme="dark"] .pipeline-stage-filter-grid label { color: var(--color-text-secondary); }
html[data-theme="dark"] .pipeline-stage-filter-grid input { background: #101012; border-color: var(--color-border); color: var(--color-text); }
html[data-theme="dark"] .pipeline-stage-history { background: #131316; border-color: var(--color-border); }
html[data-theme="dark"] .pipeline-stage-history-title { color: var(--color-text-secondary); }

/* History-Badges (Stufen-Historie) */
html[data-theme="dark"] .history-badge { background: #232327; color: #c6c6c9; }
html[data-theme="dark"] .history-badge.good { background: #1d2a1c; color: #b9e5a8; }
html[data-theme="dark"] .history-badge.ok   { background: #2e2818; color: #e6c477; }
html[data-theme="dark"] .history-badge.bad  { background: #3a1f1f; color: #ffb4ac; }

/* Pipeline-Tabelle (Run-Detail) */
html[data-theme="dark"] .pipeline-table tbody.pipeline-group + tbody.pipeline-group { border-top-color: var(--color-border); }
html[data-theme="dark"] .pipeline-group-head td { background: #1a2028; }
html[data-theme="dark"] .pipeline-group-head:hover td { background: #222a36; }
html[data-theme="dark"] .pipeline-chev { color: #8a9cb5; }
html[data-theme="dark"] .pipeline-stage-row td { background: #131418; }

/* Run-Detail: Pipeline Fan-out Baum */
html[data-theme="dark"] .result-tree > .tree-node { border-bottom-color: var(--color-border); }
html[data-theme="dark"] .tree-node-head { background: #171a1f; border-color: #262b33; }
html[data-theme="dark"] .tree-node-head:hover { background: #1f242c; }
html[data-theme="dark"] .tree-stage-chip { background: #1a2530; color: #a8cff0; }
html[data-theme="dark"] .tree-meta { color: #8a9cb5; }
html[data-theme="dark"] .tree-err-badge { color: #ff9a90; }
html[data-theme="dark"] .tree-expand { color: #8a9cb5; }
html[data-theme="dark"] .tree-expand:hover { background: #1f242c; }
html[data-theme="dark"] .tree-children { border-left-color: #2a323c; }
html[data-theme="dark"] .tree-children > .tree-node::before { background: #2a323c; }

/* Leaf eines echten Pipeline-Pfads */
html[data-theme="dark"] .tree-path-summary {
  background: linear-gradient(90deg, #182a1f 0%, #171f2a 100%);
  border-color: #2d4a38;
}
html[data-theme="dark"] .tree-path-label { color: #b9e5a8; }
html[data-theme="dark"] .tree-path-label .mnh-icon { color: #7fd09a; }
html[data-theme="dark"] .tree-path-score { color: #a8cff0; }
html[data-theme="dark"] .tree-path-meta { color: #8a9cb5; }
html[data-theme="dark"] .tree-node.tree-node-path-leaf > .tree-node-head {
  background: #182a1f;
  border-color: #2d4a38;
  border-left-color: #7fd09a;
}
html[data-theme="dark"] .tree-node.tree-node-path-leaf > .tree-node-head .tree-stage-chip {
  background: #1d2a1c;
  color: #b9e5a8;
}

/* Run Status */
html[data-theme="dark"] .run-pending td { background: #2e2818 !important; }
@keyframes run-result-row-in-dark {
  from { background-color: #2e2818; }
  to   { background-color: transparent; }
}
html[data-theme="dark"] tr.run-result-row.run-result-new td {
  animation: run-result-row-in-dark 1.4s ease-out 1;
}

/* ── Score-Pills, Score-Badges, Sub-Score-Chips ── */
/* .score-good nutzt --color-primary-light / --color-primary-dark und passt sich
   automatisch an. Hier nur die hartcodierten ok/mid/bad- und bad-Neutraltöne. */
html[data-theme="dark"] .score-pill { background: #232327; color: #c6c6c9; }
html[data-theme="dark"] .score-pill.score-good { background: var(--color-primary-light); color: var(--color-primary-dark); }
html[data-theme="dark"] .score-pill.score-mid { background: #2e2818; color: #e6c477; }
html[data-theme="dark"] .score-pill.score-low { background: #3a1f1f; color: #ffb4ac; }

html[data-theme="dark"] .score-good { background: var(--color-primary-light); color: var(--color-primary-dark); }
html[data-theme="dark"] .score-ok  { background: #2e2818; color: #e6c477; }
html[data-theme="dark"] .score-bad { background: #3a1f1f; color: #ffb4ac; }

/* Sub-Score-Chips: neutrale Basis + farbige Varianten */
html[data-theme="dark"] .sub-score-chip {
  background: #1c1c20;
  border-color: var(--color-border);
  color: var(--color-text);
}
html[data-theme="dark"] .sub-score-chip.score-good {
  background: var(--color-primary-light);
  border-color: #2d4a38;
  color: #b9e5a8;
}
html[data-theme="dark"] .sub-score-chip.score-good .chip-val { color: #b9e5a8; }
html[data-theme="dark"] .sub-score-chip.score-ok {
  background: #2e2818;
  border-color: #5c4a1f;
  color: #e6c477;
}
html[data-theme="dark"] .sub-score-chip.score-ok .chip-val { color: #e6c477; }
html[data-theme="dark"] .sub-score-chip.score-bad {
  background: #3a1f1f;
  border-color: #6a2a2a;
  color: #ffb4ac;
}
html[data-theme="dark"] .sub-score-chip.score-bad .chip-val { color: #ffb4ac; }

/* Konsistenz-Hint in Score-Zellen */
html[data-theme="dark"] .score-with-hint .score-hint { color: var(--color-text-secondary); border-bottom-color: var(--color-text-secondary); }

/* Allgemeine Info-Badges (Light: hellgrau/pastell) */
html[data-theme="dark"] .badge-muted { background: #232327; color: #a0a0a4; }
html[data-theme="dark"] .badge-key   { background: #2e2818; color: #e6c477; }
html[data-theme="dark"] .badge-warn  { background: #2e2818; color: #e6c477; }
html[data-theme="dark"] .badge-danger { background: #3a1f1f; color: #ffb4ac; }

/* Subtab-Counter, Rollen-Toggle & Modul-Chips
   (Light verwendet hartcodierte helle Pastelltöne, die im Dark-Mode
   unleserlich wären) */
html[data-theme="dark"] nav.subtabs button .count {
  background: #232327;
  color: #c6c6c9;
}
html[data-theme="dark"] nav.subtabs button.active .count {
  background: #1d2a1c;
  color: var(--color-primary-dark);
}
html[data-theme="dark"] .role-toggle { background: #1c1c20; border-color: var(--color-border); }
html[data-theme="dark"] .role-toggle-btn { color: #c6c6c9; }
html[data-theme="dark"] .role-toggle-btn.active { color: var(--color-text); }
html[data-theme="dark"] .module-chip {
  background: #1c1c20;
  color: #c6c6c9;
  border-color: var(--color-border);
}
html[data-theme="dark"] .module-chip.active { color: var(--color-text); }


/* ── Anbieter-Modelle: Dark-Theme ── */
html[data-theme="dark"] .prov-models-table tr.fav-row-active td { background: #1c2a1a; }
html[data-theme="dark"] .prov-model-filter { background: var(--color-bg-soft, #1a1a1d); border-color: #2a2b30; color: #ddd; }
html[data-theme="dark"] .blocked-models-summary { color: #ff8a80; }
html[data-theme="dark"] .blocked-model-item { background: #1a1a1d; color: #666; }
html[data-theme="dark"] .blocked-model-name { color: #777; }

/* ── Bewertungskriterien (Task-Editor) ── */
html[data-theme="dark"] .criteria-row { background: #17191a; border-color: var(--color-border); }
html[data-theme="dark"] .criteria-row:hover { box-shadow: 0 1px 4px rgba(0,0,0,.4); }
html[data-theme="dark"] .criteria-row .crit-name:hover,
html[data-theme="dark"] .criteria-row .crit-name:focus { background: #1c1c20; border-color: var(--color-border); }
html[data-theme="dark"] .criteria-row .crit-desc { color: var(--color-text-secondary); }
html[data-theme="dark"] .criteria-row .crit-desc:hover,
html[data-theme="dark"] .criteria-row .crit-desc:focus { background: #1c1c20; border-color: var(--color-border); }
html[data-theme="dark"] .criteria-row .crit-weight-display { color: #b9e5a8; }
html[data-theme="dark"] .criteria-row .crit-del { color: #ff9a90; }
/* Slider-Track (Rest-Bereich) dunkel */
html[data-theme="dark"] .criteria-row .crit-slider {
  background: linear-gradient(to right,
    var(--crit-color, #9CD78C) 0%,
    var(--crit-color, #9CD78C) calc(var(--val, 0) * 1%),
    #2a2a2d calc(var(--val, 0) * 1%),
    #2a2a2d 100%);
}
html[data-theme="dark"] .criteria-row .crit-slider::-moz-range-track { background: #2a2a2d; }
html[data-theme="dark"] .criteria-row .crit-slider::-webkit-slider-thumb { background: var(--color-surface); }
html[data-theme="dark"] .criteria-row .crit-slider::-moz-range-thumb { background: var(--color-surface); }
html[data-theme="dark"] .criteria-bar { background: #1f1f22; border-color: var(--color-border); }

/* ── Prompt-Items & Bibliothek (Task-Editor): Dark ── */
html[data-theme="dark"] .prompt-item-row {
  background: var(--color-bg, #0e0e10);
  border-color: var(--color-border-light, #2a2b30);
}
html[data-theme="dark"] .prompt-item-row:hover {
  background: #1c2a1a;
  border-color: var(--color-primary, #9CD78C);
  box-shadow: 0 0 0 2px rgba(156,215,140,.12);
}
html[data-theme="dark"] .prompt-item-row .prompt-item-label {
  background: transparent;
  color: var(--color-text, #e0e0e0);
}
html[data-theme="dark"] button.prompt-item-icon-btn.prompt-item-delete:hover,
html[data-theme="dark"] button.prompt-item-icon-btn.prompt-item-delete-new:hover {
  background: #3a1f1f;
  color: #ff9a90;
}
html[data-theme="dark"] .expected-answer-chip {
  background: #1d2a1c;
  color: #b9e5a8;
}
html[data-theme="dark"] .library-ref-chip {
  background: #1f1a30;
  color: #c4b5f0;
}
html[data-theme="dark"] .library-kind-text {
  background: #1a2230;
  color: #a8cff0;
}
html[data-theme="dark"] .library-kind-file {
  background: #2e2818;
  color: #e6c477;
}
html[data-theme="dark"] .library-picker-list {
  background: var(--color-surface, #17171a);
  border-color: var(--color-border, #2a2b30);
}
html[data-theme="dark"] .library-picker-item:hover {
  background: #1e1f23;
}
html[data-theme="dark"] .library-picker-label strong {
  color: var(--color-text, #e0e0e0);
}

/* ── Judge-Prompt-Templates ── */
html[data-theme="dark"] .judge-template-item {
  background: #1c1c20 !important;
  border-color: #2d2d31 !important;
}
html[data-theme="dark"] .judge-template-item .judge-tpl-textarea {
  background: #111114;
  color: #d4d8dc;
  border: 1px solid #2d2d31;
  border-radius: 6px;
}
html[data-theme="dark"] .judge-template-item .judge-tpl-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(156,215,140,.15);
}
html[data-theme="dark"] .judge-template-item code {
  background: #232328;
  color: #b9e5a8;
  padding: .1em .35em;
  border-radius: 4px;
}
html[data-theme="dark"] .judge-template-item details > summary { color: #a0a0a4; }
html[data-theme="dark"] .judge-template-item details > div {
  background: #141418 !important;
  border-color: #2d2d31 !important;
  color: #c6c6c9;
}

/* ── Modell-Finder: Kriterien-Gewichtung ── */
html[data-theme="dark"] .finder-weights { background: #151a13; border-color: var(--color-border); }
html[data-theme="dark"] .finder-weight-name { color: var(--color-text); }
html[data-theme="dark"] .finder-weight-desc { color: var(--color-text-secondary); }
html[data-theme="dark"] .finder-weight-val {
  background: #1d2a1c;
  color: #b9e5a8;
}

/* Finder: Mindest-Score-Toggle */
html[data-theme="dark"] #finder-min-score-off.active { background: #2e2818; color: #e6c477; }

/* Finder: Provider-Chips & GDPR-Toggle */
html[data-theme="dark"] .finder-tag-chip.active {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 2px rgba(156,215,140,.25);
}
html[data-theme="dark"] .finder-provider-chip.active { color: #0e0e10; }
html[data-theme="dark"] .finder-provider-chip.active .chip-gdpr { color: #0e0e10; }
html[data-theme="dark"] .finder-provider-chip .chip-gdpr { color: #7fd09a; }
html[data-theme="dark"] .finder-gdpr-toggle:has(input:checked) {
  background: #1d2a1c;
  border-color: #2d4a38;
  color: #b9e5a8;
}

/* Finder: AI-Erklärungsbox */
html[data-theme="dark"] .finder-ai-box { background: #151a13; border-color: var(--color-border); border-left-color: var(--color-primary); }

/* Finder: Konsistenz-Info */
html[data-theme="dark"] .consistency-info { background: #151a13; border-color: var(--color-border); border-left-color: var(--color-primary); }

/* Finder: Top-5-Karten */
html[data-theme="dark"] .finder-card { background: var(--color-surface); border-color: var(--color-border); }
html[data-theme="dark"] .finder-card-rankscore { background: #1d2a1c; color: #b9e5a8; }
html[data-theme="dark"] .finder-card-rankscore small { color: var(--color-text-secondary); }
html[data-theme="dark"] .finder-metric-label { color: var(--color-text); }
html[data-theme="dark"] .finder-metric-bar { background: #1f1f22; }
html[data-theme="dark"] .finder-metric-val { color: var(--color-text); }

/* Finder: Cluster-Belegkette */
html[data-theme="dark"] .finder-cluster { background: #151618; border-color: var(--color-border); }
html[data-theme="dark"] .finder-cluster > summary { color: var(--color-text); }
html[data-theme="dark"] .finder-cluster-list > li { border-bottom-color: var(--color-border-light); }
html[data-theme="dark"] .finder-cluster-sim { color: #b9e5a8; }
html[data-theme="dark"] .finder-cluster-label { color: var(--color-text); }
html[data-theme="dark"] .finder-cluster-preview { color: var(--color-text-secondary); }

/* Finder: Unerprobte Modelle */
html[data-theme="dark"] .finder-card-unproven { background: #1a1814; }
html[data-theme="dark"] .finder-card-unproven .finder-card-rank { color: #e6c477; }
html[data-theme="dark"] .finder-card-unproven .finder-card-rankscore strong { color: #e6c477; }
html[data-theme="dark"] .badge.badge-warn { background: #2e2818; color: #e6c477; border-color: #5c4a1f; }

/* Finder: Ticket-CTA */
html[data-theme="dark"] .finder-ticket-cta { background: #151618; border-color: var(--color-border); }
html[data-theme="dark"] .finder-ticket-cta-text { color: var(--color-text); }

/* Initial-Tests: Auswertungstabelle mit Modell-Header und Effort-Sub-Zeilen.
   Modell-Zeile wird leicht hervorgehoben, Sub-Zeile hängt eingerückt darunter. */
.initial-tests-table tr.initial-model-row > td {
  border-top: 2px solid var(--color-border);
  background: #fafafa;
}
.initial-tests-table tr.initial-model-row:first-child > td {
  border-top: none;
}
.initial-tests-table tr.initial-effort-row > td {
  font-size: .82rem;
  color: var(--color-text-secondary, #4b5563);
}
.initial-tests-table tr.initial-effort-row > td:nth-child(2) {
  font-variant-numeric: tabular-nums;
}
html[data-theme="dark"] .initial-tests-table tr.initial-model-row > td {
  background: rgba(255, 255, 255, .03);
}

/* Aufklappbare Effort-Stufen: standardmäßig eingeklappt; das Chevron auf der
   Modellzeile toggelt. `pagination-child` sorgt dafür, dass die Stufen NICHT
   als Pagination-Eintrag zählen (nur das Modell selbst). */
.initial-tests-table tr.initial-effort-row.pg-collapsed {
  display: none;
}
/* Gesamte Modellzeile ist klickbar (toggelt die Effort-Stufen), daher
   Zeiger-Cursor und ein dezenter Hover-Hintergrund als Affordanz. */
.initial-tests-table tr.initial-model-row.is-expandable {
  cursor: pointer;
}
.initial-tests-table tr.initial-model-row.is-expandable:hover > td {
  background: #f0f1f3;
}
html[data-theme="dark"] .initial-tests-table tr.initial-model-row.is-expandable:hover > td {
  background: rgba(255, 255, 255, .06);
}
.initial-expand-toggle {
  display: inline-block;
  cursor: pointer;
  color: var(--color-text-secondary, #6b7280);
  font-size: 1rem;
  margin-right: .25rem;
  line-height: 1;
  user-select: none;
  transition: transform .12s ease;
}
.initial-expand-toggle.is-open {
  transform: rotate(90deg);
}
.initial-expand-toggle:hover {
  color: var(--color-text, #111827);
}
.initial-expand-toggle:focus-visible {
  outline: 2px solid var(--color-primary, #2563eb);
  outline-offset: 1px;
  border-radius: 2px;
}

/* Initial-Tests Detail-Modal: Probe-Status-Header und Stufen-Aggregat-Chips.
   Klassen werden in app.js gesetzt, die Hintergrundfarbe muss sich zwischen
   Light- und Dark-Mode unterscheiden, weil --color-surface-subtle in unserem
   Theme nicht definiert ist und sonst auf #fafafa zurückfällt (=hell im
   Dark-Mode). Wir benutzen hier die gleiche Konvention wie .initial-model-row:
   im Light-Mode dezenter Grauton, im Dark-Mode minimal aufgehellt. */
.initial-detail-probe,
.initial-detail-chip {
  background: #fafafa;
  border: 1px solid var(--color-border);
}
.initial-detail-summary {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
}
/* Gesamtkosten-Karte über den Stufen-Chips im Init-Test-Detail. */
.initial-detail-cost-total {
  border: 1px solid var(--color-border, #e2e2e6);
  border-radius: 6px;
  padding: .6rem .8rem;
  margin-bottom: .75rem;
  background: var(--color-surface-alt, #f7f7f9);
}
.initial-detail-cost-head { font-size: .8rem; font-weight: 600; }
.initial-detail-cost-value {
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
  margin: .1rem 0;
}
.initial-detail-cost-split { font-size: .76rem; }
/* Kosten-Zeile im Init-Test-Panel (Kopfbereich). */
.initial-costs-row {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  flex-wrap: wrap;
}
.initial-costs-total { font-size: 1.3rem; font-weight: 600; }
.initial-costs-top { font-size: .78rem; margin-top: .3rem; }
.initial-costs-note { font-size: .74rem; margin-top: .25rem; }
/* Hinweis auf bezahlte Calls ohne verwertbare Antwort. */
.initial-costs-warn {
  font-size: .78rem;
  margin-top: .4rem;
  padding: .3rem .5rem;
  border-radius: 5px;
  background: #fdf3e3;
  color: #8a5300;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
html[data-theme="dark"] .initial-costs-warn {
  background: #3a2c14;
  color: #f0c98a;
}
/* Allgemeine Warn-Auszeichnung. Die spezifischere Regel innerhalb von
   .prov-models-table (rot) gewinnt dort weiterhin. */
.warn-text { color: #a05a00; }
html[data-theme="dark"] .warn-text { color: #f0c98a; }
/* Antwortlose Calls direkt am Modell (Liste der teuersten Modelle). */
.initial-costs-model-warn {
  color: #a05a00;
  font-weight: 600;
  white-space: nowrap;
}
html[data-theme="dark"] .initial-costs-model-warn { color: #f0c98a; }
/* Antwortlose Calls in der Gesamtkosten-Karte des Modell-Details. */
.initial-detail-cost-warn {
  margin-top: .4rem;
  padding-top: .35rem;
  border-top: 1px solid var(--color-border, #e2e2e6);
  font-size: .76rem;
  color: #a05a00;
  display: flex;
  align-items: center;
  gap: .3rem;
}
html[data-theme="dark"] .initial-detail-cost-warn {
  border-top-color: #2c2c30;
  color: #f0c98a;
}
.initial-costs-model { white-space: nowrap; }

/* Anbieter-Kostenansicht (Subtab „Kosten"). */
.prov-costs-summary { margin-bottom: .4rem; }
.prov-costs-total { font-size: 1.6rem; font-weight: 600; line-height: 1.15; }
.prov-costs-sources { font-size: .8rem; margin-bottom: .2rem; }

/* „bewertet von <Modell>" unter der Judge-Begründung in der Run-Detailtabelle. */
.run-judge-by {
  margin-top: .25rem;
  font-size: .72rem;
  opacity: .75;
}
html[data-theme="dark"] .initial-detail-cost-total {
  background: #1d1d20;
  border-color: #2c2c30;
}
.initial-detail-chip {
  border-radius: 6px;
  padding: .5rem .7rem;
  min-width: 200px;
  flex: 1;
  max-width: 280px;
}
.initial-detail-probe {
  border-radius: 6px;
  padding: .6rem .8rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: space-between;
}
html[data-theme="dark"] .initial-detail-probe,
html[data-theme="dark"] .initial-detail-chip {
  background: rgba(255, 255, 255, .04);
  border-color: var(--color-border);
}

/* Probe-Historie: aufklappbares Fehler-Detail (HTTP/Typ/volle Meldung). */
.probe-err > summary {
  cursor: pointer;
  font-size: .82rem;
}
.probe-err .probe-err-detail {
  margin-top: .35rem;
}
.probe-err .probe-err-label {
  font-size: .72rem;
  font-weight: 600;
  opacity: .7;
  margin: .3rem 0 .15rem;
}
.probe-err .probe-err-pre {
  margin: 0;
  padding: .4rem .5rem;
  background: #f6f6f6;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  font-size: .76rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 14rem;
  overflow: auto;
}
html[data-theme="dark"] .probe-err .probe-err-pre {
  background: rgba(255, 255, 255, .05);
}
/* Judge-Notes-Spoiler: kleiner Inline-Info-Block in der Detail-Tabelle.
   Erklärt warum ein "completed"-Run trotzdem keinen Score hat (Judge
   konnte nicht bewerten, Output leer, Provider weg, ...). */
.initial-detail-judge-note {
  font-size: .72rem;
  color: var(--color-text-secondary, #6b7280);
  margin-top: .15rem;
  display: block;
  max-width: 380px;
  white-space: normal;
}
html[data-theme="dark"] .initial-detail-judge-note {
  color: #9ca3af;
}

/* Fehler-Diagnose-Block in der Aggregat-Karte. Zeigt die häufigste
   Fehlermeldung direkt unterhalb der Token-/Latenz-Stats. So sieht der
   User in der Init-Test-Detailansicht sofort, warum eine Stufe (z.B.
   ``high``) bei diesem Modell fehlschlägt — ohne in den Server-Logs
   suchen zu müssen. Voller Text bleibt im title-Attribut. */
.initial-detail-error {
  font-size: .72rem;
  color: #b91c1c;
  margin-top: .35rem;
  line-height: 1.3;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  border-top: 1px dashed rgba(185, 28, 28, .25);
  padding-top: .25rem;
}
.initial-detail-error i.mnh-icon {
  color: #b91c1c;
  margin-right: .15rem;
}
html[data-theme="dark"] .initial-detail-error {
  color: #fca5a5;
  border-top-color: rgba(252, 165, 165, .25);
}
html[data-theme="dark"] .initial-detail-error i.mnh-icon {
  color: #fca5a5;
}

/* Initial-Tests: kompakte Ergebnis-Matrix.
   Nutzt .table .table-compact für Headerkonsistenz, eigene Pill-Styles
   erhalten die Farbkodierung pro Score. */
.initial-matrix-wrap { overflow-x: auto; }
.initial-matrix th:nth-child(n+2),
.initial-matrix td:nth-child(n+2) { text-align: center; }
.initial-matrix th:nth-child(2) { width: 60px; }
.initial-matrix th:nth-child(n+3) { width: 70px; font-size: .78rem; }
.matrix-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 22px; padding: 0 .45rem;
  border-radius: 999px; font-variant-numeric: tabular-nums;
  font-size: .75rem; font-weight: 600;
  background: #f1f3f5; color: #374151;
}
.matrix-pill.is-ok    { background: #dcfce7; color: #166534; }
.matrix-pill.is-warn  { background: #fef3c7; color: #92400e; }
.matrix-pill.is-bad   { background: #fee2e2; color: #991b1b; }
.matrix-pill.is-running { background: #e0e7ff; color: #3730a3; }
.matrix-pill.is-empty { background: transparent; color: var(--color-muted, #9ca3af); font-weight: 400; min-width: 20px; }
.matrix-pill .mnh-icon { width: 14px; height: 14px; }

html[data-theme="dark"] .matrix-pill { background: #1f2124; color: #d4d4d8; }
html[data-theme="dark"] .matrix-pill.is-ok    { background: rgba(34,197,94,.18);  color: #86efac; }
html[data-theme="dark"] .matrix-pill.is-warn  { background: rgba(234,179,8,.18);  color: #fde68a; }
html[data-theme="dark"] .matrix-pill.is-bad   { background: rgba(239,68,68,.18);  color: #fca5a5; }
html[data-theme="dark"] .matrix-pill.is-running { background: rgba(129,140,248,.18); color: #c7d2fe; }
html[data-theme="dark"] .matrix-pill.is-empty { background: transparent; color: #6b7280; }

/* Modality-Badges im Non-Chat-Subtab der Initial-Tests. Farbcodiert pro
   Modell-Typ, damit lange Listen leichter scannbar sind. */
.initial-nonchat-group + .initial-nonchat-group { margin-top: 1rem; }
.initial-nonchat-group-title {
  display: flex; align-items: center; gap: .5rem;
  margin: .4rem 0 .25rem 0; font-size: .85rem; font-weight: 600;
}
.modality-badge { font-weight: 600; margin-left: .35rem; vertical-align: middle; }
.modality-badge.modality-text           { background: #e0e7ff; color: #3730a3; }
.modality-badge.modality-vision         { background: #ddd6fe; color: #5b21b6; }
.modality-badge.modality-multimodal     { background: #fae8ff; color: #86198f; }
.modality-badge.modality-image_gen      { background: #fce7f3; color: #9d174d; }
.modality-badge.modality-audio_tts      { background: #fed7aa; color: #9a3412; }
.modality-badge.modality-audio_stt      { background: #fef3c7; color: #92400e; }
.modality-badge.modality-realtime_audio { background: #fecaca; color: #7f1d1d; }
.modality-badge.modality-video_gen      { background: #ccfbf1; color: #115e59; }
.modality-badge.modality-embedding      { background: #dbeafe; color: #1e40af; }
.modality-badge.modality-rerank         { background: #cffafe; color: #155e75; }
.modality-badge.modality-moderation     { background: #dcfce7; color: #166534; }
.modality-badge.modality-other          { background: #e5e7eb; color: #374151; }

html[data-theme="dark"] .modality-badge.modality-text           { background: rgba(99,102,241,.2);  color: #c7d2fe; }
html[data-theme="dark"] .modality-badge.modality-vision         { background: rgba(139,92,246,.2);  color: #ddd6fe; }
html[data-theme="dark"] .modality-badge.modality-multimodal     { background: rgba(217,70,239,.2);  color: #f5d0fe; }
html[data-theme="dark"] .modality-badge.modality-image_gen      { background: rgba(236,72,153,.2);  color: #fbcfe8; }
html[data-theme="dark"] .modality-badge.modality-audio_tts      { background: rgba(249,115,22,.22); color: #fed7aa; }
html[data-theme="dark"] .modality-badge.modality-audio_stt      { background: rgba(234,179,8,.2);   color: #fde68a; }
html[data-theme="dark"] .modality-badge.modality-realtime_audio { background: rgba(239,68,68,.2);   color: #fecaca; }
html[data-theme="dark"] .modality-badge.modality-video_gen      { background: rgba(20,184,166,.2);  color: #99f6e4; }
html[data-theme="dark"] .modality-badge.modality-embedding      { background: rgba(59,130,246,.2);  color: #bfdbfe; }
html[data-theme="dark"] .modality-badge.modality-rerank         { background: rgba(6,182,212,.2);   color: #a5f3fc; }
html[data-theme="dark"] .modality-badge.modality-moderation     { background: rgba(34,197,94,.2);   color: #bbf7d0; }
html[data-theme="dark"] .modality-badge.modality-other          { background: #2d2f33;               color: #d4d4d8; }

/* ── Effort-Stufen-Pillen in der Modell-Liste ──
   Zeigt direkt hinter dem Reasoning-Badge die konkret unterstützten
   Effort-Stufen (low/medium/high/max/xhigh/minimal/think). Verifizierte
   Stufen (aus Provider-API oder Probe) bekommen einen subtilen
   Akzentrahmen + Häkchen; rein heuristische Stufen bleiben dezent. */
.effort-cap-pills {
  display: inline-flex; flex-wrap: wrap; gap: .25rem;
  margin-left: .25rem; vertical-align: middle;
}
.effort-pill {
  display: inline-flex; align-items: center; gap: .15rem;
  padding: .05rem .4rem;
  border-radius: 999px;
  font-size: .72rem; line-height: 1.4;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.effort-pill--verified {
  background: rgba(34, 197, 94, .12);
  color: #15803d;
  border-color: rgba(34, 197, 94, .3);
}
.effort-pill--unverified {
  background: rgba(148, 163, 184, .12);
  color: #475569;
  border-color: rgba(148, 163, 184, .25);
}
.effort-pill-check {
  font-size: .7em; opacity: .85;
}
/* Geprobt, aber NICHT bestätigt -> Stufe existiert für dieses Modell nicht
   (klar von „grau/unbekannt" = noch nicht geprobt unterschieden). */
.effort-pill--unavailable {
  background: rgba(239, 68, 68, .10);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, .28);
  text-decoration: line-through;
  opacity: .85;
}
html[data-theme="dark"] .effort-pill--unavailable {
  background: rgba(239, 68, 68, .16);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, .3);
}
.effort-cap-summary {
  font-size: .72rem; margin-left: .25rem;
  vertical-align: middle;
}
html[data-theme="dark"] .effort-pill--verified {
  background: rgba(34, 197, 94, .18);
  color: #86efac;
  border-color: rgba(34, 197, 94, .35);
}
html[data-theme="dark"] .effort-pill--unverified {
  background: rgba(148, 163, 184, .18);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, .25);
}

/* ── API-Doku-Panel ── */
.docs-callout {
  margin: 0 0 1rem;
  padding: .65rem .85rem;
  border-radius: 8px;
  background: #fff8e1;
  border-left: 4px solid #f1c40f;
  color: #5a4500;
  font-size: .9rem;
  line-height: 1.5;
}
.docs-callout code {
  background: rgba(0,0,0,.08);
  color: inherit;
  padding: .05em .3em;
  border-radius: 3px;
}
html[data-theme="dark"] .docs-callout {
  background: rgba(241,196,15,.08);
  border-left-color: #d4a017;
  color: #f1d488;
}
html[data-theme="dark"] .docs-callout code {
  background: rgba(255,255,255,.08);
  color: #f1d488;
}
.docs-pane h3 {
  margin: 0 0 .5rem;
  font-size: .98rem;
}
.docs-list {
  margin: .25rem 0 0 1.1rem;
  padding: 0;
  font-size: .9rem;
  line-height: 1.55;
}
.docs-list li + li { margin-top: .25rem; }
.docs-code {
  display: block;
  margin: 0;
  padding: .75rem .9rem;
  background: #f5f7fa;
  border: 1px solid var(--color-border-light, #e5e5e5);
  border-radius: 8px;
  overflow-x: auto;
  font-family: 'SF Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .82rem;
  line-height: 1.5;
  white-space: pre;
  color: #1f2937;
}
.docs-code code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-family: inherit;
}
#panel-docs code {
  background: #eef1f5;
  color: #1f2937;
  padding: .08em .35em;
  border-radius: 4px;
  font-family: 'SF Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .82em;
}
#panel-docs .docs-code code { background: transparent; padding: 0; border-radius: 0; }
#panel-docs .data-table th,
#panel-docs .data-table td { vertical-align: top; }

html[data-theme="dark"] .docs-code {
  background: #111114;
  border-color: #2d2d31;
  color: #d4d8dc;
}
html[data-theme="dark"] #panel-docs code {
  background: #232328;
  color: #b9e5a8;
}
html[data-theme="dark"] #panel-docs .docs-code code { background: transparent; color: #d4d8dc; }

/* ── Playground (interaktiver Doku-Tester) ── */
.pg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-top: .75rem;
  align-items: start;
}
@media (max-width: 900px) {
  .pg-grid { grid-template-columns: 1fr; }
}
.pg-field { margin-bottom: .7rem; }
.pg-label { display: block; font-weight: 600; font-size: .82rem; margin-bottom: .25rem; }
.pg-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.pg-row .pg-field { flex: 1 1 8rem; min-width: 7rem; }
.pg-modes { display: flex; flex-direction: column; gap: .25rem; font-size: .88rem; }
.pg-modes label { font-weight: 400; cursor: pointer; }
.pg-request select,
.pg-request input[type="text"],
.pg-request input[type="number"],
.pg-request textarea {
  width: 100%;
  box-sizing: border-box;
  padding: .45rem .55rem;
  border: 1px solid var(--color-border-light, #e5e5e5);
  border-radius: 6px;
  font-size: .88rem;
  font-family: inherit;
  background: #fff;
  color: #1f2937;
}
.pg-request textarea { resize: vertical; font-family: 'SF Mono', ui-monospace, Menlo, Consolas, monospace; }
.pg-actions { display: flex; align-items: center; gap: .6rem; margin-top: .25rem; }
.pg-actions .btn-primary[disabled] { opacity: .6; cursor: default; }

.pg-budget { font-size: .85rem; }
.pg-budget-bar {
  display: block;
  height: 8px;
  border-radius: 5px;
  background: var(--color-border-light, #e5e5e5);
  overflow: hidden;
  margin: .35rem 0;
}
.pg-budget-bar > span { display: block; height: 100%; background: #3b82f6; border-radius: 5px; }
.pg-budget-bar.is-warn > span { background: #f59e0b; }
.pg-budget-bar.is-full > span { background: #ef4444; }

.pg-meta { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .6rem; }
.pg-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .5rem;
  border-radius: 999px;
  background: #eef1f5;
  color: #1f2937;
  font-size: .78rem;
}
.pg-chip.is-ok { background: #dcfce7; color: #166534; }
.pg-chip.is-err { background: #fee2e2; color: #991b1b; }
.pg-view-toggle { display: flex; gap: .4rem; margin-bottom: .5rem; }
#pg-content, #pg-raw { white-space: pre-wrap; word-break: break-word; max-height: 460px; overflow: auto; }

html[data-theme="dark"] .pg-request select,
html[data-theme="dark"] .pg-request input[type="text"],
html[data-theme="dark"] .pg-request input[type="number"],
html[data-theme="dark"] .pg-request textarea {
  background: #16161a;
  border-color: #2d2d31;
  color: #d4d8dc;
}
html[data-theme="dark"] .pg-budget-bar { background: #2d2d31; }
html[data-theme="dark"] .pg-chip { background: #232328; color: #d4d8dc; }
html[data-theme="dark"] .pg-chip.is-ok { background: #14331f; color: #86efac; }
html[data-theme="dark"] .pg-chip.is-err { background: #3a1717; color: #fca5a5; }

/* Payload-/Antwort-Vorschau im Request-Payload-Modal (Projekt-Auswertung):
   gleiche Optik wie .docs-code, aber mit pre-wrap, damit lange JSON-Strings
   umbrechen, und mit eigener max-height + scroll-Bereich. Light- und
   Dark-Mode-Varianten ziehen die Farben aus den Theme-Variablen, damit der
   Block in beiden Modi lesbar bleibt. */
.payload-preview {
  margin: 0;
  padding: .6rem .75rem;
  background: #f5f7fa;
  border: 1px solid var(--color-border-light, #e5e5e5);
  border-radius: 6px;
  max-height: 320px;
  overflow: auto;
  font-family: 'SF Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: #1f2937;
}
html[data-theme="dark"] .payload-preview {
  background: #111114;
  border-color: #2d2d31;
  color: #d4d8dc;
}

/* Dark-Mode-Toggle-Button in der Sidebar: Icon je nach Theme */
.side-link.theme-toggle .side-icon .mnh-icon-sun { display: none; }
.side-link.theme-toggle .side-icon .mnh-icon-moon-02 { display: inline-block; }
html[data-theme="dark"] .side-link.theme-toggle .side-icon .mnh-icon-sun { display: inline-block; }
html[data-theme="dark"] .side-link.theme-toggle .side-icon .mnh-icon-moon-02 { display: none; }

/* Projekt-Aufgaben (project_tasks): Chips, Editor, Code-Snippet. Verwendet
   die existierenden Theme-Variablen, damit Dark-Mode automatisch passt
   (Hintergrundfarbe + Text-Kontrast werden vererbt). */
.chip {
  display: inline-block;
  padding: .12em .55em;
  margin: 1px 2px;
  border-radius: 999px;
  background: var(--color-primary-light, #e6f0ff);
  color: var(--color-primary-dark, #2a4a80);
  font-size: .78em;
  font-family: 'SF Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  border: 1px solid transparent;
}
html[data-theme="dark"] .chip {
  background: #1f2532;
  color: #b3d4fc;
}

.code-block {
  display: block;
  padding: .75rem .9rem;
  background: #f5f7fa;
  border: 1px solid var(--color-border-light, #e5e5e5);
  border-radius: 8px;
  font-family: 'SF Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .82rem;
  line-height: 1.5;
  color: #1f2937;
}
html[data-theme="dark"] .code-block {
  background: #111114;
  border-color: #2d2d31;
  color: #d4d8dc;
}

/* ── Code-Tabs (Sprachumschalter für Beispiele) ── */
.code-tabs {
  display: block;
  margin: 0;
}
.code-tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem;
  margin: 0 0 -1px;
  padding: 0 .15rem;
  align-items: flex-end;
}
.code-tabs-nav .code-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-text-secondary);
  font: inherit;
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.2;
  padding: .3rem .7rem;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.code-tabs-nav .code-tab:hover {
  color: var(--color-primary-dark);
  background: rgba(156, 215, 140, .12);
}
.code-tabs-nav .code-tab.active {
  background: #f5f7fa;
  color: var(--color-primary-dark);
  border-color: var(--color-border-light, #e5e5e5);
  border-bottom-color: #f5f7fa;
  font-weight: 600;
}
.code-tabs .code-tab-pane {
  margin: 0;
}
.code-tabs .code-tab-pane.docs-code,
.code-tabs .code-tab-pane.code-block {
  border-top-left-radius: 0;
}
.code-tabs .code-tab-pane[hidden] {
  display: none !important;
}

html[data-theme="dark"] .code-tabs-nav .code-tab {
  color: #aab1b9;
}
html[data-theme="dark"] .code-tabs-nav .code-tab:hover {
  color: #c8eebd;
  background: rgba(156, 215, 140, .08);
}
html[data-theme="dark"] .code-tabs-nav .code-tab.active {
  background: #111114;
  color: #c8eebd;
  border-color: #2d2d31;
  border-bottom-color: #111114;
}

/* ── Initial-Test-Aufgabenliste ────────────────────────────────────────────
   Karten-Look für die Aufgaben-Liste im Panel „Initial-Tests für neue
   Modelle". Vorher: schmuckloser Inline-Link mit Borderline; jetzt klickbare
   Tiles mit Icon, Titel, Beschreibung und Hover-State. */
.initial-tasks-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .55rem;
}
.initial-task-item { margin: 0; }
.initial-task-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .65rem .8rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition),
              transform var(--transition), background var(--transition);
}
.initial-task-link:hover,
.initial-task-link:focus-visible {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  outline: none;
}
.initial-task-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-size: 1.05rem;
}
.initial-task-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.initial-task-title {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}
.initial-task-name {
  font-weight: 600;
  font-size: .92rem;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.initial-task-desc {
  font-size: .8rem;
  color: var(--color-text-secondary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.initial-task-arrow {
  flex: 0 0 auto;
  color: var(--color-text-secondary);
  opacity: .55;
  transition: transform var(--transition), opacity var(--transition), color var(--transition);
}
.initial-task-link:hover .initial-task-arrow,
.initial-task-link:focus-visible .initial-task-arrow {
  opacity: 1;
  color: var(--color-primary-dark);
  transform: translateX(2px);
}
.initial-task-item.is-inactive .initial-task-link { opacity: .72; }
.initial-task-item.is-inactive .initial-task-icon {
  background: #f1efe9;
  color: #8b7a4b;
}

html[data-theme="dark"] .initial-task-link {
  background: #1a1a1d;
  border-color: #2d2d31;
  color: #e6e6e8;
  box-shadow: none;
}
html[data-theme="dark"] .initial-task-link:hover,
html[data-theme="dark"] .initial-task-link:focus-visible {
  background: rgba(156, 215, 140, .08);
  border-color: #4a6b3c;
}
html[data-theme="dark"] .initial-task-icon {
  background: rgba(156, 215, 140, .12);
  color: #c8eebd;
}
html[data-theme="dark"] .initial-task-name { color: #e6e6e8; }
html[data-theme="dark"] .initial-task-desc { color: #aab1b9; }


/* ───────────────────────────────────────────────────────────
   Logs-Panel (Sidebar „Logs", admin-only)
   Subtabs erben das Aussehen von nav.subtabs.
   ─────────────────────────────────────────────────────────── */
.logs-toolbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 0 0 .6rem;
  flex-wrap: wrap;
}
.logs-toolbar .input-sm { max-width: 280px; }
.input-sm {
  padding: .25rem .5rem;
  font-size: .85rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg);
  color: var(--color-text);
}

.logs-list {
  max-height: 70vh;
  overflow: auto;
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  background: var(--color-bg);
}
.logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.logs-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--color-bg-secondary, #f6f7f5);
  border-bottom: 1px solid var(--color-border-light);
  padding: .5rem .65rem;
  text-align: left;
  font-weight: 600;
  font-size: .78rem;
  color: var(--color-text-secondary);
}
.logs-table tbody td {
  padding: .4rem .65rem;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: top;
  word-break: break-word;
}
.logs-row.logs-level-error  { background: rgba(214, 76, 76, .06); }
.logs-row.logs-level-warn   { background: rgba(232, 168, 0, .06); }
.logs-row:hover             { background: rgba(0, 0, 0, .03); }

.logs-ts { white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; color: var(--color-text-secondary); }
.logs-msg { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }
.logs-tag { color: var(--color-text-secondary); margin-right: .35rem; }

.logs-level-pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.logs-level-pill-info  { background: rgba(60, 132, 246, .12); color: #2456a8; border-color: rgba(60,132,246,.25); }
.logs-level-pill-warn  { background: rgba(232, 168, 0, .15); color: #8a6300; border-color: rgba(232,168,0,.35); }
.logs-level-pill-error { background: rgba(214, 76, 76, .15); color: #a02828; border-color: rgba(214,76,76,.35); }
.logs-level-pill-debug { background: rgba(120, 120, 120, .12); color: #555; border-color: rgba(120,120,120,.25); }

.logs-source-pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: .72rem;
  background: rgba(156, 215, 140, .15);
  color: var(--color-primary-dark);
  border: 1px solid rgba(156, 215, 140, .35);
}

html[data-theme="dark"] .logs-list {
  background: #18181b;
  border-color: #2d2d31;
}
html[data-theme="dark"] .logs-table thead th {
  background: #1f1f23;
  border-bottom-color: #2d2d31;
  color: #aab1b9;
}
html[data-theme="dark"] .logs-table tbody td { border-bottom-color: #2a2a2e; }
html[data-theme="dark"] .logs-row.logs-level-error { background: rgba(214, 76, 76, .12); }
html[data-theme="dark"] .logs-row.logs-level-warn  { background: rgba(232, 168, 0, .10); }
html[data-theme="dark"] .logs-row:hover            { background: rgba(255, 255, 255, .04); }
html[data-theme="dark"] .input-sm {
  background: #1f1f23;
  border-color: #2d2d31;
  color: #e6e6e8;
}

/* Einheitlicher Tastaturfokus, auch bei Komponenten mit eigenen Focus-Regeln. */
button:focus-visible,
a:focus-visible,
summary:focus-visible,
[role="tab"]:focus-visible,
[role="button"]:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 2px solid var(--color-primary-dark) !important;
  outline-offset: 2px;
}
