/* =====================================================================
   Feedback / Wünsche — Visual Foundation
   ===================================================================== */

:root {
  /* Surfaces */
  --bg: #f7f8fa;
  --card: #ffffff;
  --border: #e5e7eb;
  --border-strong: #cbd5e1;
  --surface-muted: #f1f5f9;

  /* Typo (WCAG-AA-tauglich auf --bg) */
  --text: #0f172a;
  --text-light: #475569;
  --text-mute: #64748b;

  /* Primary (kalkül-Blau, Tailwind blue-600 — analog tagesbericht, lernen, apps) */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #dbeafe;
  --primary-ring: rgba(37, 99, 235, 0.18);

  /* Semantic */
  --success: #059669;
  --success-soft: #d1fae5;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-soft: #fee2e2;

  /* Subject badges */
  --subject-problem-bg: #fef2f2;
  --subject-problem-fg: #b91c1c;
  --subject-anfrage-bg: #eff6ff;
  --subject-anfrage-fg: #1d4ed8;
  /* v31: Wunsch ist jetzt blau (vorher gelb/amber). */
  --subject-wunsch-bg: #eff6ff;
  --subject-wunsch-fg: #1d4ed8;

  /* Status badges */
  --status-open-bg: #f1f5f9;
  --status-open-fg: #475569;
  --status-progress-bg: #fef3c7;
  --status-progress-fg: #92400e;
  --status-resolved-bg: #d1fae5;
  --status-resolved-fg: #065f46;

  /* Shadows */
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-elev: 0 8px 24px rgba(15, 23, 42, 0.10), 0 2px 6px rgba(15, 23, 42, 0.06);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  /* Spacing scale (4px grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;

  /* Z */
  --z-header: 10;
  --z-toast: 60;
  --z-loading: 100;
}

/* v14 Dark-Mode — Token-Overrides unter [data-theme="dark"].
   Strategie: nur Surfaces, Text, Borders, Shadows + Subject/Status-Backgrounds
   anpassen; Primary/Semantic-Foregrounds bleiben gleich (sind WCAG-AA-tauglich
   auch auf dunklen Surfaces). */
:root[data-theme="dark"] {
  --bg: #0b1220;
  --card: #131c2e;
  --border: #1f2a3f;
  --border-strong: #334155;
  --surface-muted: #1a2436;

  --text: #f1f5f9;
  --text-light: #cbd5e1;
  --text-mute: #94a3b8;

  --primary: #60a5fa;
  --primary-hover: #93c5fd;
  --primary-soft: rgba(96, 165, 250, 0.15);
  --primary-ring: rgba(96, 165, 250, 0.32);

  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.18);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.18);
  --danger: #f87171;
  --danger-hover: #fca5a5;
  --danger-soft: rgba(248, 113, 113, 0.18);

  --subject-problem-bg: rgba(248, 113, 113, 0.18);
  --subject-problem-fg: #fca5a5;
  --subject-anfrage-bg: rgba(96, 165, 250, 0.18);
  --subject-anfrage-fg: #93c5fd;
  --subject-wunsch-bg: rgba(96, 165, 250, 0.18);
  --subject-wunsch-fg: #93c5fd;

  --status-open-bg: rgba(148, 163, 184, 0.18);
  --status-open-fg: #cbd5e1;
  --status-progress-bg: rgba(251, 191, 36, 0.18);
  --status-progress-fg: #fcd34d;
  --status-resolved-bg: rgba(52, 211, 153, 0.18);
  --status-resolved-fg: #6ee7b7;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-elev: 0 8px 24px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Initiales Dark, bevor JS-Theme-Init läuft — verhindert kurzes Aufblitzen
   des hellen Themes bei System-Dark-Mode-Usern. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
  }
}

/* Theme-Toggle-Button im Header */
.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.theme-toggle:hover {
  background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.theme-toggle .theme-icon { width: 18px; height: 18px; }
.theme-toggle .theme-icon-moon { display: inline-flex; }
.theme-toggle .theme-icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-icon-sun { display: inline-flex; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* Inter feature flags (kerning + tabular nums) */
@supports (font-variation-settings: normal) {
  html, body { font-family: 'Inter var', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; }
}

h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.011em;
  color: var(--text);
}

/* Focus / a11y -------------------------------------------------------- */

*:focus:not(:focus-visible) { outline: none; }
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 8px 14px;
  border-radius: 0 0 var(--radius-md) 0;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 200;
}
.skip-link:focus-visible {
  left: 0;
  outline: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header -------------------------------------------------------------- */

.header {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: var(--z-header);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.app-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.35);
}
.app-mark svg { width: 18px; height: 18px; }

.header h1 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  border: 1px solid transparent;
}
.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0;
}
.user-name {
  font-size: 0.78rem;
  color: var(--text);
  font-weight: 500;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Buttons ------------------------------------------------------------- */

.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, transform 80ms ease;
  line-height: 1;
  min-height: 32px;
  touch-action: manipulation;
}
.btn-primary:active,
.btn-secondary:active,
.btn-ghost:active,
.btn-danger:active { transform: translateY(1px); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-secondary {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface-muted); border-color: var(--border-strong); }

.btn-ghost {
  background: transparent;
  color: var(--text-light);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--surface-muted); color: var(--text); }

.btn-danger {
  background: var(--card);
  color: var(--danger);
  border-color: var(--danger-soft);
}
.btn-danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger-hover);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-ghost:disabled,
.btn-danger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Compat: alter Logout-Button */
.logout-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-light);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.78rem;
  font-family: inherit;
  font-weight: 500;
  min-height: 32px;
  touch-action: manipulation;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.logout-btn:hover { background: var(--surface-muted); color: var(--text); border-color: var(--border-strong); }

/* View-as-toggle ------------------------------------------------------ */

.view-as-toggle {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-light);
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
  touch-action: manipulation;
}
.view-as-toggle:hover { background: var(--surface-muted); color: var(--text); }
.view-as-toggle.active {
  background: var(--warning-soft);
  border-color: #f59e0b;
  color: #b45309;
}
.view-as-icon { width: 18px; height: 18px; }
.view-as-toggle .view-as-eye-off { display: none; }
.view-as-toggle.active .view-as-eye { display: none; }
.view-as-toggle.active .view-as-eye-off { display: block; }

.view-as-banner {
  background: var(--warning-soft);
  border-bottom: 1px solid #f59e0b;
  color: #92400e;
  padding: 8px 24px;
  font-size: 0.78rem;
  text-align: center;
  font-weight: 500;
}

/* Tabs ---------------------------------------------------------------- */

.tabs {
  display: flex;
  /* v37: Tab-Bar horizontal zentrieren — der Blick landet zuerst in der Mitte;
     bei vielen Tabs erlaubt overflow-x weiterhin den Wisch-Scroll auf Mobile. */
  justify-content: center;
  gap: 2px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-light);
  font-family: inherit;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
  white-space: nowrap;
  position: relative;
  top: 1px; /* overlap border-bottom */
  touch-action: manipulation;
}
.tab .tab-icon { width: 16px; height: 16px; flex-shrink: 0; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"],
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  border-bottom-width: 3px;
}
.tab[aria-selected="true"]::after {
  content: '';
  position: absolute;
  inset: auto 6px -3px 6px;
  height: 3px;
  background: linear-gradient(180deg, var(--primary-soft) 0%, transparent 100%);
  pointer-events: none;
}

/* Container ----------------------------------------------------------- */

.container {
  max-width: 760px;
  margin: 24px auto;
  padding: 0 24px 64px;
  transition: max-width 160ms ease;
}
/* v25: Das Kanban-Board braucht mehr horizontale Breite als die übrigen Tabs.
   Wird per board-active-Klasse (in switchTab gesetzt) aktiviert.
   v54: volle Seitenbreite statt 1240px-Deckel — sonst wird nur die Mitte genutzt
   und die Spalten/Texte werden auf breiten Monitoren unnötig gequetscht. Die
   Spalten (grid 1fr) verteilen sich dann über die ganze Breite. */
.container.board-active {
  max-width: none;
  padding-left: 16px;
  padding-right: 16px;
}

/* Wishes — Submit-Form (Single-Form-Redesign 2026-05-19) -------------- */

.wish-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.wish-form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wish-form-row-inline {
  flex-direction: row;
  gap: var(--space-3);
  align-items: flex-end;
}
.wish-form-field { display: flex; flex-direction: column; gap: 6px; }
.wish-form-field-grow { flex: 1; min-width: 0; }
.wish-form-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
  font-weight: 600;
}
.wish-form-select,
.wish-form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.92rem;
  background: var(--card);
  color: var(--text);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.wish-form-select { appearance: auto; }
.wish-form-textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.55;
}
.wish-form-select:focus,
.wish-form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.wish-form-counter {
  align-self: flex-end;
  font-size: 0.72rem;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
  margin-top: -2px;
}
.wish-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}
.wish-form-actions .btn-primary {
  min-width: 140px;
}
.wish-success {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  background: var(--success-soft);
  border-left: 3px solid var(--success);
  padding: var(--space-4) var(--space-4);
  border-radius: var(--radius-md);
  margin-top: var(--space-3);
}
.wish-success-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wish-success-content { display: flex; flex-direction: column; gap: 2px; }
.wish-success-title { font-weight: 600; color: var(--text); }
.wish-success-line { font-size: 0.85rem; color: var(--text-light); }

@media (max-width: 640px) {
  .wish-form { padding: var(--space-4); gap: var(--space-3); }
  .wish-form-row-inline { flex-direction: column; align-items: stretch; }
  .wish-form-actions .btn-primary { width: 100%; }
}

/* Admin/User-Trennung sichtbar machen (2026-05-19) ------------------- */

/* Submit-Form Privacy-Hinweis */
.wish-form-privacy {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-light);
  padding: var(--space-2) 0;
  line-height: 1.45;
}
.wish-form-privacy-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--primary);
  margin-top: 1px;
}
.wish-form-privacy strong { color: var(--text); font-weight: 600; }

/* Admin-Banner über dem Archive */
.admin-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
  background: var(--primary-soft);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.86rem;
}
.admin-banner-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--primary);
}
.admin-banner-text { flex: 1; min-width: 0; }
.admin-banner-text strong { color: var(--primary); font-weight: 700; }
.admin-banner-action {
  border: 1px solid var(--primary);
  background: var(--card);
  color: var(--primary);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 140ms ease;
  flex-shrink: 0;
}
.admin-banner-action:hover { background: var(--primary-soft); }
.admin-banner-action:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Card-Admin-Section (collapsible) */
/* v30: Admin-Aktionen als kleines Icon mit Popover (vorher inline-Accordion). */
.card-admin-pop {
  position: relative;
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-3);
}
.card-admin-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--primary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 32px;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.card-admin-trigger:hover,
.card-admin-trigger[aria-expanded="true"] {
  background: var(--primary-soft);
  border-color: var(--primary);
}
.card-admin-trigger:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.card-admin-trigger-icon { display: inline-flex; }

.card-admin-panel {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  right: 0;
  width: min(440px, calc(100vw - 48px));
  max-height: 70vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elev);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.card-admin-panel[hidden] { display: none; }

@media (max-width: 640px) {
  .admin-banner { flex-wrap: wrap; }
  .admin-banner-action { width: 100%; }
  .card-admin-panel { width: calc(100vw - 32px); right: auto; left: 0; }
}

/* App-Badge in Archive-Cards */
.badge-app {
  background: var(--surface-muted);
  color: var(--text-light);
  border: 1px solid var(--border);
}
.badge-app-none {
  background: transparent;
  color: var(--text-mute);
  border-style: dashed;
}

/* v16: Such-Input im Archive */
.archive-search {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}
.archive-search-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.85rem;
  background: var(--card);
  color: var(--text);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.archive-search-input::placeholder { color: var(--text-mute); }
.archive-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
@media (max-width: 640px) {
  .archive-search { max-width: 100%; }
}

/* App-Filter im Archive */
.archive-app-filter-wrap {
  align-items: center;
  gap: 8px;
}
.archive-app-filter-label {
  font-size: 0.78rem;
  color: var(--text-light);
}
.archive-app-filter {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.82rem;
  background: var(--card);
  color: var(--text);
  min-width: 140px;
}
.archive-app-filter:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.question {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}
.question-text {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}
.question.wish .answer-input textarea { min-height: 56px; }

.answer-input { display: flex; margin-top: 8px; }
.answer-input textarea {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-family: inherit;
  resize: none;
  overflow: hidden;
  min-height: 40px;
  line-height: 1.5;
  field-sizing: content;
  background: var(--card);
  color: var(--text);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.answer-input textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.btn-enter {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  width: 0;
  height: 40px;
  margin-left: 0;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: flex-end;
  opacity: 0;
  transform: scale(0.85);
  pointer-events: none;
  white-space: nowrap;
  line-height: 1;
  touch-action: manipulation;
  transition:
    width 320ms cubic-bezier(0.32, 0.72, 0, 1),
    margin-left 320ms cubic-bezier(0.32, 0.72, 0, 1),
    transform 320ms cubic-bezier(0.32, 0.72, 0, 1),
    opacity 240ms cubic-bezier(0.32, 0.72, 0, 1),
    background-color 180ms ease-out;
}
.answer-input textarea:not(:placeholder-shown) ~ .btn-enter {
  width: 40px;
  margin-left: 8px;
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.btn-enter:hover { background: var(--primary-hover); }
.btn-enter:active { transform: scale(0.94); transition-duration: 120ms; }

/* Toast --------------------------------------------------------------- */

.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  z-index: var(--z-toast);
  max-width: calc(100vw - 32px);
  pointer-events: none;
}

.toast-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--card);
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-elev);
  font-size: 0.86rem;
  min-width: 280px;
  max-width: 380px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events: auto;
}
.toast-item.show { opacity: 1; transform: translateY(0); }
.toast-item.hide { opacity: 0; transform: translateY(8px); }

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
}
.toast-item.t-success .toast-icon { background: var(--success); }
.toast-item.t-error   .toast-icon { background: var(--danger); }
.toast-item.t-warning .toast-icon { background: var(--warning); }
.toast-item.t-info    .toast-icon { background: var(--primary); }

.toast-body { flex: 1; min-width: 0; }
.toast-title { font-weight: 600; font-size: 0.86rem; line-height: 1.3; color: var(--text); }
.toast-hint { color: var(--text-light); font-size: 0.78rem; margin-top: 2px; line-height: 1.4; }

.toast-action {
  background: transparent;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  font-family: inherit;
}
.toast-action:hover { background: var(--primary-soft); }

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-mute);
  cursor: pointer;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  padding: 0;
  font-family: inherit;
}
.toast-close:hover { background: var(--surface-muted); color: var(--text); }

/* Legacy toast (only kept so #toast id keeps working if something queries it) */
.toast {
  position: fixed;
  bottom: -200px;
  right: 24px;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}

/* Empty / Loading / Skeleton ----------------------------------------- */

.empty {
  text-align: center;
  color: var(--text-light);
  padding: 48px 16px;
  font-size: 0.9rem;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  color: var(--text-mute);
  opacity: 0.8;
}
.empty-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.empty-hint {
  font-size: 0.83rem;
  color: var(--text-light);
  margin-bottom: 12px;
}
.empty-cta { margin-top: 8px; }

.loading { text-align: center; padding: 32px; color: var(--text-light); }

.skeleton-stack { display: flex; flex-direction: column; gap: 12px; }
.skeleton-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.skeleton-bar {
  height: 12px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, #eef2f7 0%, #f6f8fb 50%, #eef2f7 100%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}
.skeleton-bar + .skeleton-bar { margin-top: 8px; }
.skeleton-bar.w-40 { width: 40%; }
.skeleton-bar.w-60 { width: 60%; }
.skeleton-bar.w-80 { width: 80%; }
.skeleton-bar.w-100 { width: 100%; }
.skeleton-bar.h-large { height: 16px; }

@keyframes skeleton-pulse {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Badges -------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

/* subject */
.badge-problem { background: var(--subject-problem-bg); color: var(--subject-problem-fg); }
.badge-request { background: var(--subject-anfrage-bg); color: var(--subject-anfrage-fg); }
.badge-wish    { background: var(--subject-wunsch-bg);  color: var(--subject-wunsch-fg); }
/* v33: Typ-Badges als Soft-Chip — nur dezente Tönung (kein harter Rand), klares
   Symbol. Wunsch blau + Doppelstern, Problem rot + Blitz. */
.badge-problem, .badge-wish {
  padding: 3px 10px;
  gap: 5px;
}
.badge-icon {
  width: 0.95em;
  height: 0.95em;
  flex-shrink: 0;
  opacity: 0.95;
}

/* status */
.badge-status-open        { background: var(--status-open-bg);     color: var(--status-open-fg); }
.badge-status-in_progress { background: var(--status-progress-bg); color: var(--status-progress-fg); }
.badge-status-resolved    { background: var(--status-resolved-bg); color: var(--status-resolved-fg); }

/* Archive (alle Themen) ---------------------------------------------- */

.archive-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.archive-filter-group { display: flex; gap: 4px; flex-wrap: wrap; }

.archive-filter {
  padding: 5px 12px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-light);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
  touch-action: manipulation;
  min-height: 28px;
}
.archive-filter:hover { background: var(--surface-muted); color: var(--text); }
.archive-filter.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.archive-toolbar-spacer { flex: 1; }
.archive-reset {
  margin-left: auto;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-light);
  font-size: 0.76rem;
  padding: 5px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
}
.archive-reset:hover { background: var(--surface-muted); color: var(--text); }

/* Card --------------------------------------------------------------- */

.archive-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
  transition: border-color 180ms ease-out, box-shadow 180ms ease-out;
}
.archive-card:hover { border-color: var(--border-strong); }
.archive-card.is-resolved {
  border-color: var(--success);
  /* v26: token-basierter Verlauf — funktioniert in Light UND Dark.
     Vorher ein hartcodierter hellgrüner Hex-Wert → im Dark-Mode unsichtbar,
     erledigte Karten waren nicht von offenen unterscheidbar. */
  background: linear-gradient(180deg, var(--success-soft) 0%, var(--card) 60%);
}

/* Slot: top row = badges + bulk-checkbox (slot for Subagent G) */
.card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.card-top-badges { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card-top-spacer { flex: 1; }
.card-top-meta {
  font-size: 0.76rem;
  color: var(--text-mute);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
/* Slot reserved for bulk-checkbox (Subagent G) */
.card-bulk-slot { display: inline-flex; align-items: center; }

/* Author row */
.archive-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.82rem;
}
.archive-author { font-weight: 600; color: var(--text); }
.archive-meta { color: var(--text-light); font-size: 0.78rem; }
.archive-date {
  color: var(--text-mute);
  margin-left: auto;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

/* Slot: vote-bar (Subagent G fills this) */
.card-vote-slot { display: inline-flex; align-items: center; gap: 6px; }

/* Body */
.archive-body {
  font-size: 0.94rem;
  line-height: 1.55;
  white-space: pre-wrap;
  color: var(--text);
  padding: 12px 14px;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow-wrap: anywhere;
}
.archive-question {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 10px;
}
.archive-resolved-info {
  font-size: 0.78rem;
  color: var(--success);
  margin-bottom: 8px;
  font-weight: 500;
}

/* Slot: attachments-list (Subagent G fills this) */
.card-attachments-slot { margin: 8px 0; }
.card-attachments-slot:empty { display: none; }

/* Actions row */
.archive-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  align-items: center;
}
.archive-resolve {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-light);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 160ms ease-out;
  font-family: inherit;
  min-height: 32px;
  touch-action: manipulation;
}
.archive-resolve:hover { background: #f0fdf4; border-color: #86efac; color: #15803d; }
.archive-resolve.done {
  background: var(--success-soft);
  border-color: #86efac;
  color: #065f46;
}
.archive-check { font-size: 0.9rem; line-height: 1; }

/* Slot: status-dropdown / quick-reply / admin-notes / etc. */
.card-actions-slot { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card-admin-notes-slot:empty { display: none; }
.card-admin-notes-slot {
  margin: 8px 0 12px;
  padding: 10px 12px;
  background: #fffbeb;
  border: 1px dashed #fcd34d;
  border-radius: var(--radius-md);
  font-size: 0.83rem;
}

/* Comments */
.archive-comments {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 8px;
}
.archive-comments-empty {
  color: var(--text-light);
  font-size: 0.8rem;
  font-style: italic;
  margin-bottom: 8px;
}
.archive-comment {
  padding: 10px 12px;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}
.archive-comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-light);
  margin-bottom: 4px;
}
.archive-comment-author { font-weight: 600; color: var(--text); }
.archive-comment-date { font-size: 0.72rem; font-variant-numeric: tabular-nums; }
.archive-comment-delete {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-mute);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  line-height: 1;
}
.archive-comment-delete:hover { color: var(--danger); background: var(--danger-soft); }
.archive-comment-text {
  font-size: 0.88rem;
  white-space: pre-wrap;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.archive-comment-input { display: flex; margin-top: 8px; }
.archive-comment-input textarea {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-family: inherit;
  resize: none;
  overflow: hidden;
  min-height: 40px;
  line-height: 1.5;
  field-sizing: content;
  background: var(--card);
  color: var(--text);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.archive-comment-input textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.archive-comment-input .btn-enter { margin-left: 0; }
.archive-comment-input textarea:not(:placeholder-shown) ~ .btn-enter {
  margin-left: 8px;
}

/* AUDIT-F11: Skip-Link-Ziel — #main hat tabindex="-1" (programmatisch
   fokussierbar via Skip-Link), aber Browser zeigen darauf keinen
   sichtbaren Outline. Wir setzen einen expliziten Fokus-Ring, damit
   Screen-Reader-User wissen, wo sie nach dem Skip gelandet sind. */
#main:focus-visible {
  outline: 2px dashed var(--primary);
  outline-offset: 6px;
  border-radius: 6px;
}

/* Loading screen ------------------------------------------------------ */

#loadingScreen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-light);
  font-size: 0.9rem;
  z-index: var(--z-loading);
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--primary-soft);
  border-top-color: var(--primary);
  animation: loading-spin 0.85s linear infinite;
}

.loading-label {
  letter-spacing: 0.005em;
}

@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .loading-spinner { animation-duration: 2.5s; }
}

/* Error-Card (Phase 4 — dedizierter Slot für blocking-Fehler mit Retry) */

.empty.is-error {
  border: 1px solid var(--danger-soft);
  background: linear-gradient(180deg, #fff 0%, var(--danger-soft) 240%);
}

.empty.is-error .empty-title {
  color: var(--danger);
}

.empty .empty-cta {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.empty .empty-cta .btn-primary,
.empty .empty-cta .btn-secondary {
  min-width: 140px;
}

/* noscript fallback (matches body bg, doesn't overlap content) */
noscript.app-noscript {
  display: block;
  padding: 24px;
  text-align: center;
  color: var(--text);
  background: var(--warning-soft);
  border-bottom: 1px solid #f59e0b;
  font-size: 0.9rem;
}

/* Responsive --------------------------------------------------------- */

@media (max-width: 640px) {
  body { font-size: 14px; }
  .header { padding: 10px 12px; }
  .header h1 { font-size: 0.95rem; }
  .user-name { display: none; }
  .user-chip { padding: 2px; background: transparent; }
  .view-as-banner { padding: 6px 12px; font-size: 0.74rem; }

  .tabs { padding: 0 8px; gap: 0; }
  .tab { padding: 12px 12px; font-size: 0.82rem; }

  .container { padding: 0 12px 80px; margin: 12px auto; max-width: 100%; }

  .question, .archive-card, .archive-toolbar, .wishes-intro {
    padding: 16px;
    border-radius: 10px;
  }

  .archive-head { gap: 6px; }
  .archive-date { margin-left: 0; width: 100%; }

  /* Sticky submit on small viewports — slot for Wünsche-Tab */
  .wishes-sticky-cta {
    position: sticky;
    bottom: 12px;
    background: linear-gradient(180deg, transparent 0%, var(--bg) 30%);
    padding-top: 16px;
    margin-top: 16px;
    z-index: 5;
  }

  /* Touch-Targets >= 44px */
  .btn-primary, .btn-secondary, .btn-ghost, .btn-danger,
  .logout-btn, .archive-resolve, .archive-filter,
  .view-as-toggle, .tab {
    min-height: 40px;
  }
  .archive-filter { padding: 8px 14px; font-size: 0.82rem; }

  .toast-stack { right: 12px; bottom: 12px; left: 12px; max-width: none; }
  .toast-item { min-width: 0; max-width: 100%; }
}

@media (max-width: 480px) {
  .header { padding: 8px 10px; }
  .header h1 { font-size: 0.9rem; }
  .container { padding: 0 8px 80px; }
  .question, .archive-card { padding: 14px; }
  .archive-body { padding: 10px 12px; }
}

/* =====================================================================
   Feature-Module (U7/U9–U18)
   ===================================================================== */

/* --- U10 Voting ---------------------------------------------------- */

.vote-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--surface-muted);
  color: var(--text-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  min-height: 28px;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, transform 80ms ease;
  font-variant-numeric: tabular-nums;
  touch-action: manipulation;
}
.vote-button:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary-soft);
}
.vote-button:active { transform: scale(0.96); }
.vote-button.voted {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.vote-button.voted:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.vote-button .vote-icon { display: inline-flex; line-height: 0; }
.vote-button .vote-count { min-width: 14px; text-align: center; }

/* --- U11 Anhänge — Upload-Block (Wünsche-Tab) ----------------------- */

.attachment-block { margin-top: 10px; }

/* v52: Compact-Variante für Comment-Input und Admin-Quick-Reply.
   Kleinere Dropzone, weniger visuelle Last in dichten Listen-Karten. */
.archive-comment-attach.is-compact .attachment-dropzone,
.quick-reply-attach.is-compact .attachment-dropzone {
  flex-direction: row;
  padding: 6px 10px;
  font-size: 0.78rem;
  gap: 8px;
  text-align: left;
  border-style: dashed;
  border-width: 1px;
}
.archive-comment-attach.is-compact .attachment-dropzone-hint,
.quick-reply-attach.is-compact .attachment-dropzone-hint {
  display: none;
}
.archive-comment-attach { margin-top: 6px; }
.quick-reply-attach { margin-top: 6px; }

/* v52: Anhänge unter einem Kommentar (parallel zu .attachment-list, etwas kompakter). */
.archive-comment-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 0;
}
.archive-comment-attachments .attachment-item.attachment-image {
  width: 86px;
  height: 86px;
}
.archive-comment-attachments .attachment-link {
  padding: 6px 10px;
  font-size: 0.78rem;
}
.archive-comment-attachments .attachment-name { max-width: 160px; }

.attachment-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 16px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-light);
  cursor: pointer;
  background: var(--surface-muted);
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
  text-align: center;
  font-size: 0.84rem;
}
.attachment-dropzone:hover,
.attachment-dropzone:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}
.attachment-dropzone.drag-over {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
.attachment-dropzone-icon { color: var(--primary); }
.attachment-dropzone-text { font-weight: 500; }
.attachment-dropzone-hint { font-size: 0.74rem; color: var(--text-mute); }

.attachment-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.attachment-preview:empty { display: none; }

.attachment-pending {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.attachment-pending-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-light);
}
.attachment-pending-thumb img { width: 100%; height: 100%; object-fit: cover; }
.attachment-pending-meta { flex: 1; min-width: 0; }
.attachment-pending-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attachment-pending-size { font-size: 0.72rem; color: var(--text-mute); font-variant-numeric: tabular-nums; }
.attachment-pending-remove {
  background: transparent;
  border: none;
  color: var(--text-mute);
  cursor: pointer;
  font-size: 1.2rem;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  line-height: 1;
  flex-shrink: 0;
}
.attachment-pending-remove:hover { color: var(--danger); background: var(--danger-soft); }

/* --- U11 Anhänge — bestehende (Archive-Card) ------------------------ */

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 4px;
}
.attachment-item {
  position: relative;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 140ms ease;
}
.attachment-item:hover { border-color: var(--border-strong); }
.attachment-item.attachment-image {
  width: 110px;
  height: 110px;
}
.attachment-item.attachment-image a { display: block; width: 100%; height: 100%; }
.attachment-item.attachment-image img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
}
.attachment-link:hover .attachment-name { color: var(--primary); }
.attachment-name { font-weight: 500; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-size { color: var(--text-mute); font-size: 0.74rem; font-variant-numeric: tabular-nums; }
.attachment-icon { color: var(--text-light); display: inline-flex; }
.attachment-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border);
  color: var(--danger);
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0;
  transition: opacity 140ms ease, background 140ms ease;
}
.attachment-item:hover .attachment-delete,
.attachment-delete:focus-visible { opacity: 1; }
.attachment-delete:hover { background: var(--danger-soft); }

/* v21: Eintrag-Löschen-Button (Card-Head, rechts neben dem Datum) */
.wish-delete {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-mute);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}
.wish-delete:hover {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-soft);
}
.wish-delete:focus-visible {
  outline: 2px solid var(--danger);
  outline-offset: 2px;
}
.wish-delete svg { width: 15px; height: 15px; }

/* --- U12 Status-Workflow ------------------------------------------- */

.archive-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
}
.status-segmented {
  display: inline-flex;
  flex-wrap: wrap;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 0;
}
.status-seg-btn {
  background: transparent;
  border: none;
  color: var(--text-light);
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-family: inherit;
  transition: background 140ms ease, color 140ms ease;
  touch-action: manipulation;
  min-height: 28px;
}
.status-seg-btn:hover { background: rgba(255,255,255,0.6); color: var(--text); }
.status-seg-btn.is-active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.status-seg-btn.is-active.status-seg-resolved { color: var(--success); }
.status-seg-btn.is-active.status-seg-in_progress { color: #92400e; }

.status-change-form {
  flex-basis: 100%;
  margin-top: 8px;
  padding: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.status-change-head { font-size: 0.85rem; margin-bottom: 6px; }
.status-change-reason-label { font-size: 0.78rem; color: var(--text-light); display: block; margin-bottom: 4px; }
.status-change-reason {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.86rem;
  resize: vertical;
  background: var(--card);
  color: var(--text);
}
.status-change-reason:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.status-change-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

.status-info {
  font-size: 0.8rem;
  color: var(--text-light);
  padding: 4px 10px;
  background: var(--surface-muted);
  border-radius: var(--radius-pill);
}
/* --- U14 Admin-Notes ------------------------------------------------ */

.card-admin-notes-slot:empty { display: none; }
.card-admin-notes-slot {
  margin: 8px 0 12px;
  padding: 12px;
  background: var(--warning-soft);
  border: 1px solid #fcd34d;
  border-radius: var(--radius-md);
  font-size: 0.83rem;
}
.admin-notes-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: #92400e;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-notes-icon { display: inline-flex; }
.admin-notes-count {
  background: #fcd34d;
  color: #78350f;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
}
.admin-notes-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.admin-notes-empty { font-style: italic; color: #92400e; opacity: 0.8; font-size: 0.78rem; }

.admin-note {
  background: rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.admin-note-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: #92400e;
  margin-bottom: 2px;
}
.admin-note-author { font-weight: 600; }
.admin-note-date { font-size: 0.72rem; }
.admin-note-edited { color: var(--text-mute); font-style: italic; }
.admin-note-actions { margin-left: auto; display: inline-flex; gap: 2px; }
.admin-note-edit, .admin-note-delete {
  background: transparent;
  border: none;
  color: #92400e;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.admin-note-edit:hover { background: rgba(146, 64, 14, 0.12); }
.admin-note-delete:hover { color: var(--danger); background: var(--danger-soft); }
.admin-note-text { color: var(--text); font-size: 0.84rem; line-height: 1.45; overflow-wrap: anywhere; }
.admin-note-edit-input { margin-top: 6px; }
.admin-note-edit-input textarea {
  width: 100%;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 0.84rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  resize: vertical;
  /* v27-fix: explizite Farben — sonst schwarze Schrift / weißer Kasten im Dark-Mode */
  background: var(--card);
  color: var(--text);
}
.admin-note-edit-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }

.admin-note-input {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.admin-note-input textarea {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.84rem;
  resize: none;
  field-sizing: content;
  background: var(--card);
  /* v27-fix: Textareas erben color NICHT — ohne dies steht im Dark-Mode
     schwarze Schrift auf dunklem Grund. Wie beim Kommentar-Feld. */
  color: var(--text);
}
.admin-note-input textarea:focus {
  outline: none;
  border-color: #92400e;
  box-shadow: 0 0 0 3px rgba(146, 64, 14, 0.15);
}

/* --- U15 Bulk-Resolve ---------------------------------------------- */

.bulk-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: -8px 0 8px;
}
.bulk-toggle.is-active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.card-bulk-slot { display: inline-flex; align-items: center; }
.bulk-checkbox-wrap { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.bulk-checkbox { position: absolute; opacity: 0; pointer-events: none; }
.bulk-checkbox-visual {
  width: 20px;
  height: 20px;
  display: inline-block;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  position: relative;
  transition: background 140ms ease, border-color 140ms ease;
}
.bulk-checkbox-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center/14px no-repeat;
  opacity: 0;
  transition: opacity 140ms ease;
}
.bulk-checkbox:checked + .bulk-checkbox-visual {
  background: var(--primary);
  border-color: var(--primary);
}
.bulk-checkbox:checked + .bulk-checkbox-visual::after { opacity: 1; }
.bulk-checkbox:focus-visible + .bulk-checkbox-visual {
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.archive-card.is-bulk-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.bulk-action-bar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elev);
  padding: 10px 14px;
  z-index: 50;
  max-width: calc(100vw - 24px);
  /* AUDIT-F10: bei vielen Buttons / kleinem Screen Scrolling statt
     Overflow ins Viewport — Bar bleibt immer komplett sichtbar. */
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

/* Sticky Bulk-Bar: Body-Padding-Bottom, damit der letzte Inhalt nicht
   von der fixen Action-Bar verdeckt wird. */
body.bulk-bar-open { padding-bottom: 110px; }
.bulk-action-bar .bulk-count {
  font-weight: 600;
  color: var(--text);
  font-size: 0.86rem;
}
.bulk-action-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.bulk-status-label { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--text-light); }
.bulk-status-label select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.82rem;
  background: var(--card);
  color: var(--text);
}
.bulk-status-label select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

/* --- U16 Quick-Reply ----------------------------------------------- */

.quick-reply-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.quick-reply-icon { display: inline-flex; }
.quick-reply-form {
  flex-basis: 100%;
  margin-top: 8px;
  padding: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.quick-reply-label { display: block; font-size: 0.78rem; color: var(--text-light); margin-bottom: 4px; }
.quick-reply-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  resize: vertical;
  background: var(--card);
}
.quick-reply-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.quick-reply-options { margin-top: 8px; font-size: 0.82rem; }
.quick-reply-status-label { display: inline-flex; align-items: center; gap: 6px; color: var(--text-light); }
.quick-reply-status-label select {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-family: inherit;
  font-size: 0.82rem;
}
.quick-reply-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* Quick-Reply Comment-Variante */
.archive-comment.is-admin-reply {
  background: var(--primary-soft);
  border-left: 3px solid var(--primary);
}
.archive-comment.is-admin-reply .archive-comment-author { color: var(--primary); }
.badge-admin-reply {
  background: var(--primary);
  color: #fff;
  font-size: 0.66rem;
  padding: 1px 6px;
}

/* --- U17 Stats-Dashboard ------------------------------------------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.kpi-label {
  font-size: 0.78rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.kpi-card.stat-open .kpi-value { color: var(--text); }
.kpi-card.stat-in_progress .kpi-value { color: #92400e; }
.kpi-card.stat-resolved .kpi-value { color: var(--success); }
.kpi-card.stat-avg .kpi-value { font-size: 1.25rem; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.stats-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
}
.stats-panel-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.stats-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.stats-list-item { margin: 0; }
.stats-list-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text);
  transition: background 140ms ease;
}
.stats-list-link:hover { background: var(--surface-muted); }
.stats-list-subject { flex-shrink: 0; }
.stats-list-text {
  flex: 1;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stats-list-meta {
  flex-shrink: 0;
  color: var(--text-light);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}
.stats-list-empty {
  text-align: center;
  color: var(--text-light);
  padding: 20px;
  font-size: 0.84rem;
}

.stats-recent-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.recent-cell { text-align: center; }
.recent-num { font-size: 1.4rem; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.recent-label { font-size: 0.74rem; color: var(--text-light); }

.stats-bars { display: flex; flex-direction: column; gap: 8px; }
.stats-bar-row {
  display: grid;
  grid-template-columns: 80px 1fr 40px;
  gap: 10px;
  align-items: center;
  font-size: 0.82rem;
}
.stats-bar-label { color: var(--text); font-weight: 500; }
.stats-bar-track {
  height: 10px;
  background: var(--surface-muted);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.stats-bar-fill {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-pill);
  transition: width 320ms ease;
}
.stats-bar-fill.stats-bar-problem { background: var(--subject-problem-fg); }
.stats-bar-fill.stats-bar-anfrage { background: var(--subject-anfrage-fg); }
.stats-bar-fill.stats-bar-wunsch { background: #c2870a; }
/* v13-1: by_app Bar-Chart */
.stats-bar-fill.stats-bar-app { background: var(--primary); }
.stats-bar-fill.stats-bar-app-none { background: var(--text-mute); }
.stats-bar-row.is-none .stats-bar-label {
  color: var(--text-light);
  font-style: italic;
}

/* v13-2: Audit-Log Tabelle */
.stats-audit-panel { grid-column: 1 / -1; }
.stats-audit-count {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-light);
  margin-left: 8px;
}
.stats-audit-filters {
  display: flex;
  gap: 8px;
  margin-bottom: var(--space-3);
}
.stats-audit-list { overflow-x: auto; }
.audit-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.audit-log-table th {
  text-align: left;
  font-weight: 600;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
  position: sticky;
  top: 0;
}
.audit-log-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text);
}
.audit-log-table tr:hover td { background: var(--surface-muted); }
.audit-log-table .audit-when {
  color: var(--text-light);
  white-space: nowrap;
}
.audit-log-table .audit-actor {
  font-weight: 500;
  white-space: nowrap;
}
.audit-log-table .audit-action code {
  background: var(--primary-soft);
  color: var(--primary);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
}
.audit-log-table .audit-target {
  color: var(--text-light);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.audit-log-table .audit-payload code {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--text-light);
  word-break: break-word;
}
@media (max-width: 640px) {
  .audit-log-table th:nth-child(2),
  .audit-log-table td:nth-child(2) { display: none; }
  .audit-log-table .audit-payload code { font-size: 0.72rem; }
}
.stats-bar-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-light);
  font-size: 0.82rem;
}

/* --- U9 Submit-Bestätigung ----------------------------------------- */

.submit-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 12px 8px;
  gap: 8px;
}
.submit-success-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: submit-pop 360ms ease-out;
}
.submit-success-icon svg { width: 24px; height: 24px; }
.submit-success-title { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.submit-success-hint { font-size: 0.82rem; color: var(--text-light); }
.submit-success-reset { margin-top: 6px; }

@keyframes submit-pop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* --- U18 Deeplink-Highlight ---------------------------------------- */

@keyframes wish-pulse {
  0% { background: var(--card); box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.7); }
  35% { background: var(--warning-soft); box-shadow: 0 0 0 6px rgba(217, 119, 6, 0); }
  100% { background: var(--card); box-shadow: 0 0 0 0 rgba(217, 119, 6, 0); }
}
.archive-card.wish-highlight {
  animation: wish-pulse 1.6s ease-out;
}

/* --- U7 Markdown-light inline ------------------------------------- */

.archive-body code,
.archive-comment-text code,
.admin-note-text code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: rgba(0, 0, 0, 0.05);
  padding: 1px 5px;
  border-radius: 4px;
}
.archive-body a,
.archive-comment-text a,
.admin-note-text a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}
.archive-body a:hover,
.archive-comment-text a:hover,
.admin-note-text a:hover { color: var(--primary-hover); }

/* --- Sort-Select im Toolbar ---------------------------------------- */

.archive-toolbar-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.archive-sort-label {
  font-size: 0.76rem;
  color: var(--text-light);
}
.archive-sort {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.78rem;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  min-height: 28px;
}
.archive-sort:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

/* --- Status-Badge in card-top -------------------------------------- */
.badge.badge-status { letter-spacing: 0.02em; }

/* Responsive Anpassungen für neue Module --------------------------- */

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-recent-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-row { grid-template-columns: 1fr; }

  .bulk-action-bar {
    left: 8px;
    right: 8px;
    transform: none;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
  }
  .bulk-action-controls { justify-content: flex-end; }

  /* Bar ist auf Mobile gestapelt + höher → mehr Body-Padding nötig. */
  body.bulk-bar-open { padding-bottom: 220px; }

  .attachment-preview { grid-template-columns: 1fr; }
  .attachment-item.attachment-image { width: 90px; height: 90px; }

  .status-segmented { width: 100%; }
  .status-seg-btn { flex: 1; }

  .archive-toolbar-sort { width: 100%; margin-left: 0; }
  .archive-sort { flex: 1; }

  /* Touch-Targets >= 40px */
  .vote-button, .status-seg-btn, .archive-sort,
  .bulk-checkbox-visual { min-height: 36px; }
  .bulk-checkbox-visual { width: 24px; height: 24px; }
}

/* Reduced motion ----------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .btn-enter,
  .toast-item,
  .archive-card,
  .archive-resolve,
  .tab,
  .skeleton-bar,
  .vote-button,
  .stats-bar-fill,
  .submit-success-icon {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
  .archive-card.wish-highlight { animation: none !important; }
}

/* Kanban-Board (v24) -------------------------------------------------- */

.board-hint {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: var(--space-3);
}
.board-columns {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(250px, 1fr);
  gap: var(--space-3);
  align-items: start;
  overflow-x: auto;
  padding-bottom: 6px; /* Platz für die Scrollbar, damit Karten nicht abschneiden */
}
.board-column {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  min-height: 120px;
}
.board-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  font-weight: 600;
  font-size: 0.85rem;
}
.board-col-open        { border-bottom-color: var(--status-open-fg); }
.board-col-in_progress { border-bottom-color: var(--status-progress-fg); }
.board-col-resolved    { border-bottom-color: var(--status-resolved-fg); }
.board-column-count {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 1px 9px;
  font-size: 0.76rem;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
}
.board-column-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
  transition: background 120ms ease;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.board-column-body.board-drop-over {
  background: var(--primary-soft);
  outline: 2px dashed var(--primary);
  outline-offset: -4px;
}
.board-empty { color: var(--text-mute); text-align: center; padding: 12px 0; font-size: 0.8rem; }

.board-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: box-shadow 120ms ease, transform 120ms ease;
}
.board-card[draggable="true"] { cursor: grab; }
.board-card:hover { box-shadow: var(--shadow-elev); }
.board-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.board-card-dragging { opacity: 0.5; }
.board-card-badges { display: flex; flex-wrap: wrap; gap: 4px; max-width: 100%; }
/* Lange App-Slugs (z.B. arbeitsvertragsgenerator) dürfen die Karte nicht sprengen. */
.board-card-badges .badge-app {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* v54: Text über mehrere Zeilen zeigen (skaliert mit der Spaltenbreite) statt hart
   bei 90 Zeichen zu kappen. line-clamp begrenzt die Höhe, damit die Karten scanbar
   bleiben; bei breiteren Spalten passt mehr pro Zeile → mehr sichtbarer Text. */
.board-card-text {
  font-size: 0.84rem;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.board-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-light);
}
.board-card-votes { color: var(--primary); font-variant-numeric: tabular-nums; }
/* v52: Bild-Anhang-Indikator auf der Board-Karte — dezent, rechtsbündig in der Badge-Zeile. */
.board-card-attach {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  color: var(--text-light);
  flex-shrink: 0;
}
.board-card-attach svg { display: block; }
.board-card-attach-count { font-size: 0.72rem; font-variant-numeric: tabular-nums; line-height: 1; }
/* v53: rechte Fuß-Gruppe (Votes + Löschen) + dezenter Lösch-Button auf der Karte. */
.board-card-foot-right { display: inline-flex; align-items: center; gap: 6px; }
.board-card-delete {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-mute);
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}
.board-card-delete:hover {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-soft);
}
.board-card-delete:focus-visible { outline: 2px solid var(--danger); outline-offset: 2px; }
.board-card-delete svg { width: 14px; height: 14px; display: block; }
/* v30: das v25-Status-Select der Board-Karte wurde entfernt — Status ändert
   man jetzt per Drag&Drop oder im Detail-Pop-up. */

@media (max-width: 760px) {
  .board-columns {
    grid-auto-columns: 85%;
    scroll-snap-type: x mandatory;
  }
  .board-column { scroll-snap-align: start; }
}

/* v25: Dark-Mode-Overrides für Admin-Notes (hartcodierte Gelb/Braun-Werte
   waren auf dunklem Grund unlesbar). Light-Mode bleibt unverändert. */
:root[data-theme="dark"] .card-admin-notes-slot { border-color: var(--warning); }
:root[data-theme="dark"] .admin-notes-header,
:root[data-theme="dark"] .admin-notes-empty,
:root[data-theme="dark"] .admin-note-head,
:root[data-theme="dark"] .admin-note-edit,
:root[data-theme="dark"] .admin-note-delete { color: var(--warning); }
:root[data-theme="dark"] .admin-notes-count { background: var(--warning); color: #0b1220; }
:root[data-theme="dark"] .admin-note { background: rgba(255, 255, 255, 0.06); }
:root[data-theme="dark"] .admin-note-text { color: var(--text); }

/* v26: Restliche hartcodierte Hell-Werte für den Dark-Mode überschreiben.
   Diese Stellen hatten weiße/hellgrüne Hex-Backgrounds ohne Dark-Override —
   im Dark-Mode entstanden dadurch weiße Banner und unsichtbare Tints. */

/* Header: war rgba(255,255,255,0.88) (weiß) → dunkles, leicht transparentes
   Navy. Stellt zugleich den Kontrast der Sonne/Theme-Toggle wieder her. */
:root[data-theme="dark"] .header { background: rgba(11, 18, 32, 0.85); }
/* Sonne klar sichtbar auf dunklem Banner */
:root[data-theme="dark"] .theme-toggle { color: var(--text); }

/* Erledigt-Button: hartcodierte Hellgrüns → Tokens */
:root[data-theme="dark"] .archive-resolve:hover {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success);
}
:root[data-theme="dark"] .archive-resolve.done {
  border-color: var(--success);
  color: var(--success);
}

/* Admin-Notes-Slot: Hintergrund war #fffbeb (hellgelb) → dunkler Warnton.
   (v25 hatte nur border-color gesetzt, der helle Grund blieb.) */
:root[data-theme="dark"] .card-admin-notes-slot {
  background: var(--warning-soft);
  border-color: var(--warning);
}

/* Attachment-Delete-Button: schwebt über Vorschau, war weiß → dunkel */
:root[data-theme="dark"] .attachment-delete { background: rgba(19, 28, 46, 0.85); }

/* Status-Segment-Hover: war rgba(255,255,255,0.6) → dezent hell auf dunkel */
:root[data-theme="dark"] .status-seg-btn:hover { background: rgba(255, 255, 255, 0.08); }

/* =====================================================================
   v30: Suchbares Dropdown (Combobox) — makeSearchable()
   Token-basiert, daher Dark-Mode-tauglich ohne Extra-Overrides.
   ===================================================================== */
.sebu { position: relative; display: inline-block; min-width: 180px; }
.sebu-native { display: none; }            /* natives <select> versteckt, bleibt Source-of-Truth */
.wish-form-row .sebu { display: block; width: 100%; }   /* im Formular volle Breite */

.sebu-trigger {
  width: 100%;
  text-align: left;
  padding: 8px 30px 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  min-height: 38px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.sebu-trigger::after {
  content: "";
  position: absolute;
  right: 12px; top: 50%;
  width: 0; height: 0;
  margin-top: -2px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--text-light);
}
.sebu-trigger:hover { border-color: var(--border-strong); }
.sebu-trigger:focus-visible,
.sebu-trigger[aria-expanded="true"] {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.sebu-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  min-width: 200px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elev);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* v30-fix: ohne diesen Override greift das hidden-Attribut nicht (display:flex
   schlägt die UA-Regel [hidden]{display:none}) — das Panel war dauerhaft offen. */
.sebu-panel[hidden] { display: none; }
.sebu-search {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  background: var(--surface-muted);
  color: var(--text);
}
.sebu-search:focus { outline: none; border-color: var(--primary); }
.sebu-list {
  list-style: none;
  margin: 0; padding: 0;
  max-height: 240px;
  overflow-y: auto;
}
.sebu-option {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sebu-option.is-active { background: var(--primary-soft); }
.sebu-option.is-selected { font-weight: 600; }
.sebu-option:hover { background: var(--surface-muted); }
.sebu-list:empty::after {
  content: "Keine Treffer";
  display: block;
  padding: 8px 10px;
  color: var(--text-mute);
  font-size: 0.84rem;
  font-style: italic;
}

/* =====================================================================
   v30: Board-Toolbar (App-Filter im Kanban)
   ===================================================================== */
.board-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.board-filter-label { font-size: 0.82rem; color: var(--text-light); font-weight: 500; }
.board-app-filter {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  min-height: 38px;
}

/* =====================================================================
   v30: Board-Detail-Pop-up (Modal)
   ===================================================================== */
body.modal-open { overflow: hidden; }
/* v53: Nur fürs Board-Modal — friert die Scroll-Position ein (position:fixed +
   negatives top), statt sie beim Öffnen zu verlieren. Bewusst getrennt von
   modal-open, damit andere Modals unverändert bleiben. */
body.modal-scroll-lock { position: fixed; width: 100%; left: 0; }
.board-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(2, 6, 18, 0.55);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}
.board-modal-overlay[hidden] { display: none; }   /* überschreibt display:flex */
.board-modal {
  position: relative;
  width: 100%;
  max-width: 720px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elev);
  padding: 20px 18px 18px;
  animation: board-modal-in 140ms ease-out;
}
@keyframes board-modal-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.board-modal-close {
  position: absolute;
  top: 8px; right: 10px;
  width: 32px; height: 32px;
  border: none;
  background: transparent;
  color: var(--text-light);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--radius-md);
  z-index: 1;
}
.board-modal-close:hover { background: var(--surface-muted); color: var(--text); }
.board-modal-close:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Karte im Modal randlos einbetten — das Overlay liefert schon den Rahmen. */
.board-modal-body .archive-card { margin: 0; border: none; box-shadow: none; padding: 0; }
@media (prefers-reduced-motion: reduce) {
  .board-modal { animation: none; }
}

/* v53: Generischer Bestätigungs-Dialog (z.B. "Wirklich löschen?").
   z-index 300 liegt über dem Board-Pop-up (200), damit die Bestätigung
   auch aus dem geöffneten Fall heraus sichtbar ist. */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(2, 6, 18, 0.55);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.confirm-dialog {
  width: 100%;
  max-width: 420px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elev);
  padding: 22px 22px 18px;
  animation: board-modal-in 140ms ease-out;
}
.confirm-title { margin: 0 0 8px; font-size: 1.05rem; font-weight: 650; color: var(--text); }
.confirm-message { margin: 0 0 18px; font-size: 0.9rem; line-height: 1.45; color: var(--text-light); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
@media (prefers-reduced-motion: reduce) {
  .confirm-dialog { animation: none; }
}

/* =====================================================================
   v30: Benachrichtigungen / Abo-Verwaltung
   ===================================================================== */
.sub-intro { margin-bottom: 16px; }
.sub-title { font-size: 1.15rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.sub-desc { font-size: 0.88rem; color: var(--text-light); line-height: 1.5; }
.sub-add {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
}
.sub-add-field { display: flex; flex-direction: column; gap: 4px; min-width: 180px; }
.sub-add-label { font-size: 0.78rem; font-weight: 600; color: var(--text-light); }
.sub-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  min-height: 38px;
}
.sub-add-btn { min-height: 38px; }
.sub-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sub-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
}
.sub-item-text { font-size: 0.9rem; color: var(--text); }
.sub-delete {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: inline-flex;
}
.sub-delete:hover { background: var(--danger-soft); color: var(--danger); }
.sub-delete:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sub-empty {
  padding: 14px;
  color: var(--text-mute);
  font-style: italic;
  font-size: 0.86rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

/* =====================================================================
   v37: Externe Apps — Admin-Verwaltung im Abo-Tab
   Visuell von den Abos durch border-top abgesetzt, restliche Tokens
   wiederverwendet (kein hartcodierter Hex → Dark-Mode greift automatisch).
   ===================================================================== */
.sub-external-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.sub-external-head { margin-bottom: 14px; }
.sub-external-title { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.sub-external-desc { font-size: 0.86rem; color: var(--text-light); line-height: 1.5; }
.sub-external-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  font-size: 0.86rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.sub-external-filter:hover { background: var(--primary-soft); }
.sub-external-filter input[type="checkbox"] { cursor: pointer; }
.sub-external-add {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 8px;
}
.sub-external-add-field { display: flex; flex-direction: column; gap: 4px; min-width: 180px; flex: 1; }
.sub-external-input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  min-height: 38px;
}
.sub-external-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.sub-external-hint {
  font-size: 0.78rem;
  color: var(--text-mute);
  margin: 4px 0 12px;
  line-height: 1.45;
}
.sub-external-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sub-external-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.sub-external-text { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sub-external-name { color: var(--text); font-size: 0.92rem; }
.sub-external-slug {
  display: inline-block;
  padding: 2px 6px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 4px;
  font-size: 0.78rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
/* v37-Review: --primary-soft im Dark-Mode ist sehr transparent (rgba 0.15);
   das ergab Kontrast knapp unter WCAG-AA. Opazität auf 0.28 + helleres
   Text-Blau (Tailwind blue-300) bringt den Kontrast deutlich über 4.5:1. */
:root[data-theme="dark"] .sub-external-slug {
  background: rgba(96, 165, 250, 0.28);
  color: #bfdbfe;
}
.sub-external-actions { display: inline-flex; gap: 6px; flex-shrink: 0; align-items: center; }
/* v37d: Inline-Abo-Toggle pro externer App. Visuell ein Chip — nimmt weniger
   Platz als ein Button, ist aber gut tastbar (Hit-Area >32px). */
.sub-external-sub-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  font-size: 0.8rem;
  color: var(--text-light);
  cursor: pointer;
  user-select: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.sub-external-sub-toggle:hover { background: var(--primary-soft); color: var(--primary); }
.sub-external-sub-toggle:has(input:checked) {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}
.sub-external-sub-toggle:has(input:disabled) {
  opacity: 0.6;
  cursor: not-allowed;
}
.sub-external-sub-cb { cursor: inherit; }
.sub-external-edit,
.sub-external-delete {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  color: var(--text-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 140ms ease, color 140ms ease;
}
.sub-external-edit:hover { background: var(--primary-soft); color: var(--primary); }
.sub-external-delete:hover { background: var(--danger-soft); color: var(--danger); }
.sub-external-edit:focus-visible,
.sub-external-delete:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* =====================================================================
   v35: Benachrichtigungs-Präferenz im Submit-Formular (Bell + 3 Checkboxen)
   ===================================================================== */
.wish-notify { margin: 4px 0 2px; }
.wish-notify-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-light);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 34px;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.wish-notify-toggle:hover,
.wish-notify-toggle[aria-expanded="true"] {
  background: var(--surface-muted);
  border-color: var(--border-strong);
  color: var(--text);
}
.wish-notify-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.wish-notify-bell { width: 16px; height: 16px; flex-shrink: 0; }
.wish-notify-count { color: var(--text-mute); font-variant-numeric: tabular-nums; font-size: 0.78rem; }
.wish-notify-chevron { color: var(--text-mute); font-size: 0.8rem; }

.wish-notify-panel {
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wish-notify-panel[hidden] { display: none; }   /* sonst greift hidden nicht (display:flex) */
.wish-notify-hint { font-size: 0.8rem; color: var(--text-light); margin: 0 0 2px; }
.wish-notify-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
}
.wish-notify-opt input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }
