/* =====================================================================
   Eigene Bausteine dieses Reports. Nach shared.css geladen.
   Nur Tokens aus dem Theme, keine festen Farben, Größen in rem
   (1rem = 20px). 0.7rem ist die Untergrenze und nur für Versal-Etiketten.
   ===================================================================== */

/* ---- Kennzahlen-Kacheln ------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.8rem; margin: 1.25rem 0 2rem; }
.stats:has(> .stat:nth-child(4):last-child) { grid-template-columns: repeat(2, 1fr); }
.stat { background: var(--surface); border: 1px solid var(--grey-200); border-radius: var(--radius-md);
  padding: 1rem 1.1rem; box-shadow: var(--shadow-card); }
.stat-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 500; color: var(--grey-700); }
.stat-value { font-family: var(--font-display); font-size: 2rem; font-weight: 700; line-height: 1.15;
  font-variant-numeric: tabular-nums; color: var(--grey-900); margin: 0.15rem 0; }
.stat-note { font-size: 0.85rem; color: var(--grey-700); line-height: 1.4; }

/* ---- Chips ---------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.4rem 0; padding: 0; list-style: none; }
.chip { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; line-height: 1.35;
  padding: 0.12rem 0.6rem; border-radius: 999px; background: var(--grey-100); color: var(--grey-900);
  border: 1px solid var(--grey-200); white-space: nowrap; }
.chip--blue   { background: var(--blue-bg);   color: var(--blue-text);   border-color: transparent; }
.chip--green  { background: var(--green-bg);  color: var(--green-text);  border-color: transparent; }
.chip--yellow { background: var(--yellow-bg); color: var(--yellow-text); border-color: transparent; }
.chip--red    { background: var(--red-bg);    color: var(--red-text);    border-color: transparent; }
.chip--wrap   { white-space: normal; }

/* ---- Filterleiste --------------------------------------------------- */
.filterbar { display: flex; flex-wrap: wrap; gap: 0.7rem 0.9rem; align-items: flex-end; position: sticky; top: 0;
  z-index: 20; background: var(--surface); padding: 0.8rem 0; border-bottom: 1px solid var(--grey-200);
  margin: 1rem 0 0; }
.filterbar .field { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.filterbar .field--grow { flex: 1 1 220px; }
.filterbar label, .filterbar .field-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em;
  font-weight: 500; color: var(--grey-700); }
.filterbar select, .filterbar input[type="search"] { font: inherit; font-size: 0.85rem; color: var(--grey-900);
  background: var(--surface); border: 1px solid var(--grey-300); border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem; min-width: 0; max-width: 100%; }
.filterbar select:focus-visible, .filterbar input:focus-visible, .toggle:focus-visible,
.sortbtn:focus-visible, .datarow:focus-visible, .iconbtn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.toggle { font: inherit; font-size: 0.85rem; cursor: pointer; color: var(--grey-900); background: var(--surface);
  border: 1px solid var(--grey-300); border-radius: var(--radius-sm); padding: 0.4rem 0.75rem; white-space: nowrap; }
.toggle[aria-pressed="true"] { background: var(--blue-bg); color: var(--blue-text); border-color: var(--accent); }
.filterbar .count { margin-left: auto; font-size: 0.85rem; color: var(--grey-700); font-variant-numeric: tabular-nums;
  align-self: center; white-space: nowrap; }

/* ---- Datentabelle --------------------------------------------------- */
.datatable { width: 100%; margin: 0 0 1.5rem; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.datatable th { position: sticky; top: var(--bar-h, 4.2rem); z-index: 10; white-space: nowrap; padding: 0; }
.sortbtn { all: unset; box-sizing: border-box; display: block; width: 100%; cursor: pointer; padding: 0.6rem 0.7rem;
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500; color: var(--grey-700); }
.sortbtn:hover { color: var(--accent); }
.sortbtn[data-dir]::after { content: " ▲"; }
.sortbtn[data-dir="desc"]::after { content: " ▼"; }
.sortbtn[data-dir] { color: var(--grey-900); }
.datatable td { padding: 0.6rem 0.7rem; font-size: 0.85rem; vertical-align: middle; }
.datarow { cursor: pointer; }
.datarow:hover td, .datarow.is-open td { background: var(--blue-bg); }
.cell-name { font-weight: 500; color: var(--grey-900); display: block; }
.cell-sub { font-size: 0.8rem; color: var(--grey-700); display: block; overflow-wrap: anywhere; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { padding: 2rem 1rem; text-align: center; color: var(--grey-700); }

/* Note 1–5 als Punktreihe; die Zahl steht daneben, Farbe allein trägt nichts */
.grade { display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.grade i { display: inline-flex; gap: 2px; }
.grade i b { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--grey-300); display: block; }
.grade i b.on { background: var(--accent); }
.grade span { font-size: 0.85rem; font-weight: 500; }

/* Abdeckung 0–3 je Thema oder Stufe: vier kleine Säulen mit Buchstabe */
.cover { display: inline-flex; gap: 3px; align-items: flex-end; }
.cover span { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 0.7rem;
  color: var(--grey-700); text-transform: uppercase; line-height: 1; }
.cover span i { display: block; width: 0.9rem; height: 1.2rem; border-radius: 3px; background: var(--grey-200);
  position: relative; overflow: hidden; }
.cover span i::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--v, 0) * 33.4%);
  background: var(--accent); }

/* ---- Seitenleiste (Drawer) ------------------------------------------ */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 200; display: flex; justify-content: flex-end; }
.scrim[hidden] { display: none; }
.drawer { width: min(980px, 96vw); height: 100%; background: var(--surface-alt); overflow-y: auto;
  box-shadow: var(--shadow-lift); animation: drawer-in 0.22s ease-out; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .drawer { animation: none; } }
.drawer-open, .drawer-open body { overflow: hidden; }
.drawer-head { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--grey-200);
  padding: 1rem 1.5rem 0; }
.drawer-head .r1 { display: flex; gap: 1rem; align-items: flex-start; }
.drawer-head .titles { flex: 1; min-width: 0; }
.drawer-head h2 { margin: 0; font-size: 1.4rem; line-height: 1.25; }
.drawer-meta { font-size: 0.85rem; color: var(--grey-700); margin-top: 0.2rem; overflow-wrap: anywhere; }
.drawer-actions { display: flex; gap: 0.4rem; align-items: center; flex: none; }
.iconbtn { font: inherit; font-size: 0.9rem; min-width: 2rem; height: 2rem; padding: 0 0.5rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; background: var(--surface); color: var(--grey-700);
  border: 1px solid var(--grey-300); border-radius: var(--radius-sm); text-decoration: none; white-space: nowrap; }
.iconbtn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.iconbtn:disabled { opacity: 0.4; cursor: default; }
.drawer-nav { display: flex; gap: 1rem; overflow-x: auto; padding: 0.8rem 0 0; scrollbar-width: none; }
.drawer-nav::-webkit-scrollbar { display: none; }
.drawer-nav button { all: unset; cursor: pointer; font-size: 0.85rem; font-weight: 500; color: var(--grey-700);
  padding: 0 0 0.5rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.drawer-nav button:hover { color: var(--accent); }
.drawer-nav button[aria-current="true"] { color: var(--grey-900); border-bottom-color: var(--accent); }
.drawer-body { padding: 1rem 1.5rem 4rem; display: flex; flex-direction: column; gap: 1rem; }
.dsec { background: var(--surface); border: 1px solid var(--grey-200); border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem; box-shadow: var(--shadow-card); scroll-margin-top: 8rem; }
.dsec > h3 { margin: 0 0 0.5rem; font-size: 1.15rem; }
.dsec > h4 { margin: 1rem 0 0.3rem; }
.dsec p { margin: 0 0 0.6rem; }
.dsec p:last-child { margin-bottom: 0; }
.dsec ul { margin: 0.2rem 0 0.6rem; padding-left: 1.2rem; }
.dsec li { margin: 0.25rem 0; }
.verdict { font-size: 1rem; color: var(--grey-900); }
.kv { display: grid; grid-template-columns: 11rem 1fr; gap: 0.35rem 1rem; font-size: 0.9rem; margin: 0.4rem 0; }
.kv dt { color: var(--grey-700); font-weight: 500; }
.kv dd { margin: 0; color: var(--grey-900); overflow-wrap: anywhere; }
.learn { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.learn li { background: var(--green-bg); color: var(--grey-900); border-left: 4px solid var(--success);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 0.6rem 0.9rem; margin: 0; }
.learn--avoid li { background: var(--yellow-bg); border-left-color: var(--warning); }
.learn--flag li { background: var(--red-bg); border-left-color: var(--danger); }
.twoup { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.serp { border: 1px solid var(--grey-200); border-radius: var(--radius-sm); padding: 0.8rem 1rem; background: var(--surface); }
.serp-url { font-size: 0.8rem; color: var(--grey-700); overflow-wrap: anywhere; }
.serp-title { font-size: 1.05rem; color: var(--blue-text); font-weight: 500; line-height: 1.3; margin: 0.15rem 0; }
.serp-desc { font-size: 0.85rem; color: var(--grey-700); line-height: 1.45; }
.serp-meta { font-size: 0.8rem; color: var(--grey-700); margin-top: 0.4rem; }
.pagelist { width: 100%; font-size: 0.85rem; }
.pagelist td, .pagelist th { padding: 0.45rem 0.6rem; }
.pagelist th { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; }

/* ---- Zitate --------------------------------------------------------- */
.quote { margin: 0.6rem 0; padding: 0.7rem 1rem; background: var(--surface-alt); border-left: 4px solid var(--grey-300);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.quote p { margin: 0; font-style: italic; color: var(--grey-900); }
.quote footer { margin-top: 0.35rem; font-size: 0.8rem; color: var(--grey-700); overflow-wrap: anywhere; }
.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0.6rem; margin: 1rem 0 1.5rem; }
.quotes .quote { margin: 0; }

/* ---- Stufenleiter (fünf Bewusstseinsstufen) -------------------------- */
.levels { display: grid; gap: 0.6rem; margin: 1rem 0 1.5rem; padding: 0; list-style: none; counter-reset: none; }
.level { display: grid; grid-template-columns: 3rem 1fr; gap: 0.9rem; background: var(--surface);
  border: 1px solid var(--grey-200); border-radius: var(--radius-md); padding: 0.9rem 1.1rem; box-shadow: var(--shadow-card); }
.level-no { width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; }
.level h3, .level h4 { margin: 0 0 0.2rem; color: var(--grey-900); }
.level p { margin: 0 0 0.4rem; }
.queries { list-style: none; padding: 0; margin: 0.3rem 0; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.queries li { font-family: var(--font-mono); font-size: 0.8rem; background: var(--grey-100); border: 1px solid var(--grey-200);
  border-radius: var(--radius-sm); padding: 0.1rem 0.5rem; color: var(--grey-900); }
.queries li.is-clinical { background: var(--yellow-bg); color: var(--yellow-text); border-color: transparent; }
.queries li.is-derived { border-style: dashed; color: var(--grey-700); }
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; font-size: 0.8rem; color: var(--grey-700); margin: 0.5rem 0 1rem; }
.legend span { display: inline-flex; align-items: center; gap: 0.35rem; }

/* ---- Ja/Nein-Beispiele ------------------------------------------------ */
.pairs { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.6rem; margin: 0.6rem 0 1rem; }
.pair { border-radius: var(--radius-sm); padding: 0.7rem 0.9rem; }
.pair--ok  { background: var(--green-bg); }
.pair--no  { background: var(--red-bg); }
.pair-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 500; display: block; margin-bottom: 0.25rem; }
.pair--ok .pair-label { color: var(--green-text); }
.pair--no .pair-label { color: var(--red-text); }
.pair ul { margin: 0; padding-left: 1.1rem; }
.pair li { margin: 0.2rem 0; color: var(--grey-900); }

.sources { font-size: 0.8rem; color: var(--grey-700); margin: 0.3rem 0 0; overflow-wrap: anywhere; }
.rule { border: 1px solid var(--grey-200); border-radius: var(--radius-md); padding: 1rem 1.2rem; margin: 0.8rem 0;
  background: var(--surface); box-shadow: var(--shadow-card); }
.rule > h4 { margin: 0 0 0.3rem; color: var(--grey-900); font-size: 1rem; }
.rule p { margin: 0 0 0.5rem; }
.content details.more { margin: 0.6rem 0; }
.content details.more > summary { cursor: pointer; color: var(--accent); font-weight: 500; font-size: 0.9rem; }
.checklist { list-style: none; padding: 0; margin: 0.6rem 0 1.4rem; display: grid; gap: 0.4rem; }
.checklist li { display: grid; grid-template-columns: 1.4rem 1fr; gap: 0.5rem; align-items: start; }
.checklist input { width: 1.1rem; height: 1.1rem; margin-top: 0.2rem; accent-color: var(--accent); }

/* ---- Schmale Bildschirme --------------------------------------------- */
@media (max-width: 720px) {
  .filterbar { position: static; }
  .filterbar .count { margin-left: 0; }
  .datatable thead { display: none; }
  .datatable, .datatable tbody, .datatable tr, .datatable td { display: block; width: 100%; }
  .datatable { border: 0; background: none; }
  .datatable tr { border: 1px solid var(--grey-200); border-radius: var(--radius-md); margin: 0 0 0.7rem;
    background: var(--surface); box-shadow: var(--shadow-card); overflow: hidden; }
  .datatable td { border-bottom: 1px solid var(--grey-200); display: grid; grid-template-columns: 7.5rem 1fr;
    gap: 0.6rem; text-align: left; }
  .datatable td[data-label]::before { content: attr(data-label); font-size: 0.7rem; text-transform: uppercase;
    letter-spacing: 0.08em; font-weight: 500; color: var(--grey-700); }
  .datatable td:first-child { display: block; }
  .datatable td:first-child::before { content: none; }
  .num { text-align: left; }
  .content table.cardify thead { display: none; }
  .content table.cardify, .content table.cardify tbody, .content table.cardify tr, .content table.cardify td { display: block; width: 100%; }
  .content table.cardify { border: 0; background: none; }
  .content table.cardify tr { border: 1px solid var(--grey-200); border-radius: var(--radius-md); margin: 0 0 0.7rem; background: var(--surface); }
  .content table.cardify td[data-label]::before { content: attr(data-label); display: block; font-size: 0.7rem;
    text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500; color: var(--grey-700); }
  .kv { grid-template-columns: 1fr; gap: 0 0; }
  .kv dd { margin-bottom: 0.5rem; }
  .drawer-head { padding: 0.8rem 1rem 0; }
  .drawer-body { padding: 0.8rem 1rem 3rem; }
  .level { grid-template-columns: 1fr; }
  .stats:has(> .stat:nth-child(4):last-child) { grid-template-columns: 1fr; }
}

/* Sechs Kacheln stehen 3 × 2, nie 4 + 2 */
.stats:has(> .stat:nth-child(6):last-child) { grid-template-columns: repeat(3, 1fr); }
.stats:has(> .stat:nth-child(3):last-child) { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) {
  .stats:has(> .stat:nth-child(6):last-child),
  .stats:has(> .stat:nth-child(3):last-child) { grid-template-columns: 1fr; }
}

/* Lange Einträge in Chip-Listen dürfen umbrechen, sonst schieben sie die Seite breit */
.chips .chip { white-space: normal; max-width: 100%; border-radius: 1rem; }
.queries li.is-derived-demo { border-style: dashed; }

/* Tabellenseiten: die Kopfzeile haftet am Fenster, nicht an einem Rollbereich.
   Ein Rollbereich um die Tabelle würde die haftende Kopfzeile in die Zeilen schieben. */
.table-wrap.flush { overflow: visible; margin-top: 0; }
.datatable { overflow: visible; }
.datatable th { background: var(--surface-alt); }
@media (max-width: 1100px) {
  .table-wrap.flush { overflow-x: auto; }
  .datatable th { position: static; }
}
/* Auf den breiten Tabellenseiten braucht die Tabelle den Platz der rechten Leiste */
body[data-page="coaches"] .pagerail-toc,
body[data-page="verzeichnis"] .pagerail-toc { display: none; }
body[data-page="coaches"] .main,
body[data-page="verzeichnis"] .main { max-width: 1500px; }
