:root {
  --bg: #f6f5f0;
  --surface: #ffffff;
  --surface2: #fafaf6;
  --border: rgba(0,0,0,0.09);
  --border2: rgba(0,0,0,0.16);
  --text1: #1c1b18;
  --text2: #5a5955;
  --text3: #9a9892;
  --accent: #1D9E75;
  --accent-light: #E1F5EE;
  --accent-dark: #0a5c43;
  --danger: #D85A30;
  --warn: #EF9F27;
  /* Höhe der Tab-Zeile (Icon + Beschriftung, ohne Home-Indicator) — an Mitai/iOS-Tabbar angelehnt */
  --nav-h: 58px;
  --nav-pad-top: 10px;
  --header-h: 52px;
  --font: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --capture-content-max: 800px;
  --desktop-sidebar-width: 220px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #181816; --surface: #222220; --surface2: #1e1e1c;
    --border: rgba(255,255,255,0.08); --border2: rgba(255,255,255,0.14);
    --text1: #eeecea; --text2: #aaa9a4; --text3: #686762;
    --accent-light: #04342C; --accent-dark: #5DCAA5;
  }
  .bottom-nav {
    box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.55);
  }
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #root { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text1); -webkit-text-size-adjust: 100%; }

/* Mobile / Web-App: keine horizontale Seiten-Scroll-Leiste; volle Gerätebreite (<1024px) */
@media (max-width: 1023px) {
  html {
    overflow-x: clip;
  }
  body,
  #root {
    overflow-x: clip;
    max-width: 100%;
  }
}

/* Telefon & Tablet hochkant: volle Breite wie eine native App (kein 600px-Säulen-Layout) */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  margin: 0;
}
.app-header {
  height: var(--header-h); display: flex; align-items: center; padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
/* iPhone: Web-App (standalone) / Safari mit viewport-fit=cover — Kopf unter Statusleiste ausrichten */
@media (max-width: 1023px) {
  .app-header.app-header--mobile {
    height: auto;
    min-height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
}
.app-header--mobile-stack {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  padding-bottom: 10px;
}
.app-header-mobile__top {
  display: flex;
  align-items: center;
  min-height: var(--header-h);
}
.app-logo { font-size: 18px; font-weight: 700; color: var(--accent); letter-spacing: -0.02em; }

.active-club-switch {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.active-club-switch__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text2);
}
.active-club-switch__select {
  width: 100%;
  font-size: 0.875rem;
  padding: 0.4rem 0.5rem;
}
.active-club-switch--sidebar {
  width: 100%;
  padding-bottom: 4px;
}
.active-club-switch--mobile {
  width: 100%;
}

/* === Seiten-Inhalt: volle Breite der Spalte, kein künstlicher Max-Wert auf großen Screens === */
.app-page {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
/* Form-Grids: minmax(0,…) verhindert Grid-Overflow; eine Spalte bis zum ersten Breakpoint */
.responsive-grid-2 {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 480px) {
  .responsive-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.responsive-grid-3 {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 560px) {
  .responsive-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.responsive-grid-4 {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 560px) {
  .responsive-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 900px) {
  .responsive-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
/* unten: Tab-Leiste + Abstand nach oben zur Leiste + Home-Indicator (iPhone) */
.app-main {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
  overflow-y: auto;
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(var(--nav-h) + var(--nav-pad-top) + env(safe-area-inset-bottom, 0px) + 20px) max(16px, env(safe-area-inset-left, 0px));
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: auto;
  max-width: none;
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
  z-index: 20;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  justify-content: flex-start;
  gap: 4px;
  padding: var(--nav-pad-top) max(10px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(10px, env(safe-area-inset-left, 0px));
  min-height: calc(var(--nav-h) + var(--nav-pad-top) + env(safe-area-inset-bottom, 0px));
  height: auto;
  box-sizing: border-box;
}
.bottom-nav::-webkit-scrollbar {
  display: none;
}
.nav-item {
  flex: 0 0 auto;
  min-width: 68px;
  max-width: 108px;
  min-height: 48px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text3);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s;
  padding: 6px 10px 8px;
  box-sizing: border-box;
  scroll-snap-align: center;
  -webkit-tap-highlight-color: transparent;
}
.nav-item span {
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  max-width: 100%;
  letter-spacing: 0.01em;
}
.nav-item.active { color: var(--accent); }
.nav-item svg { flex-shrink: 0; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
/* Vertikaler Rhythmus nur im normalen Blockfluss — in Grids/Flex mit gap stört margin-top zwischen Geschwistern */
.card + .card { margin-top: 12px; }
ul > li.card + li.card,
.exercises-list-grid > .card + .card,
.ref-value-tiles-grid > .card + .card,
.skills-page__card-grid > .card + .card,
.dashboard-training-grid > .card + .card,
.framework-slots-board > .card + .card,
[class*="slots-board"] > .card + .card,
.card-grid > .card + .card,
.clubs-groups-card-grid > .card + .card {
  margin-top: 0;
}
/* Optional: Raster für Karten (Abstände nur über gap); Spalten per Modifier oder inline grid-template-columns */
.card-grid {
  display: grid;
  gap: 14px;
  align-items: stretch;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
.card-title { font-size: 13px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.stat-val { font-size: 26px; font-weight: 700; color: var(--text1); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text3); margin-top: 3px; }
.stat-delta { font-size: 12px; font-weight: 600; margin-top: 4px; }
.delta-pos { color: var(--accent); }
.delta-neg { color: var(--danger); }

/* Form - STANDARD: Label oben, volle Breite, linksbündig */
.form-section { margin-bottom: 20px; }
.form-section-title {
  font-size: 13px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}

/* Standard Form Row: Label oben, Input darunter, volle Breite */
.form-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 0;
  margin-bottom: 16px;
  min-width: 0;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text1);
  text-align: left;
  line-height: 1.3;
}

.form-sub {
  font-size: 11px;
  color: var(--text3);
  display: block;
  margin-top: 2px;
}

/* Rechtstexte (P-01): Markdown im Fließtext */
.legal-doc-body {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text1);
}
.legal-doc-body--muted {
  color: var(--text3);
  font-style: italic;
}
.legal-doc-body p {
  margin: 0 0 0.65em;
}
.legal-doc-body p:last-child {
  margin-bottom: 0;
}
.legal-doc-body ul,
.legal-doc-body ol {
  margin: 0.4em 0 0.65em 1.25rem;
  padding: 0;
}
.legal-doc-body li {
  margin: 0.2em 0;
}
.legal-doc-body strong {
  font-weight: 700;
}
.legal-doc-body em {
  font-style: italic;
}
.legal-doc-body code {
  font-family: ui-monospace, monospace;
  font-size: 0.88em;
  background: var(--surface2);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
.legal-doc-body pre {
  background: var(--surface2);
  padding: 10px 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 0.65em 0;
  font-size: 0.85em;
}
.legal-doc-body pre code {
  background: none;
  padding: 0;
}
.legal-doc-body blockquote {
  margin: 0.5em 0;
  padding-left: 12px;
  border-left: 3px solid var(--border2);
  color: var(--text2);
}
.legal-doc-body a {
  color: var(--accent);
}
.legal-doc-body h1,
.legal-doc-body h2,
.legal-doc-body h3,
.legal-doc-body h4 {
  font-size: 1em;
  font-weight: 700;
  margin: 0.75em 0 0.35em;
}
.legal-doc-body h1:first-child,
.legal-doc-body h2:first-child,
.legal-doc-body h3:first-child {
  margin-top: 0;
}
.legal-doc-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.85em 0;
}

/* Admin: Rechtstext Editor — Live-Vorschau neben Textarea */
.legal-section-split {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}
@media (min-width: 720px) {
  .legal-section-split {
    flex-direction: row;
    align-items: flex-start;
  }
  .legal-section-split__editor {
    flex: 1;
    min-width: 0;
  }
  .legal-section-split__preview {
    flex: 1;
    min-width: 0;
  }
}
.legal-section-preview-box {
  padding: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 100px;
}
.legal-section-preview-box h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.45rem;
  color: var(--text1);
}

/* Modales Vorschau-Overlay (Rechtstexte Admin) */
.legal-preview-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px 24px;
  overflow-y: auto;
}
.legal-preview-modal {
  width: 100%;
  max-width: 760px;
  margin-top: 4vh;
  margin-bottom: 4vh;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  max-height: min(92vh, 960px);
  display: flex;
  flex-direction: column;
}
.legal-preview-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.legal-preview-modal__body {
  padding: 16px 18px 20px;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}

.form-input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  text-align: left;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  color: var(--text1);
  background: var(--surface2);
  border: 1.5px solid var(--border2);
  border-radius: 8px;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Textarea spezifisch */
textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

/* Select spezifisch */
select.form-input {
  cursor: pointer;
}

/* Inline-Variante für Ausnahmen (z.B. kurze Werte mit Einheit) */
.form-row--inline {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.form-row--inline .form-label {
  flex: 1;
  font-weight: 500;
}

.form-row--inline .form-input {
  width: 90px;
  text-align: right;
}

.form-unit {
  font-size: 12px;
  color: var(--text3);
  width: 24px;
}

/* Einstellungen Profil: Label als Überschrift oben, volle Breite, linksbündig */
.settings-page__field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.settings-page__field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text1);
  text-align: left;
  line-height: 1.3;
}
.settings-page__field .form-input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-align: left;
  box-sizing: border-box;
}
.form-select {
  font-family: var(--font); font-size: 13px; color: var(--text1);
  background: var(--surface2); border: 1.5px solid var(--border2);
  border-radius: 8px; padding: 7px 10px; width: 100%;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font); font-size: 14px; font-weight: 600;
  padding: 10px 18px; border-radius: 10px; border: none; cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: white; }
.btn-secondary { background: var(--surface2); border: 1px solid var(--border2); color: var(--text2); }
.btn-danger { background: #FCEBEB; color: var(--danger); }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; pointer-events: none; }

/* Badge */
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }

/* AI content */
.ai-content { font-size: 14px; line-height: 1.7; color: var(--text2); white-space: pre-wrap; }
.ai-content strong { color: var(--text1); font-weight: 600; }

/* Photo grid */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo-thumb { aspect-ratio: 1; border-radius: 8px; object-fit: cover; width: 100%; cursor: pointer; }

/* Tabs */
.tabs { display: flex; gap: 4px; background: var(--surface2); border-radius: 10px; padding: 3px; margin-bottom: 16px; }
.tab { flex: 1; text-align: center; padding: 7px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text3); cursor: pointer; border: none; background: transparent; font-family: var(--font); }
.tab.active { background: var(--surface); color: var(--text1); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* Section */
.section-gap { margin-bottom: 16px; }
.page-title { font-size: 20px; font-weight: 700; margin-bottom: 16px; }

/* Verlauf: Mobile Tabs horizontale Leiste, Desktop vertikal links (P4 / RESPONSIVE_UI §5.2) */
/* KPI-Kachel-Raster: gemeinsam für Verlauf Körper, Dashboard KPI-Board, …
   Desktop: title-Tooltip; Touch: ℹ → Bottom-Sheet (siehe KpiTilesOverview.jsx) */
.kpi-tiles-grid,
.body-kpi-overview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.kpi-tiles-card,
.body-kpi-card {
  background: var(--surface2);
  border-radius: 10px;
  padding: 10px 10px 10px 12px;
  border: 1px solid var(--border);
  cursor: help;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
@media (hover: none) {
  .kpi-tiles-card,
  .body-kpi-card {
    cursor: default;
  }
}
.kpi-tiles-card:hover,
.body-kpi-card:hover {
  border-color: var(--border2);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.07);
}

.kpi-tiles-info-btn,
.body-kpi-info-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text3);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.kpi-tiles-info-btn:active,
.body-kpi-info-btn:active {
  background: var(--surface);
  color: var(--accent);
}

.kpi-tiles-touch-backdrop,
.body-kpi-touch-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 12px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.45);
  animation: kpi-tiles-fade-in 0.15s ease;
}

@keyframes kpi-tiles-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes body-kpi-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.kpi-tiles-touch-sheet,
.body-kpi-touch-sheet {
  width: 100%;
  max-width: 520px;
  max-height: min(72vh, 560px);
  overflow: auto;
  margin: 0 auto;
  padding: 14px 16px 18px;
  border-radius: 16px 16px 0 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
}

.kpi-tiles-touch-sheet__head,
.body-kpi-touch-sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.kpi-tiles-touch-sheet__title,
.body-kpi-touch-sheet__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text1);
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}

.kpi-tiles-touch-sheet__close,
.body-kpi-touch-sheet__close {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  margin: -6px -8px 0 0;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text2);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.kpi-tiles-touch-sheet__close:active,
.body-kpi-touch-sheet__close:active {
  background: var(--surface2);
}

.kpi-tiles-touch-sheet__body,
.body-kpi-touch-sheet__body {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text2);
  white-space: pre-wrap;
  word-break: break-word;
}

.kpi-tiles-touch-sheet__body--muted,
.body-kpi-touch-sheet__body--muted {
  color: var(--text3);
  font-style: italic;
}

/* KPI: Kurz-Hinweis max. 2 Zeilen — Details weiter per ℹ */
.kpi-tiles-card__hint {
  max-height: 2.8em;
}

/* Verlauf Ernährung: Donut (Ø-Quote) + wöchentliche Makro-Verteilung (E3) */
.nutrition-macro-pair {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  align-items: stretch;
}

@media (min-width: 780px) {
  .nutrition-macro-pair {
    grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.25fr);
  }
}

.nutrition-macro-pair__weekly {
  min-width: 0;
}

/* Einheitliche Chart-Höhe (Donut-Bereich ≈ E3-Balken) */
.nutrition-macro-pair__chart-wrap {
  width: 100%;
  min-height: 260px;
}

.nutrition-macro-pair__donut-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.nutrition-macro-pair__donut-chart {
  width: 100%;
  min-height: 260px;
}

.nutrition-macro-pair__legend {
  width: 100%;
  padding-top: 2px;
}

.nutrition-macro-pair .card.nutrition-macro-pair__donut,
.nutrition-macro-pair .card.nutrition-macro-pair__weekly {
  display: flex;
  flex-direction: column;
}

.history-page__title {
  margin-bottom: 12px;
}

.history-page__layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.history-tabs {
  margin-bottom: 0;
}

.history-tabs__scroller {
  display: flex;
  flex-direction: row;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.history-tabs__scroller::-webkit-scrollbar {
  display: none;
}

.history-tab-btn {
  white-space: nowrap;
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border2);
  background: var(--surface);
  color: var(--text2);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.history-tab-btn:hover {
  border-color: var(--accent);
  color: var(--text1);
}

.history-tab-btn.history-tab-btn--active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.history-tab-btn.history-tab-btn--active:hover {
  color: white;
}

@media (min-width: 1024px) {
  .history-page__layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
  }

  .history-tabs {
    flex: 0 0 260px;
    max-width: 280px;
    position: sticky;
    top: 16px;
    align-self: flex-start;
  }

  .history-tabs__scroller {
    flex-direction: column;
    overflow-x: visible;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
    padding-bottom: 0;
    gap: 8px;
  }

  .history-tab-btn {
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    border-radius: 10px;
    white-space: normal;
    flex-shrink: 0;
    padding: 10px 14px;
  }

  .history-content {
    flex: 1;
    min-width: 0;
  }
}

/* KI-Analyse (P5): Mobile Prompt-Leiste oben / horizontal, Desktop links ~300px (RESPONSIVE_UI §5.3) */
.analysis-page__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.analysis-page__header > div:first-child {
  flex: 1;
  min-width: 0;
}

.analysis-split {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.analysis-split__nav {
  display: flex;
  flex-direction: row;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.analysis-split__nav::-webkit-scrollbar {
  display: none;
}

.analysis-split__nav-item {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border2);
  background: var(--surface);
  color: var(--text2);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.analysis-split__nav-item:hover {
  border-color: var(--accent);
  color: var(--text1);
}

.analysis-split__nav-item--active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.analysis-split__nav-item--active:hover {
  color: white;
}

.analysis-split__nav-item--active .muted {
  color: rgba(255, 255, 255, 0.88) !important;
}

.analysis-split__nav-cat-count {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.92;
}

.analysis-split__nav-item--active .analysis-split__nav-cat-count {
  color: rgba(255, 255, 255, 0.95);
  opacity: 1;
}

a.analysis-split__nav-item {
  text-decoration: none;
  box-sizing: border-box;
}

.analysis-split__main {
  min-width: 0;
}

@media (min-width: 1024px) {
  .analysis-split {
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
  }

  .analysis-split__nav-wrap {
    flex: 0 0 300px;
    max-width: 320px;
    position: sticky;
    top: 16px;
    align-self: flex-start;
  }

  .analysis-split__nav {
    flex-direction: column;
    overflow-x: visible;
    overflow-y: auto;
    max-height: calc(100vh - 140px);
    padding-bottom: 0;
    gap: 8px;
  }

  .analysis-split__nav-item {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    border-radius: 10px;
    white-space: normal;
  }

  .analysis-split__main {
    flex: 1;
  }
}

/* Erfassung: eine einheitliche Inhaltsbreite (Desktop), zentriert; mobil volle Breite */
.capture-page {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (min-width: 1024px) {
  .capture-page {
    max-width: var(--capture-content-max);
    margin-left: auto;
    margin-right: auto;
  }
}

/* Admin: Session-Metriken / Attributprofile — volle Breite, linksbündig (nicht globale 90px-Zahlfelder) */
.activity-attribute-profiles .aaf-stack {
  max-width: 42rem;
}
.activity-attribute-profiles .aaf-field {
  margin-bottom: 1rem;
}
.activity-attribute-profiles .aaf-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text1);
  text-align: left;
  margin-bottom: 6px;
  line-height: 1.35;
}
.activity-attribute-profiles .aaf-sublabel {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-align: left;
  margin-bottom: 4px;
}
.activity-attribute-profiles .aaf-hint {
  font-size: 12px;
  color: var(--text3);
  text-align: left;
  margin: 6px 0 0;
  line-height: 1.45;
}
.activity-attribute-profiles .aaf-input,
.activity-attribute-profiles textarea.aaf-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  text-align: left;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  color: var(--text1);
  background: var(--surface2);
  border: 1.5px solid var(--border2);
  border-radius: 8px;
  transition: border-color 0.15s;
}
.activity-attribute-profiles textarea.aaf-input {
  resize: vertical;
  min-height: 4.5rem;
  font-weight: 400;
}
.activity-attribute-profiles .aaf-input:focus {
  outline: none;
  border-color: var(--accent);
}
.activity-attribute-profiles .aaf-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 560px) {
  .activity-attribute-profiles .aaf-split {
    grid-template-columns: 1fr;
  }
}
.activity-attribute-profiles .aaf-field-select {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.activity-attribute-profiles .aaf-field-select:last-child {
  border-bottom: none;
}
.activity-attribute-profiles .aaf-field-select .form-label {
  display: block;
  text-align: left;
  margin-bottom: 6px;
  font-weight: 600;
  flex: unset;
}
.activity-attribute-profiles .aaf-field-select .form-input,
.activity-attribute-profiles .aaf-field-select select.form-input {
  width: 100%;
  max-width: none;
  min-width: 0;
  text-align: left;
  box-sizing: border-box;
  padding: 10px 12px;
}
.activity-attribute-profiles .aaf-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.activity-attribute-profiles .aaf-toolbar .form-label {
  display: block;
  text-align: left;
  margin-bottom: 6px;
  font-weight: 600;
  flex: unset;
}
.activity-attribute-profiles .aaf-toolbar__grow {
  flex: 1 1 240px;
  min-width: 0;
}
.activity-attribute-profiles .aaf-toolbar .form-input,
.activity-attribute-profiles .aaf-toolbar select.form-input {
  width: 100%;
  min-width: 140px;
  max-width: none;
  text-align: left;
  box-sizing: border-box;
  padding: 10px 12px;
}
.activity-attribute-profiles .aaf-toolbar__compact {
  flex: 0 0 auto;
}
.activity-attribute-profiles .aaf-toolbar__compact .form-input,
.activity-attribute-profiles .aaf-toolbar__compact select.form-input {
  width: 100%;
  min-width: 5rem;
}
.activity-attribute-profiles .aaf-inline-edit .form-input,
.activity-attribute-profiles .aaf-inline-edit select.form-input {
  text-align: left;
  min-width: 4.5rem;
  width: auto;
  max-width: none;
  box-sizing: border-box;
  padding: 8px 10px;
}

/* Legacy .capture-shell entfällt — Sektionsnav: PageSectionNav → .admin-page-subtabs */
.app-subnav-shell {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.app-subnav-shell__main {
  min-width: 0;
}

/* Einstellungen: gleiche Split-Struktur wie Analyse/Admin */
.settings-shell {
  width: 100%;
}

/* Referenzwerte: Übersichtskacheln (responsive, bis 4 Spalten Desktop) */
.ref-value-tiles-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 520px) {
  .ref-value-tiles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .ref-value-tiles-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .ref-value-tiles-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.ref-value-tile {
  display: block;
  width: 100%;
  margin: 0;
  padding: 14px 14px 12px;
  text-align: left;
  font-family: var(--font);
  border-radius: 12px;
  border: 1.5px solid var(--border2);
  background: var(--surface);
  color: var(--text1);
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ref-value-tile:hover {
  border-color: var(--accent);
}

.ref-value-tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ref-value-tile--active {
  border-color: var(--accent);
  background: var(--surface2);
}

/* Admin: horizontale Seiten-Weiche (Hierarchie · Nutzer · …) */
.admin-top-nav {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.admin-top-nav__link {
  padding: 12px 18px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: var(--text2);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  font-family: inherit;
  border-radius: 8px 8px 0 0;
  box-sizing: border-box;
}
.admin-top-nav__link:hover {
  color: var(--text1);
  background: var(--surface2);
}
.admin-top-nav__link--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: transparent;
}

/*
 * Mobile (≤1023px): geringerer Platzbedarf bei Schaltern und Menüs.
 * Haupt- + Sub-Navigation: horizontale, scrollbare Chip-Leisten (kein Umbruch).
 */
@media (max-width: 1023px) {
  .app-main {
    padding-top: 12px;
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }

  .page-title {
    font-size: 1.125rem;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
  }

  .btn {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 9px;
  }

  .card {
    padding: 12px 14px;
  }

  .card + .card {
    margin-top: 10px;
  }

  /* globale Tab-Zeile: bei Bedarf horizontal scrollbar */
  .tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 2px;
    padding: 2px;
    margin-bottom: 12px;
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 7px;
  }

  .admin-top-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    border-bottom: none;
    margin-bottom: 14px;
    padding-bottom: 4px;
    margin-left: calc(-1 * max(12px, env(safe-area-inset-left, 0px)));
    margin-right: calc(-1 * max(12px, env(safe-area-inset-right, 0px)));
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .admin-top-nav::-webkit-scrollbar {
    display: none;
  }

  .admin-top-nav__link {
    flex: 0 0 auto;
    scroll-snap-align: start;
    min-height: 36px;
    padding: 6px 11px;
    font-size: 12px;
    font-weight: 600;
    border-bottom: none;
    margin-bottom: 0;
    border-radius: 999px;
    background: var(--surface2);
    border: 1px solid var(--border2);
    gap: 5px;
    box-sizing: border-box;
    align-items: center;
  }

  .admin-top-nav__link svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
  }

  .admin-top-nav__link--active {
    background: var(--accent);
    color: #fff !important;
    border-color: var(--accent);
  }

  .admin-top-nav__link:hover {
    background: var(--surface);
    color: var(--text1);
  }

  .admin-top-nav__link--active:hover {
    color: #fff !important;
    background: color-mix(in srgb, var(--accent) 90%, #000);
  }

  /* Segment-Schalter (Liste/Kalender, Gruppe/Verein, Rahmen-Tabs) */
  .planning-segment-group {
    border-radius: 8px;
  }

  .planning-segment-group__btn {
    padding: 6px 10px;
    font-size: 0.78rem;
    min-height: 34px;
    box-sizing: border-box;
  }

  .planning-segment-group--comfort .planning-segment-group__btn {
    padding: 7px 11px;
    font-size: 0.8125rem;
    min-height: 36px;
  }

  .planning-segment-group--equal .planning-segment-group__btn {
    min-width: 0;
    flex: 1 1 0;
  }

  .framework-edit__tabbar {
    padding: 4px 0 8px;
    margin-bottom: 10px;
    gap: 6px;
  }

  .framework-edit__tabbar .admin-page-subtabs__btn {
    padding: 6px 8px;
    font-size: 11px;
    line-height: 1.25;
    min-height: 34px;
  }

  .training-planning-create__cta,
  .training-planning-create__secondary {
    min-height: 42px;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .admin-assignments-wrap {
    padding: 14px;
  }

  .admin-assignments-wrap__title {
    font-size: 1.05rem;
  }

  /* Framework-Slot-Chips (falls sehr breit): leicht kompakter */
  .framework-slot-chip {
    padding: 7px 12px;
    font-size: 0.8rem;
  }

  .admin-page-subtabs {
    margin-left: calc(-1 * max(12px, env(safe-area-inset-left, 0px)));
    margin-right: calc(-1 * max(12px, env(safe-area-inset-right, 0px)));
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    margin-bottom: 14px;
    border-bottom: none;
    padding-bottom: 6px;
  }

  .admin-catalog-section {
    padding: 14px;
  }

  .exercises-page-toolbar-tabs,
  .skills-page__tabs-scroll {
    margin-left: calc(-1 * max(12px, env(safe-area-inset-left, 0px)));
    margin-right: calc(-1 * max(12px, env(safe-area-inset-right, 0px)));
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    padding-bottom: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .exercises-page-toolbar-tabs::-webkit-scrollbar,
  .skills-page__tabs-scroll::-webkit-scrollbar {
    display: none;
  }
}

/* Trainingsplanung: kompakte Segmente (Gruppe / Verein) */
.planning-segment-group {
  display: inline-flex;
  border-radius: 10px;
  border: 1.5px solid var(--border2);
  overflow: hidden;
  background: var(--surface2);
}
.planning-segment-group__btn {
  border: none;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  background: transparent;
  color: var(--text1);
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.planning-segment-group__btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.planning-segment-group__btn--active {
  background: var(--accent);
  color: #fff;
}
.planning-segment-group__btn:not(:first-child) {
  border-left: 1.5px solid var(--border2);
}

/* Gleich breite Segment-Buttons (z. B. mobile Rahmenprogramm-Tabs) */
.planning-segment-group--equal {
  flex: 1;
  min-width: 0;
}
.planning-segment-group--equal .planning-segment-group__btn {
  flex: 1;
  min-width: 0;
}

/* Etwas größere Segmente (Planung: Liste / Kalender) */
.planning-segment-group--comfort .planning-segment-group__btn {
  padding: 10px 18px;
  font-size: 0.92rem;
}

/* ---------- Navigations-Ebenen (Kurzreferenz) ----------
 * Hauptbereiche: Bottom-Nav / App-Header.
 * Sektionsumschalter auf einer Seite: PageSectionNav → .admin-page-subtabs (Chips, mobil Edge-Scroll).
 *   AppSubnavShell = PageSectionNav + Inhalt (z. B. Hierarchie-Admin).
 * Wechsel zwischen Admin-Seiten → .admin-top-nav
 * „Sub-Sub“ (dritte Ebene): Feature-Layouts (Rahmen-Editor, Slots).
 * Karten-Raster: .card-grid / *list-grid* / *slots-board* — nur gap, kein .card+.card.
 * ---------- */

/* Admin-Kataloge: Seite „Stammdaten“ — viele Unter-Tabs, Chip-Scroll */
.admin-page-subtabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.admin-page-subtabs::-webkit-scrollbar {
  display: none;
}
.admin-page-subtabs__btn {
  flex: 0 0 auto;
  scroll-snap-align: start;
  margin: 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text2);
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.admin-page-subtabs__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.admin-page-subtabs__btn:disabled:hover {
  border-color: var(--border2);
  color: var(--text2);
  background: var(--surface2);
}
.admin-page-subtabs__btn:hover {
  border-color: var(--accent);
  color: var(--text1);
}
.admin-page-subtabs__btn--active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.admin-page-subtabs__btn--active:hover {
  color: #fff;
  background: color-mix(in srgb, var(--accent) 92%, #000);
}
@media (min-width: 1024px) {
  .admin-page-subtabs__btn {
    font-size: 13px;
    padding: 9px 15px;
  }
  .page-section-nav--wrap.admin-page-subtabs {
    flex-wrap: wrap;
  }
}

.page-section-nav__icon {
  flex-shrink: 0;
}
/* Eingebettet in z. B. framework-edit__tabbar — keine zweite Unterlinie */
.page-section-nav--embedded.admin-page-subtabs {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
  flex: 1;
  min-width: 0;
}
/* Inline neben Labeln (Planung: Ansicht / Einblenden) */
.page-section-nav--inline.admin-page-subtabs {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  margin-bottom: 0;
  flex: 0 1 auto;
  border-bottom: none;
  padding-bottom: 0;
}

/* Admin Hierarchy & Catalog Section (Komponenten) */
.admin-hierarchy-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.admin-hierarchy-pane {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--surface);
}
.admin-hierarchy-pane__title {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.15rem;
  font-weight: 700;
}
.admin-hierarchy-back {
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-catalog-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 1024px) {
  .admin-catalog-stack {
    gap: 1.25rem;
  }
}
.admin-catalog-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
@media (min-width: 1024px) {
  .admin-catalog-section {
    padding: 20px;
  }
}
.admin-catalog-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.admin-catalog-section__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.admin-catalog-section__icon {
  flex-shrink: 0;
  color: var(--accent-dark);
}
@media (prefers-color-scheme: dark) {
  .admin-catalog-section__icon {
    color: var(--accent);
  }
}
.admin-catalog-inline-form {
  margin-bottom: 16px;
  padding: 14px;
  background: var(--surface2);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.admin-catalog-inline-form h4 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 0.95rem;
  font-weight: 700;
}
.admin-catalog-list {
  display: grid;
  gap: 10px;
}
.admin-catalog-item {
  padding: 12px;
  background: var(--surface2);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.admin-catalog-item__name-row {
  margin-bottom: 8px;
}
.admin-catalog-meta {
  margin-left: 10px;
  color: var(--text3);
  font-size: 0.875rem;
}
.admin-catalog-desc {
  color: var(--text2);
  font-size: 0.875rem;
  margin: 8px 0;
}
.admin-catalog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.admin-catalog-empty {
  text-align: center;
  color: var(--text3);
  padding: 1.25rem;
  font-size: 0.9rem;
}

/* Ausklappbare Kontext-Hilfe (Filterzeile Planung) */
.planning-filter-help {
  flex: 1 1 100%;
  margin-top: 4px;
  max-width: 100%;
}
.planning-filter-help__summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-dark);
  list-style: none;
  user-select: none;
}
.planning-filter-help__summary::-webkit-details-marker {
  display: none;
}
.planning-filter-help__body {
  margin-top: 10px;
  padding: 12px 14px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text2);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
@media (prefers-color-scheme: dark) {
  .planning-filter-help__summary {
    color: var(--accent);
  }
}

/* Rahmenprogramm-Editor: Kurz-Einstieg ausklappbar */
.framework-edit-intro {
  margin-bottom: 1rem;
}
.framework-edit-intro__summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-dark);
  list-style: none;
  user-select: none;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed var(--border2);
  background: var(--surface2);
}
.framework-edit-intro__summary::-webkit-details-marker {
  display: none;
}
.framework-edit-intro__body {
  margin-top: 10px;
  padding: 12px 14px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text2);
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}
@media (prefers-color-scheme: dark) {
  .framework-edit-intro__summary {
    color: var(--accent);
  }
}

/* Admin: Zuordnungsmatrix (Stilrichtungen ↔ Zielgruppen) */
.admin-assignments-wrap {
  background: var(--surface);
  border-radius: 12px;
  padding: 20px;
}
.admin-assignments-wrap__title {
  margin-top: 0;
  font-size: 1.15rem;
  font-weight: 700;
}
.admin-assignments-matrix-container {
  overflow-x: auto;
  margin-top: 20px;
  -webkit-overflow-scrolling: touch;
}
.admin-assignments-matrix {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}
.admin-assignments-matrix th,
.admin-assignments-matrix td {
  border: 1px solid var(--border);
  padding: 12px;
}
.admin-assignments-matrix th {
  background: var(--surface2);
  font-weight: 600;
  color: var(--text1);
}
.admin-assignments-matrix__corner {
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 2;
}
.admin-assignments-matrix__row-label {
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 1;
  padding: 12px;
  font-weight: 500;
}
.admin-assignments-matrix tbody tr:hover {
  background: var(--surface2);
}
.admin-assignments-matrix__focus-header td {
  background: var(--surface2);
  padding: 8px 12px;
  font-weight: 600;
  color: var(--text2);
}
.admin-assignments-matrix__th-narrow {
  text-align: center;
  padding: 12px;
}
@media (max-width: 768px) {
  .admin-assignments-matrix {
    font-size: 14px;
  }
  .admin-assignments-matrix th,
  .admin-assignments-matrix td {
    padding: 8px;
  }
}

/* Admin: Split-Layout wie .analysis-split (nur Gruppen in der Nav) */
.admin-shell {
  width: 100%;
}

.admin-page {
  width: 100%;
  min-width: 0;
}

/* Desktop: volle Breite der Admin-Spalte (nicht wie Erfassung 800px); Lesegröße leicht skaliert */
@media (min-width: 1024px) {
  .admin-page {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    font-size: clamp(15px, 0.88rem + 0.25vw, 18px);
  }
}

.admin-maturity-header {
  margin-bottom: 20px;
}
.admin-maturity-header__title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.admin-maturity-header__subtitle {
  margin: 0;
  max-width: 56rem;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.admin-tabs__tab {
  padding: 10px 16px;
  border-radius: 10px 10px 0 0;
  border: 1px solid transparent;
  background: var(--surface2);
  color: var(--text2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.admin-tabs__tab:hover {
  color: var(--text1);
  background: var(--surface);
}
.admin-tabs__tab--active {
  background: var(--surface);
  color: var(--accent-dark);
  border-color: var(--border);
  border-bottom-color: var(--surface);
  margin-bottom: -13px;
  padding-bottom: 11px;
}
@media (prefers-color-scheme: dark) {
  .admin-tabs__tab--active {
    color: var(--accent);
  }
}
.admin-tabs__panel {
  min-width: 0;
}

.admin-matrix-panel__intro {
  margin: 0 0 16px;
  max-width: 56rem;
}

.admin-bindings__intro {
  margin: 0 0 12px;
  max-width: 56rem;
  line-height: 1.55;
}
.admin-bindings__h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 12px;
}
.admin-bindings__form-section {
  margin-bottom: 20px;
}
.admin-bindings__form {
  display: grid;
  gap: 12px;
  max-width: 440px;
}
.admin-bindings__code {
  font-size: 12px;
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 6px;
  font-family: ui-monospace, monospace;
}
.admin-bindings-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.admin-bindings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-bindings-table th,
.admin-bindings-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.admin-bindings-table th {
  font-weight: 600;
  color: var(--text2);
  font-size: 13px;
  background: var(--surface2);
}
.admin-bindings-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-matrix-tools__intro {
  margin: 0 0 16px;
  max-width: 56rem;
  line-height: 1.55;
}
.admin-matrix-tools__msg {
  margin: 0 0 12px;
}
.admin-matrix-tools__section {
  margin-bottom: 20px;
}
.admin-matrix-tools__h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 14px;
}
.admin-matrix-tools__h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 8px;
}
.admin-matrix-tools__hint {
  font-size: 14px;
  margin: 0 0 12px;
  line-height: 1.45;
}
.admin-matrix-tools__filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.admin-matrix-tools__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.admin-matrix-tools__meta {
  font-size: 13px;
  margin: 0;
}
.admin-matrix-tools__subtitle {
  font-weight: 400;
  font-size: 14px;
}
.admin-matrix-tools__io-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.admin-matrix-tools__btn-mt {
  margin-top: 12px;
}
.admin-matrix-tools__check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0;
  cursor: pointer;
}
.admin-matrix-tools__check input {
  margin-top: 3px;
}

.admin-matrix-visual-group {
  margin-bottom: 28px;
}
.admin-matrix-visual-group__main {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-dark);
}
@media (prefers-color-scheme: dark) {
  .admin-matrix-visual-group__main {
    color: var(--accent);
  }
}
.admin-matrix-visual-group__sub {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text2);
}
.admin-matrix-visual-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.admin-matrix-visual-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 640px;
}
.admin-matrix-visual-table th,
.admin-matrix-visual-table td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  vertical-align: top;
}
.admin-matrix-visual-table thead th {
  background: var(--surface2);
  font-weight: 600;
}
.admin-matrix-visual-table__skill {
  min-width: 160px;
  max-width: 220px;
}
.admin-matrix-visual-table__level {
  min-width: 140px;
}
.admin-matrix-visual-table__ln {
  display: block;
  font-size: 12px;
  color: var(--text3);
}
.admin-matrix-visual-table__lname {
  display: block;
  font-size: 13px;
}
.admin-matrix-visual-table__skill-cell {
  font-weight: 600;
  background: var(--surface2);
}
.admin-matrix-visual-table__goal {
  line-height: 1.45;
}
.admin-matrix-visual-table__obs {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.4;
}
.admin-matrix-visual-table__obs strong {
  color: var(--text2);
  font-weight: 600;
}

.skills-catalog-admin__intro {
  margin: 0 0 16px;
  max-width: 56rem;
}
.skills-catalog-admin__error {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--warn-bg);
  color: var(--warn-text);
  margin-bottom: 16px;
}
.skills-catalog-admin__msg {
  margin: 0 0 12px;
}

.skills-catalog-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  margin-bottom: 24px;
}
@media (max-width: 1023px) {
  .skills-catalog-layout {
    grid-template-columns: 1fr;
  }
}

.skills-catalog-column {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  min-width: 0;
}
.skills-catalog-column__title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text3);
  margin: 0 0 12px;
}

.skills-catalog-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  max-height: min(42vh, 360px);
  overflow-y: auto;
}
.skills-catalog-placeholder {
  margin: 0 0 14px;
  font-size: 14px;
}

.skills-catalog-row {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  margin-bottom: 4px;
  border: 1px solid transparent;
}
.skills-catalog-row--active {
  border-color: var(--accent);
  background: var(--accent-light);
}
.skills-catalog-row__label {
  flex: 1;
  min-width: 0;
  text-align: left;
  padding: 8px 10px;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border-radius: 7px;
}
.skills-catalog-row__label:hover {
  background: var(--surface2);
}
.skills-catalog-row--active .skills-catalog-row__label:hover {
  background: transparent;
}
.skills-catalog-row__actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  padding-right: 4px;
}
.skills-catalog-row__badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
}

.skills-catalog-quick {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.skills-catalog-quick .form-label {
  margin-bottom: 0;
}

.skills-catalog-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  max-width: 100%;
}
.skills-catalog-detail__title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 14px;
}
.skills-catalog-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.skills-catalog-form__heading {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text2);
}
.skills-catalog-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.btn-tiny {
  padding: 4px 8px;
  font-size: 13px;
  line-height: 1.2;
  min-width: 2rem;
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text2);
  box-shadow: none;
}
.btn-ghost:hover {
  background: var(--surface2);
  color: var(--text1);
}

/* Touch-Ziel mind. ca. 44×44 (Apple HIG) */
.btn-icon-touch {
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  line-height: 1;
  border-radius: 10px;
}

.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (min-width: 640px) {
  .admin-modal-backdrop {
    align-items: center;
    padding: 24px;
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
  }
}

.admin-modal-sheet {
  width: 100%;
  max-width: 520px;
  max-height: min(92vh, 100dvh);
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 640px) {
  .admin-modal-sheet {
    border-radius: 16px;
    border-bottom: 1px solid var(--border);
    max-height: min(88vh, 900px);
  }
}

.admin-modal-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  padding-top: max(16px, env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.admin-modal-sheet__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.25;
}

.admin-modal-sheet__close {
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
}

.admin-modal-sheet__body {
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.skills-page-modal.admin-modal-sheet {
  max-width: min(600px, 100vw - 32px);
}

/* Admin Hierarchie: Detail-Panel */
.detail-panel__title {
  margin-top: 0;
}
.detail-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.detail-panel__context {
  padding: 12px;
  margin-bottom: 20px;
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text2);
}
.detail-panel__unknown {
  padding: 20px;
  color: var(--text3);
}

/* Seite Fähigkeiten & Methoden */
.skills-page__loading {
  padding: 2rem;
  text-align: center;
}
.skills-page__tabs-scroll {
  margin-bottom: 1.5rem;
}
.skills-page__intro-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 1rem;
}
.skills-page__intro-row p {
  margin: 0;
  flex: 1 1 12rem;
  color: var(--text2);
}
.skills-page__empty {
  margin: 0;
  text-align: center;
  color: var(--text2);
}
.skills-page__category {
  margin-bottom: 2rem;
}
.skills-page__category-title {
  margin: 0 0 1rem;
  text-transform: capitalize;
}
.skills-page__card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.skills-page__card-grid--methods {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.skills-page-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.skills-page-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 0.5rem;
}
.skills-page-card__meta-block {
  margin-bottom: 0.5rem;
}
.skills-page-card__title {
  margin: 0;
  font-size: 1rem;
}
.skills-page-card__title--method {
  margin: 0 0 0.25rem;
}
.skills-page-card__abbr {
  color: var(--text2);
  font-size: 0.875rem;
  margin-left: 0.5rem;
  font-weight: 400;
}
.skills-page-card__badge {
  flex-shrink: 0;
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
}
.skills-page-card__meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.skills-page-card__chip {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: var(--surface2);
  color: var(--text2);
}
.skills-page-card__desc {
  margin: 0 0 1rem;
  color: var(--text2);
  font-size: 0.875rem;
}
.skills-page-card__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}
.skills-page-card__grow {
  flex: 1;
}
.skills-page-modal__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}
.skills-page-modal__submit {
  flex: 1;
}

.clubs-page__intro {
  margin: 0 0 1.25rem;
  max-width: 46rem;
  line-height: 1.55;
}

/* Übungsliste: Kopf, Modus-Segmente, Hinweise */
.exercises-page__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.exercises-page__title {
  margin: 0;
}
.exercises-page-toolbar-tabs {
  margin-bottom: 14px;
}
.exercise-search-hint {
  font-size: 12px;
  color: var(--text3);
  margin-top: 10px;
  margin-bottom: 0;
  line-height: 1.45;
}
.exercise-search-hint .btn {
  margin-left: 6px;
  vertical-align: middle;
}
.exercise-search-bar {
  margin-bottom: 12px;
}
.exercise-search-bar__primary {
  margin-bottom: 10px;
}
.exercise-bulk-toolbar {
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.exercise-bulk-toolbar__meta {
  font-size: 12px;
  color: var(--text3);
  line-height: 1.4;
  flex: 1 1 200px;
}
.exercises-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 14px;
  align-items: stretch;
}
.exercises-list-grid > .exercise-card {
  height: 100%;
  min-height: 0;
}
.exercise-card-layout {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.exercise-card-layout--grow {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}
.exercise-card-layout__check {
  margin-top: 4px;
  flex-shrink: 0;
  accent-color: var(--accent);
}
.exercise-card-body-flex {
  flex: 1;
  min-width: 0;
}
.exercise-card-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  line-height: 1.3;
  font-weight: 700;
}
.exercise-card-title a {
  color: inherit;
  text-decoration: none;
}
.exercise-card-title a:hover {
  color: var(--accent-dark);
}
@media (prefers-color-scheme: dark) {
  .exercise-card-title a:hover {
    color: var(--accent);
  }
}
.exercise-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.exercise-card-summary {
  color: var(--text2);
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
}
.exercise-card-summary--rich {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  word-break: break-word;
}
.exercise-card-summary--rich b,
.exercise-card-summary--rich strong {
  font-weight: 700;
  color: var(--text1);
}
.exercise-card-summary--rich i,
.exercise-card-summary--rich em {
  font-style: italic;
}
.exercise-card-summary--rich p {
  margin: 0 0 0.35em;
}
.exercise-card-summary--rich p:last-child {
  margin-bottom: 0;
}
.exercises-meta-line {
  font-size: 13px;
  color: var(--text2);
  margin: 0 0 10px;
}
.exercises-meta-line--muted {
  color: var(--text3);
  margin-bottom: 8px;
}
.exercises-load-more {
  text-align: center;
  margin-top: 16px;
}
.exercises-empty-text {
  margin: 0;
  color: var(--text2);
  text-align: center;
}

/* Admin Hierarchie-Baum (Fokusbereich) */
.focus-tree-root {
  margin-bottom: 12px;
}
.focus-tree-header {
  display: flex;
  align-items: stretch;
  gap: 2px;
  padding: 4px 4px 4px 6px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  transition: background 0.12s, border-color 0.12s;
}
.focus-tree-header:hover {
  background: var(--surface2);
  border-color: var(--border);
}
.focus-tree-header--selected {
  background: var(--accent);
  border-color: var(--accent);
}
.focus-tree-header--selected:hover {
  background: color-mix(in srgb, var(--accent) 94%, #000);
  border-color: var(--accent);
}
.focus-tree-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-height: 36px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  align-self: center;
  -webkit-tap-highlight-color: transparent;
}
.focus-tree-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
}
.focus-tree-header--selected .focus-tree-toggle {
  color: #fff;
}
.focus-tree-header--selected .focus-tree-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
}
.focus-tree-header__label {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 2px;
  margin: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}
.focus-tree-emoji {
  flex-shrink: 0;
  line-height: 1;
}
.focus-tree-children {
  margin-top: 8px;
  margin-left: 8px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}
.focus-tree-group {
  margin-bottom: 12px;
}
.focus-tree-group:last-child {
  margin-bottom: 0;
}
.focus-tree-group__head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text3);
  margin-bottom: 6px;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.focus-tree-add-btn {
  flex-shrink: 0;
}
.focus-tree-item {
  padding: 8px 12px;
  margin-bottom: 4px;
  border-radius: 8px;
  cursor: pointer;
  background: var(--surface2);
  color: var(--text1);
  font-size: 14px;
  border: 1px solid var(--border);
  line-height: 1.35;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.focus-tree-item:last-child {
  margin-bottom: 0;
}
.focus-tree-item:hover {
  border-color: var(--accent);
}
.focus-tree-item--selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.focus-tree-item--selected:hover {
  border-color: var(--accent);
}
.focus-tree-item__abbr {
  margin-left: 8px;
  font-size: 12px;
  opacity: 0.85;
}
.focus-tree-item__meta {
  font-size: 11px;
  margin-top: 4px;
  line-height: 1.35;
  opacity: 0.88;
}
.focus-tree-item--selected .focus-tree-item__abbr,
.focus-tree-item--selected .focus-tree-item__meta {
  opacity: 0.95;
  color: #fff;
}

@media (max-width: 1023px) {
  .exercise-filter-chips-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-left: -2px;
    margin-right: -2px;
    padding-left: 2px;
    padding-right: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .exercise-filter-chips-row::-webkit-scrollbar {
    display: none;
  }
  .focus-tree-children {
    margin-left: 4px;
    padding-left: 8px;
  }
}

.exercise-filter-modal.admin-modal-sheet {
  max-width: min(920px, calc(100dvw - 16px));
}
.exercise-filter-modal .admin-modal-sheet__body.exercise-filter-modal__scroll {
  flex: 1;
  min-height: 0;
}
.exercise-filter-modal__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}
.exercise-search-bar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.exercise-search-bar__actions--split {
  width: 100%;
}
.exercise-search-bar__actions-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.exercise-mine-toggle--active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 600;
}
.exercise-filter-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.exercise-filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
}
.exercise-filters-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.exercise-filters-modal-grid--two {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.exercise-filters-modal-grid--catalog {
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px 12px;
}
.exercise-filter-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.exercise-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text1);
  text-align: left;
}
.exercise-filter-chip__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(260px, 100%);
}
.exercise-filter-chip__x {
  flex-shrink: 0;
  opacity: 0.65;
  font-weight: 700;
  line-height: 1;
}
.exercise-filter-section {
  margin-bottom: 20px;
}
.exercise-filter-section--last {
  margin-bottom: 0;
}
.exercise-filter-section-title {
  margin: 0 0 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
  font-weight: 700;
}
.exercise-filter-skill-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface2);
}
.exercise-filter-skill-block > .form-label {
  margin-bottom: 6px;
}
.exercise-filter-skill-hint {
  margin: 10px 0 8px;
  font-size: 12px;
  color: var(--text3);
  line-height: 1.35;
}
.exercise-filter-skill-levels-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}
.exercise-filter-skill-level-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.exercise-filter-skill-level-caption {
  font-size: 11px;
  color: var(--text3);
  font-weight: 600;
}
.exercise-filter-level-select {
  width: 72px;
  padding: 6px 8px;
  font-size: 14px;
}
.exercise-filter-skill-dash {
  padding-bottom: 8px;
  color: var(--text3);
  font-weight: 600;
}

/* Übungsfilter: kompakte +/- Katalogregeln */
.catalog-rule-picker {
  margin-bottom: 10px;
}
.catalog-rule-picker--disabled {
  opacity: 0.55;
  pointer-events: none;
}
.catalog-rule-picker__label {
  margin-bottom: 0;
  font-size: 13px;
}
.catalog-rule-picker__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 0;
  margin-bottom: 6px;
}
.catalog-rule-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 2px 6px 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  font-size: 12px;
  line-height: 1.35;
}
.catalog-rule-chip__sign {
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
  opacity: 0.85;
}
.catalog-rule-chip__sign--require {
  color: var(--accent-dark);
}
.catalog-rule-chip__sign--forbid {
  color: var(--danger);
}
.catalog-rule-chip__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}
.catalog-rule-chip__x {
  flex-shrink: 0;
  margin: 0;
  padding: 0 4px;
  border: none;
  background: transparent;
  color: var(--text2);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
}
.catalog-rule-chip__x:hover {
  color: var(--text1);
  background: var(--border);
}
.catalog-rule-picker__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.catalog-rule-picker__select {
  flex: 0 1 132px;
  max-width: 160px;
  min-width: 96px;
  padding: 6px 8px;
  font-size: 13px;
}
.catalog-rule-picker__sign-btn {
  min-width: 32px;
  padding-left: 10px;
  padding-right: 10px;
  font-weight: 700;
  font-size: 14px;
}

/* Reifegradmodell-Admin: klare Schritte, responsives Raster */
.admin-matrix-alert {
  border: 1px solid var(--danger);
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: 12px;
  color: var(--danger);
}

.admin-matrix-layout {
  display: grid;
  grid-template-columns: minmax(260px, 300px) 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .admin-matrix-layout {
    grid-template-columns: 1fr;
  }
}

.admin-matrix-sidebar {
  position: sticky;
  top: 12px;
}
@media (max-width: 900px) {
  .admin-matrix-sidebar {
    position: static;
  }
}

.admin-matrix-sidebar__title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
}
.admin-matrix-sidebar__subtitle {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 600;
}

.admin-matrix-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.admin-matrix-model-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(40vh, 320px);
  overflow-y: auto;
}
.admin-matrix-model-list li + li {
  margin-top: 8px;
}

.admin-matrix-model-btn {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text1);
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 48px;
}
.admin-matrix-model-btn:hover {
  background: var(--surface);
}
.admin-matrix-model-btn--active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-dark);
}
@media (prefers-color-scheme: dark) {
  .admin-matrix-model-btn--active {
    color: var(--accent);
  }
}
.admin-matrix-model-btn__name {
  font-weight: 600;
}
.admin-matrix-model-btn__meta {
  font-size: 12px;
}

.admin-matrix-new-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-matrix-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-matrix-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
}

.admin-matrix-empty {
  padding: 24px;
  color: var(--text2);
}

.admin-matrix-section__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.admin-matrix-section__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}
.admin-matrix-step {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.admin-matrix-hint {
  font-size: 14px;
  margin: 0 0 12px;
  line-height: 1.45;
}

.admin-matrix-meta-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}
.admin-matrix-meta-grid__row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) {
  .admin-matrix-meta-grid__row2 {
    grid-template-columns: 1fr;
  }
}

.admin-matrix-context-readonly {
  font-size: 13px;
  line-height: 1.5;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px dashed var(--border2);
  margin-bottom: 12px;
}
.admin-matrix-context-readonly strong {
  color: var(--text2);
}

.admin-matrix-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}
.admin-matrix-actions--mt {
  margin-top: 12px;
}

.admin-matrix-level-count {
  max-width: 220px;
  margin-bottom: 12px;
}

.admin-matrix-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 8px;
}
.admin-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-matrix-table th,
.admin-matrix-table td {
  text-align: left;
  padding: 8px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}
.admin-matrix-table thead th {
  border-top: none;
  font-weight: 600;
  color: var(--text2);
  font-size: 13px;
}
.admin-matrix-table__narrow {
  width: 88px;
}

.admin-matrix-skill-add {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}
.admin-matrix-skill-add__select {
  flex: 1 1 220px;
  min-width: 0;
}
.admin-matrix-skill-add__btn {
  flex-shrink: 0;
  min-height: 44px;
}

.admin-matrix-skill-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.admin-matrix-skill-list__item {
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.admin-matrix-skill-list__item:first-child {
  border-top: none;
}
.admin-matrix-skill-list__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.admin-matrix-skill-list__name {
  font-size: 15px;
}
.admin-matrix-skill-list__path {
  font-size: 12px;
  margin-top: 4px;
}

.admin-matrix-matrix-scroll {
  overflow: auto;
  max-height: min(70vh, 720px);
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.admin-matrix-table--matrix th,
.admin-matrix-table--matrix td {
  border: 1px solid var(--border);
}
.admin-matrix-matrix__corner {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  min-width: 140px;
  padding: 8px;
}
.admin-matrix-matrix__level-head {
  padding: 8px;
  min-width: 160px;
  background: var(--surface2);
  font-size: 13px;
}
.admin-matrix-matrix__skill-cell {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
  font-weight: 600;
  max-width: 220px;
  vertical-align: top;
  padding: 8px;
}
.admin-matrix-matrix__skill-path {
  font-size: 11px;
  font-weight: 400;
  margin-top: 6px;
  line-height: 1.35;
}
.admin-matrix-matrix__cell {
  vertical-align: top;
  padding: 6px;
  min-width: 148px;
}
.admin-matrix-matrix__ta {
  font-size: 12px;
  width: 100%;
  min-width: 120px;
}
.admin-matrix-matrix__ta--criteria {
  font-size: 11px;
  margin-top: 6px;
}

.btn-small {
  padding: 8px 12px;
  font-size: 13px;
  min-height: 40px;
}

.muted { color: var(--text3); font-size: 13px; }
.empty-state { text-align: center; padding: 48px 16px; color: var(--text3); }
.empty-state h3 { font-size: 16px; color: var(--text2); margin-bottom: 6px; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideDown {
  from { transform: translate(-50%, -20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* Additional vars */
:root {
  --warn-bg: #FAEEDA;
  --warn-text: #7a4b08;
}
@media (prefers-color-scheme: dark) {
  :root {
    --warn-bg: #3a2103;
    --warn-text: #FAC775;
  }
}

/* Header with profile avatar */
.app-header { display:flex; align-items:center; justify-content:space-between; }
.app-header a { display:flex; }

/* ── Responsive shell: Desktop sidebar (≥1024px) — spec RESPONSIVE_UI.md ───── */
.app-shell__column {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
}

.desktop-sidebar {
  display: none;
  flex-direction: column;
  width: var(--desktop-sidebar-width, 220px);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 30;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px 0 16px;
}

.desktop-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.desktop-sidebar__logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  flex-shrink: 0;
  opacity: 0.85;
}

.desktop-sidebar__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.desktop-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
  padding: 0 0 12px;
}

.desktop-sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 13px;
  text-decoration: none;
  color: var(--text2);
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  border-radius: 0 8px 8px 0;
  transition: background 0.15s, color 0.15s;
}

.desktop-sidebar__link:hover {
  background: var(--surface2);
  color: var(--text1);
}

.desktop-sidebar__link.desktop-sidebar__link--active {
  background: var(--accent-light);
  color: var(--accent);
  border-left-color: var(--accent);
}

.desktop-sidebar__footer {
  border-top: 1px solid var(--border);
  padding: 16px 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.desktop-sidebar__footer-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.desktop-sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.desktop-sidebar__user-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.desktop-sidebar__user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desktop-sidebar__user-tier {
  font-size: 11px;
  color: var(--text3);
  text-transform: lowercase;
}

.desktop-sidebar__logout {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--text3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.desktop-sidebar__logout:hover {
  color: var(--danger);
  background: rgba(216, 90, 48, 0.08);
}

@media (min-width: 1024px) {
  .app-shell {
    display: block;
    max-width: none;
    margin: 0;
    width: 100%;
    min-height: 100%;
    overflow-x: clip;
  }

  .desktop-sidebar {
    display: flex;
  }

  /* Kein width:100% zusätzlich zu margin-left — sonst Spalte = Viewport + Sidebar → horizontaler Scroll */
  .app-shell__column {
    margin-left: var(--desktop-sidebar-width, 220px);
    width: calc(100% - var(--desktop-sidebar-width, 220px));
    max-width: calc(100% - var(--desktop-sidebar-width, 220px));
    min-width: 0;
    min-height: 100vh;
    box-sizing: border-box;
  }

  .app-header--mobile {
    display: none !important;
  }

  .bottom-nav {
    display: none !important;
  }

  .app-main {
    padding: 24px 32px 32px;
    padding-bottom: max(32px, env(safe-area-inset-bottom, 0px));
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
  }

  /* Dashboard (P3): Begrüßung + Kennzahlen-Zeile */
  .dashboard-greeting {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
  }

  .dashboard-greeting__meta {
    margin-top: 0 !important;
    text-align: right;
  }
}

/* ── Dashboard layout (Mobile baseline + Desktop im Block oben teilweise) ─ */

.dashboard-page {
  width: 100%;
}

.dashboard-greeting {
  margin-bottom: 16px;
}

/*
 * Dashboard-Raster (KPI, Nebeneinander-Kacheln): 2 / 4 Spalten.
 * StatCard, DashboardTile: span via --tile-sm / --tile-lg (JS clamp).
 */
.dashboard-stat-grid,
.dashboard-tile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-stat-grid--mobile-4col,
.dashboard-tile-grid--mobile-4col {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-stat-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 12px 10px;
  border: 1px solid var(--border);
  transition: border-color 0.15s;
}

.dashboard-stat-card,
.dashboard-tile {
  min-width: 0;
  box-sizing: border-box;
  grid-column: span var(--tile-sm, 1);
}

@media (min-width: 1024px) {
  .dashboard-stat-card,
  .dashboard-tile {
    grid-column: span var(--tile-lg, 1);
  }
}

/* ── Dashboard-Abschnitte (Überschrift + Trennlinie) ─ */
.dashboard-section {
  margin-bottom: 22px;
}

.dashboard-section:last-child {
  margin-bottom: 0;
}

.dashboard-section__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.dashboard-section__headline {
  flex: 1;
  min-width: 0;
}

.dashboard-section__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.dashboard-section__description {
  font-size: 12px;
  color: var(--text3);
  margin: 4px 0 0 0;
  line-height: 1.35;
  max-width: none;
}

.dashboard-section__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-section__actions {
  flex-shrink: 0;
}

.dashboard-pill-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Ernährung/Aktivität: Raster wie KPI; Kacheln per DashboardTile steuerbar */
.dashboard-summary-row.dashboard-tile-grid {
  margin-bottom: 0;
}

.dashboard-erholung-grid .dashboard-tile > .card,
.dashboard-summary-row .dashboard-tile > .card {
  height: 100%;
}

@media (min-width: 1024px) {
  .dashboard-stat-grid,
  .dashboard-tile-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }
}

/* Dashboard Phase 0: KPI-Kacheln + Trainingsvorschau */
.dashboard-phase0-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 156px), 1fr));
  gap: 12px;
  margin-bottom: 0;
}

.dashboard-phase0-kpis__err {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: var(--danger);
}

.dashboard-phase0-kpis__loading {
  font-size: 0.9rem;
  margin: 0 0 10px;
}

.dashboard-kpi-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 14px 12px;
  background: linear-gradient(165deg, var(--surface2) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
  min-height: 112px;
  box-sizing: border-box;
}

.dashboard-kpi-card:hover {
  border-color: var(--border2);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.dashboard-kpi-card--static {
  cursor: default;
  pointer-events: none;
}

.dashboard-kpi-card--static:hover {
  transform: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
  border-color: var(--border);
}

.dashboard-kpi-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-light);
  color: var(--accent-dark);
  margin-bottom: 2px;
}

.dashboard-kpi-card__value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text1);
}

.dashboard-kpi-card__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text2);
}

.dashboard-kpi-card__hint {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
  margin-top: auto;
}

@media (max-width: 1023px) {
  .dashboard-phase0-kpis {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding: 2px 0 4px;
    margin-left: calc(-1 * max(12px, env(safe-area-inset-left, 0px)));
    margin-right: calc(-1 * max(12px, env(safe-area-inset-right, 0px)));
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }
  .dashboard-phase0-kpis::-webkit-scrollbar {
    display: none;
  }
  .dashboard-kpi-card {
    flex: 0 0 auto;
    scroll-snap-align: start;
    width: min(132px, 38vw);
    min-height: 0;
    padding: 10px 10px 8px;
    gap: 2px;
  }
  .dashboard-kpi-card__icon {
    width: 32px;
    height: 32px;
    margin-bottom: 0;
  }
  .dashboard-kpi-card__icon svg {
    width: 18px;
    height: 18px;
  }
  .dashboard-kpi-card__value {
    font-size: 1.35rem;
  }
  .dashboard-kpi-card__label {
    font-size: 0.72rem;
    line-height: 1.25;
  }
  .dashboard-kpi-card__hint {
    font-size: 0.6rem;
    letter-spacing: 0.04em;
  }
}

.dashboard-training-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 14px;
  align-items: stretch;
}

.dashboard-preview-card__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text1);
}

.dashboard-preview-card__list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text2);
  font-size: 0.9rem;
  line-height: 1.55;
}

.dashboard-preview-card__list--notes {
  font-size: 0.88rem;
  line-height: 1.5;
}

.dashboard-preview-card__list li {
  margin-bottom: 0.45rem;
}

.dashboard-preview-card__link {
  font-weight: 600;
  color: var(--accent-dark);
  text-decoration: none;
}

.dashboard-preview-card__link:hover {
  text-decoration: underline;
}

.dashboard-preview-card__meta {
  color: var(--text3);
}

.dashboard-preview-card__sub {
  display: block;
  font-size: 0.82rem;
  color: var(--text3);
  margin-top: 3px;
}

.dashboard-preview-card__note-snippet {
  margin-top: 5px;
  color: var(--text2);
}

.dashboard-preview-card__empty {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text2);
}

.dashboard-preview-card__empty a {
  color: var(--accent-dark);
  font-weight: 600;
}

.dashboard-preview-card__err {
  margin: 0;
  font-size: 0.9rem;
  color: var(--danger);
}

.dashboard-sys-card__title {
  margin-bottom: 12px;
  font-size: 1rem;
}

.dashboard-sys-card__grid {
  display: grid;
  grid-template-columns: minmax(0, 120px) 1fr;
  gap: 0.5rem 1rem;
  align-items: center;
  font-size: 0.9rem;
}

.dashboard-sys-card__pill {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: var(--surface2);
  color: var(--text1);
  border-radius: 6px;
  font-size: 0.85rem;
}

.dashboard-sys-card__pill--accent {
  background: var(--accent);
  color: #fff;
}

/* --- Übungen: Rich-Text & Kacheln --- */
.rich-text-editor-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.rich-text-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.rte-btn {
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text1);
  cursor: pointer;
  line-height: 1.2;
}
.rte-btn:active {
  background: var(--accent-light);
}
.rte-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 2px;
}
.rich-text-editor {
  padding: 10px 12px;
  outline: none;
  font-size: 15px;
  line-height: 1.5;
  min-height: 120px;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  resize: vertical;
}

/* §11 Inline-Marker: im Editor sichtbar (DOM ist nur leeres span + ZWJ — sonst „passiert nichts“-Effekt) */
.rich-text-editor span.shinkan-inline-media {
  display: inline-block;
  vertical-align: baseline;
  margin: 2px 4px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px dashed var(--accent);
  background: var(--surface2);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-dark);
  line-height: 1.35;
  cursor: default;
}
.rich-text-editor span.shinkan-inline-media::before {
  content: '📎 #' attr(data-shinkan-exercise-media) ' · ' attr(data-shinkan-exercise-media-size);
}
.rich-text-editor span.shinkan-inline-media[data-shinkan-exercise-media-caption]::before {
  content: '📎 ' attr(data-shinkan-exercise-media-caption) ' · #' attr(data-shinkan-exercise-media) ' · ' attr(data-shinkan-exercise-media-size);
}

/* Listen im Editor */
.rich-text-editor ul,
.rich-text-editor ol {
  margin: 0.35rem 0;
  padding-left: 1.35rem;
  list-style-position: outside;
}
.rich-text-editor ul {
  list-style-type: disc;
}
.rich-text-editor ol {
  list-style-type: decimal;
}
.rich-text-editor li {
  margin: 0.15rem 0;
  display: list-item;
}
.rich-text-editor p {
  margin: 0.35rem 0;
}
.rich-text-editor:empty:before {
  content: attr(data-placeholder);
  color: var(--text3);
  pointer-events: none;
}

.rich-text-content .shinkan-inline-media-wrap--sm {
  max-width: min(280px, 92vw);
}
.rich-text-content .shinkan-inline-media-wrap--md {
  max-width: min(560px, 92vw);
}
.rich-text-content .shinkan-inline-media-wrap--full {
  max-width: 100%;
}

.btn-secondary.rte-tab--active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(29, 158, 117, 0.22);
}

.rte-inline-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 8px;
}
.rte-inline-asset-tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.rte-inline-asset-tile:hover {
  border-color: var(--accent);
}
.rte-inline-asset-tile--selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(29, 158, 117, 0.2);
}
.rte-inline-asset-tile__meta {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.rte-inline-asset-tile__name {
  font-size: 13px;
  line-height: 1.3;
  color: var(--text1);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rte-inline-asset-tile__thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface2);
  border: 1px solid rgba(127, 127, 127, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}
.rte-inline-asset-tile__thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rte-inline-asset-tile__thumb-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.rte-inline-asset-tile__thumb-fallback {
  font-size: 11px;
  color: var(--text3);
}
.rte-inline-asset-tile__badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-dark);
}

.rte-inline-file-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  position: relative;
}
.rte-inline-file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.rte-inline-file-pick-btn {
  flex-shrink: 0;
  cursor: pointer;
  margin: 0;
}
.rte-inline-file-name {
  flex: 1 1 160px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.35;
  min-width: 0;
  word-break: break-word;
}

.exercise-edit-media-strip {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  align-items: stretch;
}
.exercise-edit-media-strip__item {
  display: flex;
  gap: 12px;
  align-items: stretch;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.exercise-edit-media-strip__lead {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 96px;
}
.exercise-edit-media-strip__handle {
  width: 100%;
  text-align: center;
  font-size: 14px;
  line-height: 1.2;
  padding: 6px 4px;
  border-radius: 8px;
  border: 1px dashed var(--accent);
  background: rgba(29, 158, 117, 0.08);
  color: var(--accent-dark);
  cursor: grab;
  user-select: none;
}
.exercise-edit-media-strip__handle:active {
  cursor: grabbing;
}
.exercise-edit-media-strip__handle-text {
  font-size: 11px;
  font-weight: 600;
}
.exercise-edit-media-strip__embed-badge--solo {
  width: 76px;
  min-height: 76px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  padding: 6px;
  text-align: center;
}

.exercise-edit-media-strip__body {
  flex: 1;
  min-width: 0;
}
.exercise-edit-media-strip__toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
}
.exercise-edit-media-strip__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}

.exercise-orphan-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.exercise-orphan-media-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface);
}
.exercise-orphan-media-card__head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.exercise-orphan-media-card__meta {
  flex: 1;
  min-width: 0;
}
.exercise-orphan-media-card__title {
  font-size: 14px;
  display: block;
  line-height: 1.3;
  word-break: break-word;
}
.exercise-orphan-media-card__sub {
  display: block;
  font-size: 11px;
  color: var(--text3);
  margin-top: 4px;
}
.exercise-orphan-media-card__warn {
  display: block;
  font-size: 11px;
  color: var(--danger);
  margin-top: 4px;
}

.rich-text-content {
  font-size: 16px;
  line-height: 1.55;
  word-break: break-word;
}
.rich-text-content h3 {
  font-size: 1.05rem;
  margin: 0.75rem 0 0.35rem;
}
.rich-text-content p {
  margin: 0.4rem 0;
}
.rich-text-content ul,
.rich-text-content ol {
  margin: 0.4rem 0;
  padding-left: 1.25rem;
}
.rich-text-content a {
  color: var(--accent-dark);
}

.exercise-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 4px solid var(--border2);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.exercise-card--scope-official {
  border-left-color: var(--accent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--surface)) 0%, var(--surface) 64%);
}
.exercise-card--scope-club {
  border-left-color: var(--warn);
  background: linear-gradient(180deg, color-mix(in srgb, var(--warn) 10%, var(--surface)) 0%, var(--surface) 64%);
}
.exercise-card--scope-private {
  border-left-color: var(--text3);
}
.exercise-card--mine {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 28%, var(--border));
}
@media (prefers-color-scheme: dark) {
  .exercise-card--scope-official {
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 12%, var(--surface)) 0%, var(--surface) 64%);
  }
  .exercise-card--scope-club {
    background: linear-gradient(180deg, color-mix(in srgb, var(--warn) 12%, var(--surface)) 0%, var(--surface) 64%);
  }
}
.exercise-card__body {
  flex: 1 1 auto;
}
.exercise-variants-details summary {
  list-style: none;
}
.exercise-variants-details summary::-webkit-details-marker {
  display: none;
}
.exercise-variants-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
}
.exercise-variants-summary__title {
  font-size: 1.1rem;
  font-weight: 600;
}
.exercise-variants-summary__badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  background: var(--surface2);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.exercise-variants-details__body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}
.exercise-variants-hint {
  font-size: 13px;
  color: var(--text2);
  margin: 12px 0;
  line-height: 1.45;
}

.exercise-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  flex-wrap: nowrap;
  min-height: 44px;
  box-sizing: border-box;
}
.exercise-card__meta-compact {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  color: var(--text3);
  font-size: 0;
  line-height: 0;
}
.exercise-card__meta-glyph {
  display: inline-flex;
  color: var(--text3);
  opacity: 0.9;
}
.exercise-card__meta-sep {
  font-size: 11px;
  line-height: 1;
  opacity: 0.45;
  user-select: none;
  padding: 0 1px;
}
.exercise-card__actions {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.exercise-card__actions--icons {
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  margin-left: auto;
}
.exercise-card__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text1);
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.exercise-card__icon-btn:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent-dark);
}
@media (prefers-color-scheme: dark) {
  .exercise-card__icon-btn:hover {
    color: var(--accent);
  }
}
.exercise-card__icon-btn--danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--border2));
}
.exercise-card__icon-btn--danger:hover {
  background: color-mix(in srgb, var(--danger) 10%, var(--surface2));
  border-color: var(--danger);
  color: var(--danger);
}
.exercise-card__actions .btn,
.exercise-card__actions a.btn {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 10px;
  font-size: 13px;
}

.exercise-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.exercise-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--text2);
  border: 1px solid var(--border);
}
.exercise-tag--accent {
  background: var(--accent-light);
  color: var(--accent-dark);
  border-color: transparent;
}
.exercise-tag--style {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface2));
  color: var(--accent-dark);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
}
.exercise-tag--training {
  background: var(--surface2);
  color: var(--text1);
  border-color: var(--border2);
}

/* Liste Rahmenprogramme: Abstand nur über gap (kein .card+.card zwischen li) */
.framework-programs-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.framework-programs-list > li.card {
  margin-bottom: 0;
}

.exercise-detail-shell {
  max-width: none;
  margin: 0;
  width: 100%;
}
.exercise-detail-section {
  margin-bottom: 14px;
}
.exercise-detail-section h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text3);
  margin: 0 0 6px;
  font-weight: 700;
}
.exercise-meta-line {
  font-size: 14px;
  color: var(--text2);
  margin: 8px 0 0;
}

.exercise-filters-compact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.exercise-filters-compact .form-label {
  font-size: 12px;
  margin-bottom: 4px;
}
.exercise-filters-compact .form-input {
  padding: 8px 10px;
  font-size: 14px;
}

.multiselect-combo {
  position: relative;
  width: 100%;
}
.multiselect-combo__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
  min-height: 0;
}
.multiselect-combo__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.multiselect-combo__chip span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.multiselect-combo__chip-x {
  opacity: 0.8;
  font-weight: 700;
  line-height: 1;
}
.multiselect-combo__field {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.multiselect-combo__input {
  flex: 1;
  min-width: 0;
}
.multiselect-combo__browse {
  flex-shrink: 0;
  padding-left: 10px;
  padding-right: 10px;
  font-size: 13px;
}
.multiselect-combo__list {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 30;
  margin: 4px 0 0;
  padding: 4px 0;
  max-height: 240px;
  overflow-y: auto;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.multiselect-combo__empty {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text3);
}
.multiselect-combo__opt {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: none;
  background: transparent;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text1);
}
.multiselect-combo__opt:hover,
.multiselect-combo__opt--hi {
  background: var(--surface2);
}
.multiselect-combo__opt:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.multi-assoc-block {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
  background: var(--surface2);
}
.multi-assoc-block h3 {
  font-size: 14px;
  margin: 0 0 8px;
}
.multi-assoc-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.multi-assoc-row select {
  flex: 1 1 160px;
  min-width: 0;
}

.skills-editor-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
@media (min-width: 640px) {
  .skills-editor-row {
    grid-template-columns: 1fr repeat(4, minmax(0, 100px)) auto;
    align-items: center;
  }
}

/* Trainingsplan — Anzeige / Druck / Ablauf (TrainingUnitRunPage) */
.training-run-item--done {
  opacity: 0.75;
}
.training-run-item--done .training-run-checkbox:checked {
  accent-color: var(--accent);
}

/* Rahmenprogramm bearbeiten — Mobile: Stammdaten | Plan; Desktop: untereinander Ziele → Slots (synchron zu FRAMEWORK_DESKTOP_MIN_PX) */
.framework-edit {
  max-width: 100%;
  margin: 0;
  width: 100%;
  min-width: 0;
}
@media (min-width: 900px) {
  .framework-edit__tabbar {
    display: none !important;
  }
  .framework-edit__plan-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .framework-edit__panel {
    display: block !important;
  }
}
.framework-edit__tabbar {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px 0 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: sticky;
  top: 0;
  z-index: 6;
  background: var(--bg);
}
.framework-edit__tabbar::-webkit-scrollbar {
  display: none;
}
.framework-edit__tabbar .admin-page-subtabs,
.framework-edit__tabbar .page-section-nav {
  flex: 1;
  min-width: 0;
}
.framework-edit__plan-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
@media (max-width: 899px) {
  .framework-edit .framework-edit__panel:not(.framework-edit__panel--active) {
    display: none !important;
  }
}

.framework-plan-goals {
  border-left: 3px solid var(--accent);
}

.framework-goal-chips__hint {
  font-size: 0.78rem;
  color: var(--text3);
  margin: 0 0 10px;
  line-height: 1.45;
}

.framework-goal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.framework-popmenu-anchor {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  vertical-align: middle;
  max-width: 100%;
}

.framework-goal-chip-wrap {
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--border2);
}

.framework-goal-chip {
  border: none;
  background: transparent;
  font: inherit;
  padding: 6px 10px 6px 12px;
  border-radius: 999px 0 0 999px;
  cursor: pointer;
  max-width: min(240px, 100%);
  text-align: left;
}

.framework-goal-chip--active {
  background: var(--accent-light);
}

.framework-goal-chip__text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text1);
}

.framework-goal-chip__kebab {
  border: none;
  background: transparent;
  padding: 0 8px;
  cursor: pointer;
  color: var(--text3);
  font-size: 1.05rem;
  line-height: 1;
  border-left: 1px solid var(--border);
  border-radius: 0 999px 999px 0;
}

.framework-goal-chip__kebab:hover,
.framework-goal-chip:hover {
  filter: brightness(0.97);
}

.framework-goal-editor {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
}

.framework-catalog-checkgrid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  max-height: 220px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--border2);
  border-radius: 10px;
  background: var(--surface2);
}

.framework-catalog-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  cursor: pointer;
  user-select: none;
}

.framework-catalog-check input {
  accent-color: var(--accent);
}

.framework-popmenu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 30;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  min-width: 200px;
  max-width: min(300px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.framework-popmenu--align-end {
  left: auto;
  right: 0;
}

.framework-popmenu li {
  margin: 0;
}

.framework-popmenu__item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 13px;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text1);
}

.framework-popmenu__item:hover {
  background: var(--surface2);
}

.framework-popmenu__item--danger {
  color: var(--danger);
}

.framework-ctrl.framework-ctrl--xs {
  padding: 2px 8px;
  font-size: 11px;
  min-height: 26px;
  line-height: 1.2;
}

/* Horizontaler Überblick: äußerer Scroll‑Container (Desktop: breite Session‑Karten) */
.framework-slots-board-outer {
  container-type: inline-size;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 10px;
  margin-left: -4px;
  margin-right: -4px;
  padding-left: 4px;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.framework-slots-board-outer--mobile-single {
  overflow-x: visible;
  scrollbar-gutter: auto;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 4px;
}

.framework-slots-board-outer--desktop {
  scrollbar-gutter: stable;
}

@media (max-width: 1023px) {
  .framework-slots-board-outer:not(.framework-slots-board-outer--mobile-single) {
    scrollbar-gutter: auto;
  }
}

.framework-slots-board {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 12px;
  align-items: stretch;
  width: max-content;
  min-width: 100%;
  padding: 4px 0 2px;
  scroll-snap-type: x proximity;
}

.framework-slots-board--desktop-wide .framework-slot-card {
  flex: 0 0 min(760px, max(560px, calc(100cqw - 48px)));
  width: min(760px, max(560px, calc(100cqw - 48px)));
  min-width: min(760px, max(560px, calc(100cqw - 48px)));
  height: auto;
  max-height: none;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  background: var(--surface);
  border-style: dashed;
  overflow: hidden;
  scroll-snap-align: start;
  box-sizing: border-box;
}

.framework-slots-board--desktop-wide .framework-slot-card__plan-editor {
  flex: 1;
  min-height: 240px;
  max-height: min(78vh, 1200px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Ein Slot = nutzbare Bildschirm­breite; Chips oben/unten wechseln die Session */
.framework-slot-mobile-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.framework-slot-mobile-panel .framework-slot-card--mobile-single {
  flex: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  max-height: none;
  overflow: visible;
  scroll-snap-align: unset;
}

.framework-slot-mobile-panel .framework-slot-card__plan-editor {
  max-height: none;
  overflow-x: hidden;
}

.framework-slot-chips-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 0 10px;
  margin-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.framework-slot-chips-bar--bottom {
  margin-bottom: 0;
  margin-top: 12px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.framework-slot-chip {
  flex: 0 0 auto;
  appearance: none;
  margin: 0;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text2);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.25;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.framework-slot-chip:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.framework-slot-chip--active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text, #fff);
}

/* ——— Trainings‑Einheit: Übungszeilen schlank + DnD ——— */
.training-unit-sections-editor--wide .tu-ex-variant-select--wide {
  max-width: 100%;
}

.tu-planning-module-band {
  /* Legacy — Ersetzt durch .tu-module-bundle-head; wird aus Kompatibilität vorerst beibehalten. */
  margin-top: 0.85rem;
  margin-bottom: 0.05rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: linear-gradient(to right, var(--accent-light), transparent 140%);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-dark);
  letter-spacing: 0.01em;
}

.tu-module-bundle-head {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0.65rem 0 0.15rem;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border2));
  background: linear-gradient(
    134deg,
    color-mix(in srgb, var(--accent-light) 55%, var(--surface)) 0%,
    var(--surface) 68%
  );
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.tu-module-bundle-head__stripe {
  width: 5px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--accent) 0%, color-mix(in srgb, var(--accent-dark) 92%, black) 100%);
}

.tu-module-bundle-head__main {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.75rem 0.72rem;
}

.tu-module-bundle-head__kicker {
  display: block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent-dark) 88%, var(--text3));
  margin-bottom: 0.12rem;
}

.tu-module-bundle-head__title {
  display: block;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text1);
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.tu-module-bundle-head__list {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.84rem;
  line-height: 1.48;
  color: var(--text2);
}

.tu-module-bundle-head__list li {
  margin-bottom: 0.12rem;
}

.tu-module-bundle-head__list li::marker {
  color: var(--accent-dark);
}

.tu-module-bundle-head__more,
.tu-module-bundle-head__meta,
.tu-module-bundle-head__empty {
  margin: 0.25rem 0 0;
  font-size: 0.79rem;
  line-height: 1.42;
  color: var(--text3);
}

.tu-module-bundle-head__empty {
  margin-top: 0.15rem;
}

.tu-modulepick-search {
  width: 100%;
  margin-bottom: 0.55rem;
}

.tu-modulepick-list {
  max-height: 240px;
  overflow-y: auto;
  padding: 2px;
  margin: 0 -2px;
  border-radius: 10px;
  border: 1px solid var(--border2);
  background: color-mix(in srgb, var(--surface2) 22%, var(--surface));
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tu-modulepick-item {
  text-align: left;
  appearance: none;
  margin: 0;
  cursor: pointer;
  width: 100%;
  padding: 0.45rem 0.62rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text1);
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}

.tu-modulepick-item:hover {
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
}

.tu-modulepick-item--active {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent),
    0 2px 10px rgba(29, 158, 117, 0.08);
}

.tu-modulepick-item__title {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
}

.tu-modulepick-item__meta {
  display: block;
  margin-top: 0.08rem;
  font-size: 0.74rem;
  color: var(--text3);
  line-height: 1.38;
}

.tu-modulepick-preview {
  margin-top: 0.85rem;
  padding: 0.55rem 0.72rem;
  border-radius: 10px;
  border: 1px dashed var(--border2);
  background: color-mix(in srgb, var(--surface2) 38%, transparent);
}

.tu-modulepick-preview__title {
  margin: 0 0 0.45rem;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text3);
}

.tu-modulepick-preview__list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  color: var(--text2);
  line-height: 1.42;
}

.tu-modulepick-preview__more {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--text3);
}

.tu-module-apply-placement-details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--accent-dark);
  margin: 0.25rem 0 0;
}

/* Einfügen zwischen Ablaufzeilen (Übung / Modul / Anmerkung) */
.tu-insert-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 11px;
  margin: -1px 0 3px;
  padding: 0 4px;
}

.tu-insert-slot__btn {
  appearance: none;
  margin: 0;
  cursor: pointer;
  border: 1px dashed var(--border2);
  background: color-mix(in srgb, var(--surface2) 90%, transparent);
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  padding: 2px 9px;
  border-radius: 999px;
  opacity: 0.78;
}

.tu-insert-slot__btn:hover,
.tu-insert-slot__btn:focus-visible {
  opacity: 1;
  outline: none;
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-light) 40%, var(--surface2));
}

.tu-insert-chooser-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tu-insert-chooser-actions__full {
  width: 100%;
  justify-content: center;
}

.tu-item-row--separator-note {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.tu-item-row__separator-line {
  width: 100%;
  margin: 0.2rem 0 0;
  min-height: 1px;
  border: none;
  border-top: 2px solid var(--border);
  opacity: 0.92;
}

.training-unit-sections-editor .tu-item-row {
  border-top: none;
  margin-top: 0;
}

.training-unit-sections-editor .tu-item-row--exercise {
  margin-top: 0.58rem;
  padding: 0.55rem 0.72rem 0.55rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--border2) 85%, var(--accent) 15%);
  background: linear-gradient(160deg, var(--surface) 0%, color-mix(in srgb, var(--surface2) 35%, var(--surface)) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.56) inset,
    0 2px 10px rgba(15, 23, 42, 0.05);
}

.training-unit-sections-editor .tu-item-row--note:not(.tu-item-row--separator-note) {
  margin-top: 0.52rem;
  padding: 0.48rem 0.72rem;
  border-radius: 11px;
  border: 1px solid color-mix(in srgb, var(--border2) 70%, transparent);
  background: color-mix(in srgb, var(--surface2) 28%, var(--surface));
}

.training-unit-sections-editor .tu-item-row--separator-note {
  margin-top: 0.42rem;
  border-radius: 10px;
  border: 1px dashed color-mix(in srgb, var(--border2) 75%, transparent);
  background: color-mix(in srgb, var(--surface2) 15%, transparent);
}

.training-unit-sections-editor .tu-item-row--from-module.tu-item-row--exercise,
.training-unit-sections-editor .tu-item-row--from-module.tu-item-row--note:not(.tu-item-row--separator-note) {
  border-left: 4px solid var(--accent);
  padding-left: 0.6rem;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.52) inset,
    0 2px 12px rgba(29, 158, 117, 0.07),
    inset 10px 0 0 color-mix(in srgb, var(--accent) 14%, transparent);
}

/* Kompakt: Modulfarbe über CSS-Variable --tu-mod-border (pro Zeile gesetzt). */
.training-unit-sections-editor .tu-item-row--from-module-soft.tu-item-row--exercise,
.training-unit-sections-editor .tu-item-row--from-module-soft.tu-item-row--note:not(.tu-item-row--separator-note) {
  border-left: 4px solid var(--tu-mod-border, var(--accent));
  padding-left: 0.62rem;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.52) inset,
    0 2px 12px rgba(15, 23, 42, 0.05);
}

.tu-planning-mod-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 1 auto;
  max-width: 100%;
  margin: 0;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border2) 70%, transparent);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text1);
}

.tu-planning-mod-tag__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tu-planning-mod-tag__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tu-section-mod-legend {
  margin-top: 0.75rem;
  padding: 0.5rem 0.62rem;
  border-radius: 11px;
  border: 1px solid color-mix(in srgb, var(--border2) 80%, transparent);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.tu-section-mod-legend__caption {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
  margin-bottom: 0.42rem;
}

.tu-section-mod-legend__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem 0.72rem;
}

.tu-section-mod-legend__item {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  flex: 1 1 200px;
  min-width: 0;
}

.tu-section-mod-legend__swatch {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 0.26rem;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.tu-section-mod-legend__title {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text1);
}

.tu-section-mod-legend__meta {
  display: block;
  font-size: 0.72rem;
  line-height: 1.42;
  color: var(--text3);
}

.tu-item-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px 8px;
  margin-top: 0.5rem;
  padding: 0.4rem 6px 0.45rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  min-width: 0;
  transition: outline 0.1s ease;
  border-radius: 8px;
}

.tu-item-row--drop-target {
  outline: 2px dashed var(--accent);
  outline-offset: 1px;
}

.tu-item-row--dragging {
  opacity: 0.52;
}

.tu-row-grip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: flex-start;
  padding: 4px 2px;
  margin-top: 2px;
  border-radius: 6px;
  color: var(--text3);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.tu-row-grip:active {
  cursor: grabbing;
}

.tu-item-row__nudge {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-top: 4px;
}

.tu-item-row__nudge button {
  padding: 0 5px;
  line-height: 1.2;
  font-size: 11px;
  min-height: 20px;
  border: none;
  background: transparent;
  color: var(--text2);
  border-radius: 4px;
}

.tu-item-row__nudge button:disabled {
  opacity: 0.3;
}

.tu-item-row__nudge button:not(:disabled):hover {
  background: rgba(0, 0, 0, 0.06);
}

.tu-item-row__mainline {
  display: flex;
  flex: 1;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: flex-start;
  min-width: 0;
  width: 100%;
}

.tu-item-row--note .tu-icon-btn,
.tu-item-row--note .tu-item-row__remove {
  align-self: center;
}

.tu-item-row--note .tu-item-row__body--note {
  flex: 1;
  min-width: 0;
}

.tu-item-row--note {
  flex-wrap: nowrap;
}

.tu-item-row__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tu-item-row__meta-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text3);
}

.tu-item-row__preview {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--text1);
  word-break: break-word;
}

.tu-item-row__preview--clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.tu-item-row__preview--empty {
  color: var(--text3);
}

.tu-icon-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text2);
  cursor: pointer;
  line-height: 0;
}

.tu-icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.tu-item-row__remove {
  flex: 0 0 auto;
  padding: 5px 10px;
  min-height: 32px;
  font-size: 12px;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  line-height: 1;
}

.tu-item-row__remove:hover {
  filter: brightness(1.05);
}

.tu-item-row__side {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
}

.tu-ex-duration {
  margin: 0;
  width: 4.75rem;
  font-size: 0.84rem;
}

.tu-ex-title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
}

.tu-ex-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  flex: 1 1 220px;
  min-width: 0;
  word-break: break-word;
}

.tu-ex-title-placeholder {
  font-size: 0.9rem;
  color: var(--text3);
  font-style: italic;
}

.tu-ex-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.tu-ex-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.tu-ex-variant-select {
  margin: 0;
  flex: 0 1 min(220px, 100%);
  font-size: 0.82rem;
  min-width: 0;
}

.training-unit-sections-editor--wide .tu-ex-variant-select--wide {
  flex-basis: min(320px, 100%);
}

.tu-ex-annot {
  flex: 1 1 140px;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.tu-ex-annot__text {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tu-ex-debrief {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.75rem;
  gap: 10px 14px;
  align-items: start;
  width: 100%;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border2, rgba(0, 0, 0, 0.08));
  box-sizing: border-box;
}

.tu-ex-debrief__grow {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tu-ex-debrief__textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 4.75rem;
  resize: vertical;
  font-size: 0.88rem;
  line-height: 1.45;
}

.tu-ex-debrief__ist {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: stretch;
  justify-self: end;
  width: 4.75rem;
  flex-shrink: 0;
}

.tu-ex-debrief__ist .tu-ex-duration {
  width: 100%;
  margin: 0;
}

@media (max-width: 520px) {
  .tu-ex-debrief {
    grid-template-columns: 1fr;
  }

  .tu-ex-debrief__ist {
    width: 100%;
    max-width: 10rem;
    justify-self: start;
  }
}

.tu-textedit-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10060;
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 14px 40px;
}

.tu-textedit-panel {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 1rem 1.15rem 1.1rem;
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.22);
}

.tu-textedit-title {
  margin: 0 0 0.65rem;
  font-size: 1.03rem;
}

.tu-textedit-textarea {
  width: 100%;
  resize: vertical;
  min-height: 100px;
  margin-bottom: 0.85rem;
}

.tu-textedit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.tu-section-shell {
  contain: layout;
}

.tu-section-dropband {
  height: 10px;
  margin: 0 2px 4px;
  border-radius: 6px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.tu-section-dropband--end {
  margin-top: 2px;
  margin-bottom: 10px;
}

.tu-section-dropband--active {
  background: color-mix(in srgb, var(--accent) 26%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 42%, transparent);
}

.tu-sec-drag-grip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 4px;
  cursor: grab;
  color: var(--text3);
  user-select: none;
  touch-action: none;
  border-radius: 6px;
}

.tu-sec-drag-grip:active {
  cursor: grabbing;
}

.tu-item-append-drop {
  min-height: 16px;
  margin: 2px -2px 6px;
  border-radius: 6px;
  box-sizing: border-box;
}

.tu-item-append-drop--active {
  outline: 2px dashed var(--accent);
  outline-offset: 1px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.framework-slot-card__head {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 6px;
  flex-shrink: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.framework-slot-card__drag-handle {
  flex: 0 0 auto;
  cursor: grab;
  user-select: none;
  font-size: 14px;
  line-height: 1;
  padding: 6px 4px;
  color: var(--text3);
  border-radius: 6px;
}

.framework-slot-card__drag-handle:active {
  cursor: grabbing;
}

.framework-slot-card__head-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.framework-slot-card__slot-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
}

.framework-slot-card__title-input {
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 600;
}

.framework-slot-card__slot-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.framework-slot-details {
  flex-shrink: 0;
  margin-top: 8px;
  font-size: 0.88rem;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
}

.framework-slot-details__summary {
  cursor: pointer;
  padding: 6px 10px;
  font-weight: 600;
  color: var(--text2);
  list-style: none;
}

.framework-slot-details__summary::-webkit-details-marker {
  display: none;
}

.framework-slot-details .form-row {
  margin-bottom: 10px;
  padding: 0 10px 8px;
}

.framework-slot-card__exercises {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 10px;
  gap: 6px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.framework-slot-card__exercises-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
}

.framework-slot-card__exercises-title {
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-dark);
}

.framework-slot-card__empty-hint {
  font-size: 0.82rem;
  color: var(--text2);
  margin: 4px 0 6px;
}

.framework-ex-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 6px;
  padding: 8px 8px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: var(--surface2);
  flex-shrink: 0;
}

.framework-ex-row__grip {
  flex: 0 0 auto;
  cursor: grab;
  user-select: none;
  line-height: 1.4;
  padding-top: 2px;
  color: var(--text3);
  font-size: 14px;
}

.framework-ex-row__grip:active {
  cursor: grabbing;
}

.framework-ex-row__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.framework-ex-row__title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
}

.framework-ex-row__title {
  font-size: 0.98rem;
  line-height: 1.35;
}

.framework-ex-row__title--muted {
  color: var(--text3);
  font-weight: 500;
}

.framework-ex-row__id {
  font-size: 11px;
  color: var(--text3);
}

.framework-ex-row__row2 {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.framework-ex-row__variant-spacer {
  flex: 1;
  min-width: 0;
}

.framework-ex-row__menu-anchor {
  flex: 0 0 auto;
}

.framework-ex-row__kebab {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: var(--surface);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text2);
}

.framework-ex-row__kebab:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.framework-ex-row__variant-select {
  flex: 1 1 auto;
  min-width: 100px;
  max-width: 100%;
  padding: 6px 8px;
  font-size: 13px;
}

.framework-slot-card__append-drop {
  margin-top: 4px;
  padding: 8px 10px;
  font-size: 11px;
  color: var(--text3);
  border: 1px dashed var(--border2);
  border-radius: 8px;
  text-align: center;
  flex-shrink: 0;
}

@media (min-width: 900px) {
  .framework-slot-card__slot-actions {
    flex-direction: row;
    align-items: center;
  }
}

/* ── Trainingsplanung: Abschnitt „Neue Trainingseinheit“ + Vorlage im Modal ───────── */
.training-planning-create--in-card {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border, rgba(0, 0, 0, 0.08));
}

.training-planning-create__intro {
  margin-bottom: 1rem;
}

.training-planning-create__title {
  margin: 0 0 0.45rem;
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--text1);
  letter-spacing: -0.01em;
}

.training-planning-create__lede {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text2);
  max-width: 52rem;
}

.training-planning-create__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.training-planning-create__cta {
  min-height: 44px;
  padding-left: 1.35rem;
  padding-right: 1.35rem;
  font-weight: 600;
}

.training-planning-create__secondary {
  min-height: 44px;
  padding-left: 1rem;
  padding-right: 1rem;
}

.training-planning-create__hint {
  margin: 0.85rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text3);
  max-width: 48rem;
}

.training-planning-create__hint--warn {
  color: var(--text2);
  margin-top: 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border2);
}

.training-planning-template-panel {
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--border2);
  background: linear-gradient(165deg, var(--surface2) 0%, var(--surface) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.training-planning-template-panel__label {
  font-weight: 600;
  margin-bottom: 0.4rem;
  display: block;
}

.training-planning-template-panel__select {
  font-size: 0.94rem;
  padding: 0.55rem 0.65rem;
  width: 100%;
  max-width: 100%;
}

.training-planning-template-panel__help {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: var(--text2);
  line-height: 1.48;
}

@media print {
  .desktop-sidebar,
  .bottom-nav,
  .app-header--mobile,
  .no-print {
    display: none !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .app-shell {
    max-width: none !important;
  }
  .app-main {
    padding: 12px 14px 20px !important;
  }
  .training-run-page {
    max-width: none !important;
    padding: 0 !important;
  }
  .training-run-section,
  .training-run-header {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* Coach — volle Übung, Nur-Mittelbereich scrollt; Steuerung oben/unten sichtbar */
.training-coach-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: calc(100dvh - var(--header-h) - var(--nav-h) - env(safe-area-inset-bottom, 0px) - 48px);
}

@media (min-width: 1024px) {
  .training-coach-layout {
    min-height: calc(100dvh - env(safe-area-inset-bottom, 0px) - 24px);
  }
}

.training-coach-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

/* ——— Medienbibliothek (/media) ——— */
.media-library {
  padding: max(12px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
    max(24px, env(safe-area-inset-bottom, 0px) + 8px) max(16px, env(safe-area-inset-left, 0px));
}
.media-library__container {
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
}
.media-library__hero {
  margin-bottom: 1.25rem;
}
.media-library__hero-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.media-library__title {
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.media-library__hero-links {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
}
.media-library__hero-links a {
  color: var(--accent-dark);
}
.media-library__intro {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--text2);
  line-height: 1.5;
  max-width: 46rem;
}
.media-library__toolbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.media-library__toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.media-library__search {
  flex: 1 1 200px;
  min-width: 0;
}
.media-library__select {
  min-width: 160px;
}
.media-library__view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.media-library__toolbar-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
}
.media-library__filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}
.media-library__filters-row .form-input,
.media-library__filters-row select.form-input {
  min-width: 0;
  flex: 1 1 140px;
  max-width: 240px;
}
.media-library__upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.media-library__upload-row .form-input {
  min-width: 0;
  flex: 0 1 160px;
  max-width: 220px;
}
.media-library__upload-summary {
  font-size: 0.85rem;
  color: var(--text2);
  flex: 1 1 200px;
}
.media-library__grid-top-anchor {
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}
.media-library__upload-icon {
  vertical-align: middle;
  margin-right: 6px;
}
.media-library__sr-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.media-library__card-type {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text2);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  pointer-events: none;
}
/* Kachel: unten links — Checkbox liegt oben links */
.media-library__card-type--thumb-bl {
  left: 6px;
  bottom: 6px;
  top: auto;
}
.media-library__card-type--compact {
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  bottom: auto;
  border-radius: 6px;
}
.media-library__card-copyright {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text2);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  pointer-events: none;
}
.media-library__card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.media-library__tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.media-library__tag-chip {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface2);
  color: var(--text2);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-library__usage-links {
  font-size: 0.72rem;
  line-height: 1.45;
  margin-top: 8px;
  color: var(--text2);
}
.media-library__usage-links a {
  color: var(--accent-dark, #2563eb);
  text-decoration: none;
  margin-right: 8px;
}
.media-library__usage-links a:hover {
  text-decoration: underline;
}
.media-library__check-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.media-library__refresh {
  margin-left: auto;
}
.media-library__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text1);
  cursor: pointer;
}
.media-library__icon-btn--on {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent-dark);
}
.media-library__err {
  color: var(--danger);
  margin-bottom: 1rem;
}
.media-library__empty,
.media-library__hint {
  color: var(--text2);
  font-size: 0.9rem;
}
.media-library__spinner {
  margin: 2rem auto;
}
.media-library__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 14px;
}
@media (min-width: 768px) {
  .media-library__grid {
    grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
    gap: 16px;
  }
}
.media-library__card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.media-library__card-check {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.media-library__card-check input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}
.media-library__card-menu {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  color: var(--text1);
}
.media-library__card-thumb-hit {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  text-align: left;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.media-library__card-thumb-hit:active {
  opacity: 0.96;
}
.media-library__card-thumb-wrap {
  aspect-ratio: 1;
  background: var(--surface2);
  position: relative;
}
.media-library__thumb-img,
.media-library__thumb-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media-library__thumb-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text3);
  font-weight: 600;
}
.media-library__card-footer {
  padding: 10px 10px 12px;
  min-height: 0;
}
.media-library__card-name {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-library__card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  font-size: 0.7rem;
  color: var(--text2);
}
.media-library__card-tags span {
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 6px;
}
.media-library__table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.media-library__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.media-library__table th,
.media-library__table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.media-library__table th {
  font-weight: 600;
  color: var(--text2);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.media-library__th-check {
  width: 40px;
}
.media-library__th-act {
  width: 52px;
}
.media-library__td-thumb {
  width: 72px;
}
.media-library__table-thumb {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface2);
}
.media-library__table-thumb-hit {
  display: block;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  font: inherit;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}
.media-library__table-thumb-hit:focus-visible {
  outline: 2px solid var(--accent, #3b82f6);
  outline-offset: 2px;
}
.media-library__table-thumb .media-library__thumb-img,
.media-library__table-thumb .media-library__thumb-video {
  width: 56px;
  height: 56px;
}
.media-library__td-name {
  font-weight: 500;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.media-library__td-sub {
  font-size: 0.8rem;
  color: var(--text2);
  max-width: 160px;
}
@media (max-width: 639px) {
  .media-library__th-tags,
  .media-library__td-tags,
  .media-library__th-usage,
  .media-library__td-usage {
    display: none;
  }
}
.media-library__overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: env(safe-area-inset-top, 0px) 0 0;
}
@media (min-width: 640px) {
  .media-library__overlay {
    align-items: center;
    padding: 24px 16px;
  }
}
.media-library__modal {
  width: 100%;
  max-width: 480px;
  max-height: min(92vh, 720px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.2);
}
@media (min-width: 640px) {
  .media-library__modal {
    border-radius: 16px;
    max-height: 90vh;
  }
}
.media-library__modal--wide {
  max-width: 520px;
}
.media-library__modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.media-library__modal-head h2 {
  margin: 0;
  font-size: 1.1rem;
}
.media-library__modal-body {
  padding: 16px 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.media-library__check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  cursor: pointer;
}
.media-library__meta-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--surface2);
  border-radius: 10px;
  font-size: 0.85rem;
}
.media-library__meta-k {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text3);
  margin-bottom: 2px;
}
.media-library__meta-v {
  color: var(--text1);
  word-break: break-word;
}
.media-library__meta-v.mono {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
}
.media-library__modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.media-library__lc-block {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.media-library__lc-block--danger {
  background: rgba(216, 90, 48, 0.06);
  margin: 8px -18px -24px;
  padding: 16px 18px 20px;
  border-radius: 0 0 16px 16px;
}
.media-library__lc-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 10px;
}
.media-library__lc-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.media-library__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.media-library__row .form-input {
  flex: 1 1 160px;
  min-width: 0;
}

/* P-11: Legal Hold */
.media-library__lc-block--legal-hold {
  background: rgba(216, 90, 48, 0.08);
  border: 1px solid rgba(216, 90, 48, 0.3);
  border-radius: 8px;
  margin-top: 8px;
  padding: 12px 14px 14px;
}
.media-library__legal-hold-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
  background: var(--danger);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 4px;
  text-transform: uppercase;
}
.media-library__legal-hold-info {
  font-size: 0.8rem;
  color: var(--text2);
  margin: 0 0 8px;
}
.media-library__btn--legal-hold {
  color: var(--danger);
  border-color: var(--danger);
}
.media-library__btn--legal-hold:hover {
  background: rgba(216, 90, 48, 0.08);
}
.media-library__btn--legal-hold-confirm {
  background: var(--danger);
  color: #fff;
  border: none;
}
.media-library__btn--legal-hold-confirm:hover {
  background: #b84a22;
}
.media-library__legal-hold-dialog-asset {
  font-size: 0.9rem;
  margin-bottom: 12px;
  color: var(--text1);
}
.media-library__legal-hold-warning {
  background: rgba(216, 90, 48, 0.08);
  border-left: 3px solid var(--danger);
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 12px;
  color: var(--text2);
}
.media-library__modal--narrow {
  max-width: 500px;
  width: 90%;
}

/* Vorschau-Modal (Vollbild nah) */
.media-library__overlay--preview {
  background: rgba(0, 0, 0, 0.72);
  z-index: 210;
}
.media-library__modal--preview {
  max-width: min(92vw, 960px);
  width: 100%;
  max-height: min(94vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.media-library__modal--preview .media-library__modal-head {
  flex-shrink: 0;
}
.media-library__preview-title {
  flex: 1;
  min-width: 0;
  font-size: 1rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 8px;
}
.media-library__modal--preview .media-library__modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.media-library__preview-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.media-library__preview-body {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px 20px;
  background: var(--surface2);
}
.media-library__preview-img {
  max-width: 100%;
  max-height: min(78vh, 720px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}
.media-library__preview-video {
  width: 100%;
  max-height: min(78vh, 720px);
  border-radius: 8px;
  background: #000;
}
.media-library__preview-fallback {
  text-align: center;
  padding: 24px 16px;
  max-width: 360px;
}
.media-library__preview-fallback .btn {
  margin-top: 12px;
}

/* Organisation: Posteingang (Nav-Badge, Sidebar, Dashboard-Widget) */
.nav-item__badge {
  position: absolute;
  top: 2px;
  right: 6px;
  min-width: 1.1rem;
  padding: 1px 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 1px var(--surface);
}
.desktop-sidebar__badge {
  margin-left: auto;
  flex-shrink: 0;
  min-width: 1.25rem;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  background: var(--accent);
  color: #fff;
}
.desktop-sidebar__link > span:not(.desktop-sidebar__badge) {
  flex: 1;
  min-width: 0;
}

.dashboard-org-inbox-widget {
  display: none;
}
@media (min-width: 1024px) {
  .dashboard-org-inbox-widget {
    display: block;
    margin-bottom: 1.25rem;
  }
}
.dashboard-org-inbox-widget__inner {
  padding: 1rem 1.1rem;
}
.dashboard-org-inbox-widget__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.dashboard-org-inbox-widget__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}
.dashboard-org-inbox-widget__icon {
  color: var(--accent);
  flex-shrink: 0;
}
.dashboard-org-inbox-widget__badge {
  font-size: 0.8rem;
  font-weight: 700;
  min-width: 1.5rem;
  text-align: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
}
.dashboard-org-inbox-widget__lead {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
}
.dashboard-org-inbox-widget__list {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.dashboard-org-inbox-widget__item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-size: 0.9rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}
.dashboard-org-inbox-widget__item:last-child {
  border-bottom: none;
}
.dashboard-org-inbox-widget__club {
  font-weight: 600;
  color: var(--text1);
}
.dashboard-org-inbox-widget__applicant {
  color: var(--text2);
}
.dashboard-org-inbox-widget__footer {
  margin-top: 0.25rem;
}

.inbox-page__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.inbox-page__list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.inbox-request-card {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
}
.inbox-request-card__club {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.2rem;
}
.inbox-request-card__applicant {
  display: block;
  font-size: 1.02rem;
}
.inbox-request-card__meta {
  font-size: 0.86rem;
  margin-top: 0.25rem;
}
.inbox-request-card__message {
  margin: 0.5rem 0 0;
  font-size: 0.92rem;
  line-height: 1.45;
}
.inbox-request-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Superadmin Media Journal */
.media-library__journal-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}
.media-library__journal-entry {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.media-library__journal-entry-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.media-library__journal-action {
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  padding: 1px 7px;
  letter-spacing: 0.01em;
}
.media-library__journal-arrow {
  color: var(--text3);
  font-size: 0.85rem;
}
.media-library__journal-vis {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text1);
}
.media-library__journal-date {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text3);
  white-space: nowrap;
}
.media-library__journal-entry-by {
  font-size: 0.8rem;
  color: var(--text2);
  margin-bottom: 8px;
}
.media-library__journal-version {
  font-size: 0.74rem;
  color: var(--text3);
}
.media-library__journal-fields {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.media-library__journal-field {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.82rem;
}
.media-library__journal-field-label {
  color: var(--text2);
  min-width: 180px;
}
.media-library__journal-field-val {
  font-weight: 600;
  border-radius: 3px;
  padding: 0 5px;
  font-size: 0.78rem;
}
.media-library__journal-field-val--yes {
  background: rgba(29, 158, 117, 0.12);
  color: var(--accent-dark);
}
.media-library__journal-field-val--no {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text2);
}
.media-library__journal-field-context {
  font-size: 0.78rem;
  color: var(--text2);
  font-style: italic;
}
/* Audit events (Sichtbarkeit, Copyright, Lifecycle) */
.media-library__journal-entry--audit {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  background: color-mix(in srgb, var(--accent) 4%, var(--surface2));
}
.media-library__journal-action--audit {
  background: var(--text3);
  color: var(--surface);
}
.media-library__journal-audit-vals {
  font-size: 0.82rem;
  color: var(--text1);
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.media-library__journal-audit-row {
  display: flex;
  gap: 6px;
}
.media-library__journal-audit-label {
  color: var(--text3);
  min-width: 40px;
  flex-shrink: 0;
}
/* Correction entries */
.media-library__journal-entry--correction {
  border-color: color-mix(in srgb, #e0a000 40%, var(--border));
  background: color-mix(in srgb, #e0a000 5%, var(--surface2));
}
.media-library__journal-action--correction {
  background: #b07800;
  color: #fff;
}
.media-library__journal-correction-note {
  font-size: 0.82rem;
  color: var(--text2);
  margin-bottom: 6px;
  font-style: italic;
}
/* Correction form */
.media-library__journal-correction-form {
  margin-top: 20px;
  padding: 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.media-library__journal-correction-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text1);
}
