/* Nexus Portal — globale Komponenten-Styles.
   Gilt projektweit für alle Views (nicht nur Setup) — baut auf den Design-Tokens
   aus layout.css auf. Enthält: Buttons, Karten, Formularelemente inkl. Checkbox,
   Icon-Buttons, Tabellen, Badges, Modals, Drag&Drop-Chips, Diagnose-Kacheln, Stepper. */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---------- Reset & Basiswerte ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg-darkest);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
h1, h2, h3, .stepper__label {
  font-family: 'Rajdhani', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0;
}
code, .mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

a { color: var(--brand-orange-bright); }

/* ---------- Shell ---------- */
/* 3-Spalten-Grid statt Flex: garantiert echte Zentrierung der Hauptnav, unabhängig davon,
   wie breit die linke (Logo+Titel) und rechte (User-Bereich) Zone gerade sind. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--navbar-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--content-padding-x);
  background: var(--bg-base);
  border-bottom: 1px solid var(--border-muted);
}
.topbar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  justify-self: start;
}
.topbar__logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}
.topbar__title {
  font-size: 18px;
  color: var(--text-primary);
}
.topbar__nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  justify-self: center;
}
.topbar__nav-item { position: relative; }
.topbar__nav-link {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 6px 4px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.topbar__nav-link:hover { color: var(--text-primary); }
.topbar__nav-link.is-active { color: var(--text-primary); border-bottom-color: var(--brand-orange-main); }

/* Dropdown-Untermenü (Popup bei Hover, siehe navbar.js für die Klick-Alternative) */
.topbar__submenu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  min-width: 200px;
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
  z-index: 30;
}
.topbar__nav-item--has-submenu.is-open .topbar__submenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.topbar__submenu-link {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
}
.topbar__submenu-link:hover { background: var(--bg-surface-hover); color: var(--text-primary); }
.topbar__submenu-link.is-active { color: var(--brand-orange-bright); }

.topbar__user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  justify-self: end;
}
.topbar__username {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .topbar { grid-template-columns: auto 1fr auto; }
  .topbar__title { display: none; } /* Platz sparen, Logo bleibt als Wiedererkennung */
  .topbar__nav { gap: var(--space-sm); }
  .topbar__nav-link { font-size: 13px; }
  .topbar__username { display: none; }
}

.page {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--content-padding-y) var(--content-padding-x) 80px;
}

.page__intro { margin-bottom: var(--space-xl); }
.page__intro h1 { font-size: 28px; color: var(--text-primary); }
.page__intro p {
  margin: var(--space-sm) 0 0;
  color: var(--text-secondary);
  max-width: 640px;
}

/* ---------- Stepper (echte Sequenz: Schritt 1/2 aus agent.md 1.2) ---------- */
.stepper {
  display: flex;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-muted);
}
.stepper__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-muted);
}
.stepper__item.is-active { color: var(--text-primary); }
.stepper__item.is-done { color: var(--brand-orange-bright); }
.stepper__index {
  width: 24px; height: 24px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-accent);
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  flex-shrink: 0;
}
.stepper__item.is-active .stepper__index { border-color: var(--brand-orange-main); background: rgba(255,107,0,0.12); }
.stepper__item.is-done .stepper__index { border-color: var(--brand-orange-bright); background: var(--brand-orange-dark); color: var(--text-primary); }
.stepper__label { font-size: 14px; font-weight: 600; }

/* ---------- Card ---------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}
.card__header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--space-md); gap: var(--space-md); flex-wrap: wrap; }
.card__header h2 { font-size: 18px; }
.card__hint { color: var(--text-muted); font-size: 13px; margin: var(--space-xs) 0 0; }

/* ---------- Formularelemente ---------- */
.field { margin-bottom: var(--space-md); }
.field:last-child { margin-bottom: 0; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}
.field input, .field select {
  width: 100%;
  height: 40px;
  background: var(--bg-base);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
}
.field input:focus, .field select:focus {
  outline: 2px solid var(--brand-orange-main);
  outline-offset: 1px;
  border-color: var(--brand-orange-main);
}
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-md); }
.field-row--checkboxes { margin-top: var(--space-md); }

/* ---------- Checkbox (Pillen-Form: eckige Checkbox links + Textfläche rechts) ---------- */
/* .field .checkbox-field statt nur .checkbox-field: ".field label" oben (Klasse+Element) ist
   spezifischer als eine einzelne Klasse und würde sonst display/margin/Farbe überschreiben —
   das war der Bug im Screenshot (Checkbox brach aus dem Pillen-Layout aus). */
.field .checkbox-field {
  display: flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
  height: 40px;
  background: var(--bg-base);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  transition: border-color 0.15s ease;
}
.checkbox-field:hover {
  border-color: var(--border-accent);
}
.checkbox-field:focus-within {
  outline: 2px solid var(--brand-orange-bright);
  outline-offset: 1px;
}

.checkbox-field input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 0;
  position: relative;
  flex-shrink: 0;
  border-radius: 5px;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-accent);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.checkbox-field input[type="checkbox"]::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 5px;
  height: 9px;
  border: solid var(--text-primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
}
.checkbox-field input[type="checkbox"]:checked {
  background: var(--brand-orange-main);
  border-color: var(--brand-orange-main);
}
.checkbox-field input[type="checkbox"]:checked::after {
  border-color: #17110A;
  opacity: 1;
}

.checkbox-field__label {
  flex: 1;
  display: flex;
  align-items: center;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0 14px 0 10px;
  min-height: 26px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:focus-visible { outline: 2px solid var(--brand-orange-bright); outline-offset: 2px; }
.btn--primary { background: var(--brand-orange-main); color: #17110A; }
.btn--primary:hover { background: var(--brand-orange-bright); }
.btn--ghost { background: transparent; border-color: var(--border-accent); color: var(--text-primary); }
.btn--ghost:hover { background: var(--bg-surface-hover); }
.btn--sm { min-height: 30px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Tabelle (klassisches HTML <table>, bleibt als Ausnahme auf der Setup-Seite stehen) ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--text-muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 10px; border-bottom: 1px solid var(--border-muted); }
td { padding: 12px 10px; border-bottom: 1px solid var(--border-muted); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.id-value { color: var(--text-secondary); }

/* ---------- Data-Grid (div-basierte "Tabelle" für alle künftigen Views, CSS Grid statt <table>) ----------
   Nutzung:
   <div class="data-grid" style="--columns: minmax(0, 2fr) minmax(0, 1.5fr) minmax(0, 2fr) 148px;">
     <div class="data-grid__row data-grid__row--header">
       <div class="data-grid__cell">Spalte 1</div> ...
     </div>
     <div class="data-grid__row data-grid__row--body">
       <div class="data-grid__cell">Wert 1</div> ...
     </div>
   </div>

   WICHTIG — fr-Werte IMMER in minmax(0, …) einpacken, niemals nackt (z.B. "2fr" statt "minmax(0, 2fr)"):
   Jede .data-grid__row ist ein eigenständiges Grid. Ein nackter fr-Wert hat eine implizite,
   INHALTSABHÄNGIGE Mindestbreite — unterschiedlich langer Text in Header vs. Body-Zeilen lässt
   dieselbe Spalte dann in jeder Zeile leicht anders breit werden, Spalten laufen sichtbar
   auseinander. minmax(0, Xfr) erzwingt rein proportionale Breiten unabhängig vom Zeileninhalt.
   Für die Aktions-Spalte (Icon-Buttons) einen festen Pixel-Wert statt "auto" verwenden — "auto" hat
   dasselbe Problem, und die Spalte soll ohnehin für alle Zeilen gleich breit sein.

   --columns wird einmal auf .data-grid gesetzt und vererbt sich an alle Zeilen (Custom Properties
   werden standardmäßig vererbt) — so bleiben Header- und Body-Zeilen garantiert spaltengleich,
   ohne die Breiten mehrfach pflegen zu müssen. Browser-Unterstützung: CSS Grid + Custom Properties
   sind seit Jahren in allen evergreen Browsern Standard. */
.data-grid {
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow-x: auto;
}
.data-grid__row {
  display: grid;
  grid-template-columns: var(--columns, 1fr);
  align-items: center;
  gap: var(--space-sm);
  min-width: fit-content;
}
.data-grid__row--header {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-muted);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.data-grid__row--body {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border-muted);
  font-size: 14px;
}
.data-grid__row--body:last-child { border-bottom: none; }
.data-grid__row--body:hover { background: var(--bg-surface-hover); }
.data-grid__cell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-grid__cell--wrap { white-space: normal; }
.data-grid__cell--actions { display: flex; justify-content: flex-end; gap: 4px; overflow: visible; }
.data-grid__cell--full { grid-column: 1 / -1; white-space: normal; }

/* Kleines, rundes Charakter-Portrait (z.B. Charakterverwaltung-Übersicht) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}
.badge--raidlead { background: rgba(255,107,0,0.14); color: var(--brand-orange-bright); }
.badge--player { background: rgba(156,163,175,0.14); color: var(--text-secondary); }

/* ---------- Icon-Buttons ---------- */
.icon-btn-group { display: flex; gap: 4px; }
.icon-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--bg-surface-hover); border-color: var(--border-accent); color: var(--text-primary); }
.icon-btn:focus-visible { outline: 2px solid var(--brand-orange-bright); outline-offset: 1px; }
.icon-btn--danger:hover { color: #EF5A5A; border-color: rgba(239,90,90,0.4); background: rgba(239,90,90,0.08); }
.icon-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.icon-btn:disabled:hover { background: transparent; border-color: transparent; color: var(--text-secondary); }

/* ---------- Kanal-Tags (Zusammenfassung in der Gilden-Tabelle) ---------- */
.channel-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.channel-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  background: var(--bg-base);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  color: var(--text-secondary);
}
.channel-tag--announcement { border-color: var(--brand-orange-dark); color: var(--brand-orange-bright); }
.channel-tag--empty { opacity: 0.5; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(11,14,17,0.72);
  display: flex; align-items: center; justify-content: center;
  padding: var(--content-padding-y) var(--content-padding-x);
  z-index: 100;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: var(--content-max-width);
  max-height: min(80vh, 720px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-muted);
  flex-shrink: 0;
}
.modal__header h2 { font-size: 18px; }
.modal__body { padding: var(--space-lg); overflow-y: auto; }
.modal__footer {
  display: flex; justify-content: flex-end; gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-muted);
  flex-shrink: 0;
}

/* ---------- Drag & Drop (geteilt von Rollen- UND Kanäle-Modal) ---------- */
.dnd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); margin-top: var(--space-md); }
.dnd-grid--4 { grid-template-columns: repeat(4, 1fr); }
.dnd-column {
  background: var(--bg-base);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  min-height: 160px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.dnd-column.is-drop-target { border-color: var(--brand-orange-main); background: rgba(244,157,26,0.06); }
.dnd-column__title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); padding: 4px 6px 10px; display: flex; align-items: center; gap: 6px; }
.dnd-column__limit { font-size: 10px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-muted); background: var(--bg-surface); border-radius: var(--radius-pill); padding: 1px 6px; }
.dnd-column--accent .dnd-column__title { color: var(--brand-orange-bright); }
.chip-list { display: flex; flex-direction: column; gap: 6px; min-height: 40px; }

.chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 7px 8px 7px 12px;
  cursor: grab;
  font-size: 13px;
  font-weight: 500;
}
.chip:active { cursor: grabbing; }
.chip.is-dragging { opacity: 0.4; }
.chip__actions { display: flex; gap: 2px; flex-shrink: 0; }
.chip__btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  width: 22px; height: 22px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
}
.chip__btn:hover { background: var(--bg-surface-hover); color: var(--text-primary); }
.chip__btn:focus-visible { outline: 2px solid var(--brand-orange-bright); outline-offset: 1px; }

@media (max-width: 720px) {
  .dnd-grid, .dnd-grid--4 { grid-template-columns: 1fr; }
}

/* ---------- Verbindungsdiagnose (Signatur-Element) ---------- */
.diagnostics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-md); }
.diagnostic {
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  background: var(--bg-base);
  position: relative;
  overflow: hidden;
}
.diagnostic__title { font-size: 14px; font-weight: 600; margin-bottom: var(--space-sm); display: flex; align-items: center; gap: 8px; }
.diagnostic__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
.diagnostic.is-ok .diagnostic__dot { background: #3FCF8E; box-shadow: 0 0 8px rgba(63,207,142,0.6); }
.diagnostic.is-error .diagnostic__dot { background: #EF5A5A; box-shadow: 0 0 8px rgba(239,90,90,0.6); }
.diagnostic.is-scanning::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(244,157,26,0.22), transparent);
  animation: scan 1.1s linear infinite;
}
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.diagnostic__result { font-size: 13px; color: var(--text-secondary); min-height: 18px; }
.diagnostic__glow-btn.is-scanning { box-shadow: var(--shadow-portal-glow); }

@media (prefers-reduced-motion: reduce) {
  .diagnostic.is-scanning::before { animation: none; }
}

/* ---------- Setup-Actions ---------- */
.setup-actions { display: flex; justify-content: flex-end; gap: var(--space-md); margin-top: var(--space-xl); }

@media (max-width: 640px) {
  .page { padding: var(--space-lg) var(--space-md) 60px; }
  .card__header { flex-direction: column; }
}

/* ---------- Character-Hub (Charakterverwaltung-Übersicht, agent.md 2.2.1) ---------- */
.character-hub {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-md) var(--content-padding-x) 80px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--navbar-height));
}
.character-hub__menu {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
  flex-shrink: 0;
}
.character-hub__menu-item {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: not-allowed; /* PLATZHALTER: wird interaktiv, sobald der Zentralbereich echten Inhalt hat */
}
.character-hub__menu-item.is-active { background: var(--bg-surface-hover); color: var(--text-primary); }
.character-hub__menu-item--add {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--brand-orange-bright);
}
.character-hub__menu-item--add:hover { background: var(--bg-surface-hover); }
.character-hub__menu-item--add svg { width: 16px; height: 16px; }
.character-hub__menu-divider { width: 1px; height: 24px; background: var(--border-muted); margin: 0 4px; flex-shrink: 0; }
.character-hub__menu-hint { margin-left: auto; font-size: 12px; color: var(--text-muted); font-style: italic; }

.character-hub__body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  gap: var(--space-md);
}
.character-hub__column {
  background: var(--bg-surface);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
}
.character-hub__placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed var(--border-accent);
  border-radius: var(--radius-md);
}

/* Charakter-Badges — jedes Badge kann kompakt oder expandiert sein (Klärung im Chat: kein
   separater, fest stehender Karten-Container mehr — das angeklickte Badge wächst selbst). */
.character-badge-list { display: flex; flex-direction: column; gap: 6px; }
.character-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--badge-class-color, var(--border-muted));
  background: var(--bg-surface-hover);
  cursor: pointer;
  transition: filter 0.15s ease;
}
.character-badge:hover { filter: brightness(1.18); }
.character-badge:focus-visible { outline: 2px solid var(--brand-orange-bright); outline-offset: 1px; }
.character-badge__class-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--badge-class-color, var(--text-muted)); flex-shrink: 0; }
.character-badge__main-marker { color: var(--brand-orange-bright); font-size: 13px; flex-shrink: 0; }
.character-badge__name { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.character-badge__tree-hint {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--bg-surface-hover);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Expandierter Zustand — dasselbe Badge-Element, nicht mehr kompakt */
.character-badge--expanded {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: var(--space-md);
  border: 2px solid var(--badge-class-color, var(--border-accent));
  border-left-width: 2px;
  background: rgba(244, 157, 26, 0.06);
  cursor: default;
}
.character-badge--expanded .character-badge__main-marker { font-size: 15px; }
.character-badge__expanded-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-md);
}
.character-badge__portrait { width: var(--icon-size-compact); height: var(--icon-size-compact); border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.character-badge__portrait--empty { background: var(--bg-surface-hover); }
.character-badge__expanded-name {
  flex: 1;
  font-family: 'Rajdhani', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--badge-class-color, var(--text-primary));
}
.character-badge__expanded-stats { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.character-badge__expanded-stats > div { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.character-badge__expanded-stats dt { color: var(--text-muted); margin: 0; }
.character-badge__expanded-stats dd { margin: 0; color: var(--text-primary); font-weight: 600; }

@media (max-width: 960px) {
  .character-hub__body { grid-template-columns: 1fr; }
}

/* ---------- Paperdoll (Ausrüstungsanzeige, agent.md 2.2.1 Charakter-Reiter) ---------- */
.paperdoll { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm); }
.paperdoll__bottom-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-sm); margin-top: var(--space-sm); }
.paperdoll__column { display: flex; flex-direction: column; gap: var(--space-sm); }
.paperdoll-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-base);
  border: 1px solid var(--slot-quality-color, var(--border-muted));
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}
/* Gespiegelte Anordnung: linke Spalte Icon-links/Text-rechts, rechte Spalte Text-links/Icon-rechts */
.paperdoll-slot--right { flex-direction: row-reverse; }
.paperdoll-slot--right .paperdoll-slot__text { text-align: right; }
.paperdoll-slot__icon-img { width: var(--icon-size-compact); height: var(--icon-size-compact); border-radius: var(--radius-sm); flex-shrink: 0; object-fit: cover; }
.paperdoll-slot__icon-img--empty { background: var(--bg-surface-hover); }
.paperdoll-slot__text { flex: 1; min-width: 0; }
.paperdoll-slot__name { font-size: 13px; font-weight: 600; color: var(--slot-quality-color, var(--text-primary)); }
.paperdoll-slot__stats { font-size: 11px; color: var(--text-secondary); margin-top: 2px; min-height: 14px; }
.paperdoll-slot--empty { border-style: dashed; }
.paperdoll-slot--empty .paperdoll-slot__name { color: var(--text-muted); font-style: italic; font-weight: 500; }

/* ---------- Stat-Panels (Wertebereich, agent.md 2.2.1) ---------- */
.stat-panel { background: var(--bg-base); border: 1px solid var(--border-muted); border-radius: var(--radius-md); padding: var(--space-sm) var(--space-md); margin-bottom: var(--space-md); }
.stat-panel__title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin: 0 0 var(--space-sm); }
.stat-panel__list { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.stat-panel__list > div { display: flex; justify-content: space-between; font-size: 13px; }
.stat-panel__list dt { color: var(--text-secondary); margin: 0; }
.stat-panel__list dd { margin: 0; color: var(--text-primary); font-weight: 600; }

@media (max-width: 640px) {
  .paperdoll { grid-template-columns: 1fr; }
  .paperdoll__bottom-row { grid-template-columns: 1fr; }
}

/* ---------- Talente-Tab (agent.md 2.2.1, Platzhalter-Struktur) ---------- */
.character-hub__body--wide-detail { grid-template-columns: 280px 1fr; }
.character-hub__body--wide-detail .character-hub__column--values { display: none; }

.talents-view__disclaimer { margin-bottom: var(--space-md); }
.talents-view__spec-switcher { display: flex; justify-content: center; gap: var(--space-sm); margin-bottom: var(--space-lg); }
.spec-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-base);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}
.spec-toggle:hover { border-color: var(--border-accent); }
.spec-toggle.is-active { border-color: var(--brand-orange-main); color: var(--text-primary); background: rgba(244,157,26,0.08); }
.spec-toggle__badge { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--brand-orange-bright); }

.talent-trees { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }
.talent-tree { background: var(--bg-base); border: 1px solid var(--border-muted); border-radius: var(--radius-md); padding: var(--space-sm); }
.talent-tree__header { font-size: 13px; font-weight: 600; color: var(--text-primary); padding: 4px 6px 10px; }
.talent-tree__grid { display: flex; flex-direction: column; gap: 6px; }
.talent-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.talent-slot { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.talent-slot__icon { width: var(--icon-size-compact); height: var(--icon-size-compact); border-radius: var(--radius-sm); background: var(--bg-surface-hover); border: 1px solid var(--border-muted); }
.talent-slot__points { font-size: 10px; color: var(--text-muted); }

@media (max-width: 960px) {
  .character-hub__body--wide-detail { grid-template-columns: 1fr; }
  .talent-trees { grid-template-columns: 1fr; }
}

/* ---------- Vorlagen-Übersicht (Raidleitung → Vorlagen) ---------- */
.page__intro-row { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-md); }
.template-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-md); }
.template-card { background: var(--bg-surface); border: 1px solid var(--border-muted); border-radius: var(--radius-lg); padding: var(--space-md); }
.template-card__header { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-sm); margin-bottom: var(--space-sm); cursor: pointer; }
.template-card__header h3 { font-size: 16px; color: var(--text-primary); }
.template-card__meta { display: flex; gap: var(--space-sm); flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); margin-bottom: var(--space-sm); }
.template-card__meta span { background: var(--bg-base); padding: 2px 8px; border-radius: var(--radius-pill); }
.template-card__footer { font-size: 11px; color: var(--text-muted); }
.template-card { cursor: pointer; }

/* ---------- Vorlagen-Editor ---------- */
.template-editor-layout {
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-md) var(--content-padding-x) 80px;
}
.template-editor { flex: 1; min-width: 0; }
.template-editor__header { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-lg); flex-wrap: wrap; }
.template-editor__title-input { flex: 1; min-width: 200px; font-family: 'Rajdhani', sans-serif; font-size: 22px; font-weight: 700; background: transparent; border: none; border-bottom: 2px solid transparent; color: var(--text-primary); padding: 4px 0; }
.template-editor__title-input:hover, .template-editor__title-input:focus { border-bottom-color: var(--border-accent); outline: none; }
.template-editor__select { background: var(--bg-surface); border: 1px solid var(--border-muted); border-radius: var(--radius-sm); color: var(--text-primary); padding: 8px 10px; font-size: 13px; }

.template-editor__boxes { display: flex; flex-direction: column; gap: var(--space-md); margin-bottom: var(--space-md); }
.encounter-box { background: var(--bg-surface); border: 1px solid var(--border-muted); border-radius: var(--radius-lg); padding: var(--space-md); }
.encounter-box__header { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-md); }
.encounter-box__title-input { flex: 1; font-family: 'Rajdhani', sans-serif; font-size: 17px; font-weight: 700; background: transparent; border: none; border-bottom: 2px solid transparent; color: var(--text-primary); padding: 2px 0; }
.encounter-box__title-input:hover, .encounter-box__title-input:focus { border-bottom-color: var(--border-accent); outline: none; }
.encounter-box__header-actions { display: flex; gap: 2px; flex-shrink: 0; }

.encounter-box__columns { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); margin-bottom: var(--space-md); }
.role-slot-column h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 8px; }
.role-slot-column__list { display: flex; flex-direction: column; gap: 4px; min-height: 8px; }
.role-slot-column__dropzone {
  margin-top: 6px;
  padding: 10px;
  border: 1px dashed var(--border-accent);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}
.role-slot-column.is-drag-over .role-slot-column__dropzone,
.role-slot-column__list.is-drag-over { border-color: var(--brand-orange-main); color: var(--brand-orange-bright); background: rgba(244,157,26,0.06); }

/* Kompakte Tabellenzeile pro Slot — Icon | Label | Zielfläche | Notiz | Aktionen (Sheet-Optik lt. Chat) */
.role-slot-row {
  display: grid;
  grid-template-columns: 44px minmax(0,1fr) minmax(0,1.4fr) minmax(0,1fr) auto;
  gap: 6px;
  align-items: center;
  background: var(--bg-base);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  cursor: grab;
}
.role-slot-row.is-dragging { opacity: 0.4; }
.role-slot-row__icon { background: var(--bg-surface); border: 1px solid var(--border-muted); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 14px; text-align: center; padding: 4px 2px; }
.role-slot-row__label { background: transparent; border: none; color: var(--text-primary); font-size: 13px; font-weight: 600; padding: 4px; min-width: 0; }
.role-slot-row__label:focus { outline: 1px solid var(--border-accent); border-radius: var(--radius-sm); }
.role-slot-row__target { font-size: 11px; color: var(--text-muted); font-style: italic; padding: 4px; border: 1px dashed var(--border-muted); border-radius: var(--radius-sm); text-align: center; }
.role-slot-row__note { background: transparent; border: none; border-bottom: 1px dashed var(--border-muted); color: var(--text-secondary); font-size: 12px; padding: 4px; min-width: 0; }
.role-slot-row__note:focus { outline: none; border-bottom-color: var(--brand-orange-main); }
.role-slot-row__actions { display: flex; gap: 0; flex-shrink: 0; }
.role-slot-row__actions .icon-btn { width: 24px; height: 24px; }

.encounter-box__notes {
  width: 100%;
  min-height: 60px;
  background: var(--bg-base);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  padding: var(--space-sm);
  margin-bottom: var(--space-md);
  resize: vertical;
}

.encounter-box__media-list { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-bottom: var(--space-sm); }
.media-thumb { position: relative; width: 80px; height: 80px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border-muted); }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-thumb--youtube { width: auto; height: auto; max-width: 200px; padding: 6px; display: flex; align-items: center; }
.media-thumb--youtube a { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 11px; text-decoration: none; overflow: hidden; }
.media-thumb--youtube svg { width: 20px; height: 20px; flex-shrink: 0; color: #FF0000; }
.media-thumb--youtube span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-thumb__remove {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px;
  background: rgba(11,14,17,0.8);
  border: none; border-radius: 50%;
  color: var(--text-primary);
  font-size: 12px; line-height: 1;
  cursor: pointer;
}
.encounter-box__media-row { display: flex; gap: var(--space-sm); align-items: stretch; }
.encounter-box__dropzone {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 1px dashed var(--border-accent);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.encounter-box__dropzone svg { width: 20px; height: 20px; flex-shrink: 0; }
.encounter-box__dropzone strong { color: var(--brand-orange-bright); font-weight: 600; }
.encounter-box__dropzone:hover,
.encounter-box__dropzone.is-drag-over { border-color: var(--brand-orange-main); background: rgba(244,157,26,0.06); color: var(--text-primary); }

/* ---------- Rollen-Bausteine-Palette (echter Layout-Nachbar, sticky statt fixed — kein
   Überlappen mit dem Editor-Header mehr möglich, passt außerdem zur Ganze-Seite-scrollt-Regel) ---------- */
.role-palette {
  position: sticky;
  top: calc(var(--navbar-height) + var(--space-md));
  width: 260px;
  flex-shrink: 0;
  max-height: calc(100vh - var(--navbar-height) - var(--space-xl));
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}
.role-palette__title { font-size: 14px; margin-bottom: 4px; }
.role-palette__hint { font-size: 11px; color: var(--text-muted); margin-bottom: var(--space-md); }
.role-palette__group { margin-bottom: var(--space-md); }
.role-palette__group h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 6px; }
.role-palette__block {
  background: var(--bg-base);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: grab;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.role-palette__block:hover { border-color: var(--border-accent); }
.role-palette__block.is-armed { border-color: var(--brand-orange-main); background: rgba(244,157,26,0.1); }

@media (max-width: 1200px) {
  .template-editor-layout { flex-direction: column; }
  .role-palette { position: static; width: 100%; max-height: none; }
}
@media (max-width: 720px) {
  .encounter-box__columns { grid-template-columns: 1fr; }
  .role-slot-row { grid-template-columns: 36px 1fr; grid-template-areas: "icon label" "target target" "note note" "actions actions"; }
}

/* ---------- Qualifikationen (Raidleitung → Qualifikationen) ---------- */
.qualification-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-md); }
.qualification-card { background: var(--bg-surface); border: 1px solid var(--border-muted); border-radius: var(--radius-lg); padding: var(--space-md); }
.qualification-card__header { display: flex; align-items: flex-start; gap: var(--space-sm); }
.qualification-card__icon { width: var(--icon-size-standard); height: var(--icon-size-standard); border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.qualification-card__icon--empty { background: var(--bg-surface-hover); }
.qualification-card__header h3 { font-size: 15px; color: var(--text-primary); }
.qualification-card__scope { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.qualification-card__header .icon-btn { margin-left: auto; flex-shrink: 0; }
.qualification-card__note { font-size: 13px; color: var(--text-secondary); margin-top: var(--space-sm); }

/* Breitere Modal-Variante für den Qualifikations-Editor (Klassen-Matrix braucht Platz) */
.modal--wide { max-width: 640px; }

.radio-row { display: flex; gap: var(--space-lg); }
.radio-field { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-primary); cursor: pointer; }

/* Icon-Auswahl-Trigger (Qualifikationen-Formular) — feste Box in Icon-Größe + Button daneben */
.icon-picker-trigger { display: flex; align-items: center; gap: var(--space-sm); }
.icon-picker-trigger__box {
  width: var(--icon-size-standard);
  height: var(--icon-size-standard);
  padding: 2px;
  flex-shrink: 0;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  background: var(--bg-base);
}
.icon-picker-trigger__box img { width: 100%; height: 100%; border-radius: 2px; object-fit: cover; display: block; }

/* Klassen/Skillungs-Matrix */
.class-spec-matrix { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; padding-right: 4px; }
.class-spec-matrix__row { display: grid; grid-template-columns: 100px 1fr; align-items: center; gap: var(--space-sm); padding: 4px 0; border-bottom: 1px solid var(--border-muted); }
.class-spec-matrix__class-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.class-spec-matrix__specs { display: flex; gap: var(--space-md); flex-wrap: wrap; }
.checkbox-field--compact { font-size: 12px; }

/* ---------- Qualifikationen-Tab (Charakterverwaltung, nach Talente) ---------- */
.qualifications-view__group-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin: var(--space-md) 0 var(--space-sm); }
.qualifications-view__group-title:first-child { margin-top: 0; }
.qualification-list { display: flex; flex-direction: column; gap: 6px; }
.qualification-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-base);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  padding: 8px 12px;
}
.qualification-row__icon { width: var(--icon-size-compact); height: var(--icon-size-compact); border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.qualification-row__icon--empty { background: var(--bg-surface-hover); }
.qualification-row__text { flex: 1; min-width: 0; }
.qualification-row__title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.qualification-row__note { font-size: 12px; color: var(--text-secondary); }

/* Toggle-Switch */
.qualification-row__toggle { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; cursor: pointer; }
.qualification-row__toggle input { opacity: 0; width: 0; height: 0; }
.qualification-row__toggle-track { position: absolute; inset: 0; background: var(--bg-surface-hover); border: 1px solid var(--border-muted); border-radius: var(--radius-pill); transition: background-color 0.15s ease; }
.qualification-row__toggle-track::before {
  content: ''; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px;
  background: var(--text-secondary); border-radius: 50%; transition: transform 0.15s ease, background-color 0.15s ease;
}
.qualification-row__toggle input:checked + .qualification-row__toggle-track { background: rgba(244,157,26,0.25); border-color: var(--brand-orange-main); }
.qualification-row__toggle input:checked + .qualification-row__toggle-track::before { transform: translateX(16px); background: var(--brand-orange-bright); }

/* ---------- Genereller Icon-Picker (public/js/icon-picker.js) ---------- */
.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--icon-size-standard), 1fr));
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  margin-top: var(--space-sm);
}
.icon-picker-grid__item {
  width: var(--icon-size-standard); height: var(--icon-size-standard);
  padding: 2px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--bg-base);
  cursor: pointer;
}
.icon-picker-grid__item img { width: 100%; height: 100%; border-radius: 2px; object-fit: cover; display: block; }
.icon-picker-grid__item:hover { border-color: var(--border-accent); }
.icon-picker-grid__item.is-selected { border-color: var(--brand-orange-main); box-shadow: var(--shadow-portal-glow); }

/* ---------- Deutsche Datums-/Zeit-Eingabe (public/js/date-time-input.js) ---------- */
.dt-input { display: flex; align-items: stretch; gap: 4px; }
.dt-input__text {
  flex: 1;
  background: var(--bg-base);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
}
.dt-input__text:focus { outline: 1px solid var(--border-accent); }
.dt-input__icon-btn {
  flex-shrink: 0;
  width: 38px;
  background: var(--bg-base);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
}
.dt-input__icon-btn:hover { border-color: var(--border-accent); }

.dt-calendar {
  position: absolute;
  z-index: 50;
  width: 260px;
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
.dt-calendar__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dt-calendar__title { font-family: 'Rajdhani', sans-serif; font-size: 14px; font-weight: 700; color: var(--text-primary); }
.dt-calendar__weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.dt-calendar__weekdays span { text-align: center; font-size: 10px; color: var(--text-muted); text-transform: uppercase; }
.dt-calendar__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dt-calendar__day {
  aspect-ratio: 1;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
}
.dt-calendar__day:hover { background: var(--bg-surface-hover); }
.dt-calendar__day--other { color: var(--text-muted); opacity: 0.5; cursor: default; pointer-events: none; }
.dt-calendar__day.is-today { border: 1px solid var(--border-accent); }
.dt-calendar__day.is-selected { background: var(--brand-orange-main); color: var(--bg-darkest); font-weight: 700; }

/* ---------- Item-Tooltip (public/js/item-tooltip.js) — Wowhead-artig ---------- */
.item-tooltip {
  position: absolute;
  z-index: 200;
  max-width: 320px;
  min-width: 220px;
  background: rgba(11, 14, 17, 0.97);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.6);
  font-size: 13px;
  line-height: 1.35;
  pointer-events: none;
  font-family: 'Inter', sans-serif;
}
.item-tooltip__line { color: var(--text-secondary); white-space: pre-wrap; }
.item-tooltip__line:first-child { font-weight: 700; font-size: 14px; color: var(--text-primary); }

.item-icon-trigger { cursor: help; display: inline-flex; }

/* ---------- Template-Kanal-Zuordnung (Raidleitung → Vorlagen, one-portal-multi-discord) ---------- */
.channel-mapping-list { display: flex; flex-direction: column; gap: 8px; }
.channel-mapping-row { display: flex; align-items: center; gap: var(--space-md); padding: 8px 0; border-bottom: 1px solid var(--border-muted); }
.channel-mapping-row:last-child { border-bottom: none; }
.channel-mapping-row__guild { flex: 0 0 200px; font-size: 13px; font-weight: 600; color: var(--text-primary); }
.channel-mapping-row__select { flex: 0 0 260px; background: var(--bg-base); border: 1px solid var(--border-muted); border-radius: var(--radius-sm); color: var(--text-primary); height: 40px; padding: 0 10px; font-size: 14px; font-family: inherit; }
.channel-mapping-row__select:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Charakter-Badge v2 — globale Komponente (public/js/character-badge.js) ---------- */
.character-badge-v2 {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-hover);
  border-left: 6px solid var(--badge-class-color, var(--border-muted));
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-family: inherit;
}
.character-badge-v2__star {
  flex-shrink: 0;
  width: 14px; /* immer reserviert, auch wenn leer -- Namen sollen in Listen bündig untereinanderstehen */
  text-align: center;
  font-size: 13px;
  line-height: 1;
}
.character-badge-v2__star--main { color: var(--brand-orange-bright); } /* Main-Charakter: Gold */
.character-badge-v2__star--twink { color: #C0C4CC; } /* Twink: Silber */
.character-badge-v2__star--empty { /* absichtlich leer, nur der reservierte Platz zählt */ }
.character-badge-v2__name { flex-shrink: 0; font-size: 12px; font-weight: 400; color: var(--text-primary); white-space: nowrap; }
/* Rechtsbündig via auto-margin -- der "Stretch"-Bereich liegt dadurch automatisch in der Mitte,
   unabhängig von der Gesamtbreite der Komponente. */
.character-badge-v2__specs { margin-left: auto; display: flex; gap: 4px; flex-shrink: 0; }
.character-badge-v2__spec-icon { width: 18px; height: 18px; border-radius: 4px; display: block; }
/* Glow markiert die Main-Skillung bei Dual-Spec-Charakteren -- die Nebenskillung bleibt schlicht. */
.character-badge-v2__spec-icon--main { box-shadow: 0 0 0 1px #4A9EFF, 0 0 6px 1px rgba(74,158,255,0.7); }

/* ---------- Item-Button — globale Komponente (public/js/item-button.js) ---------- */
.item-button {
  width: 48px; height: 48px;
  padding: 3px;
  border: 2px solid var(--border-muted);
  border-radius: var(--radius-sm);
  background: var(--bg-base);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.item-button img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; display: block; }
.item-button:hover { border-color: var(--border-accent); }
.item-button.is-selected { border-color: var(--brand-orange-main); box-shadow: 0 0 8px rgba(244,157,26,0.4); }

/* ---------- Filterbares Grid (Isotope-artiges Verhalten, Vanilla JS) ---------- */
.filter-grid__filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filter-grid__filter-btn {
  font-size: 12px; font-weight: 600; padding: 5px 12px;
  border-radius: 9999px; border: 1px solid var(--border-muted);
  background: var(--bg-surface); color: var(--text-secondary);
  cursor: pointer; transition: all 0.15s ease;
}
.filter-grid__filter-btn.is-active { background: rgba(244,157,26,0.15); border-color: var(--brand-orange-main); color: var(--brand-orange-bright); }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.filter-grid__item { transition: opacity 0.25s ease, transform 0.25s ease; }
.filter-grid__item--hidden { display: none; }
