/* ============================================================
   Werkzeug-Seiten: Vergleich, Mathe, Themensuche
   Flache Flaechen, keine Rahmen ausser bei echten Tabellen/Formularfeldern,
   Fliesstext 16 px in voller Textfarbe, nichts unter 13 px.
   ============================================================ */

/* --- Gemeinsame Typografie --- */
.wz .section-title { font-size: var(--t2); text-wrap: balance; }
.wz .section-subtitle { color: var(--text); font-size: var(--t4-knapp); line-height: 1.6; max-width: 33em; text-wrap: pretty; }
.wz .section-subtitle a { color: var(--accent); }
.wz-band { background: var(--uni-blau-lighter); }
@media (max-width: 600px) { .wz .section { padding: 2.25rem 1.5rem; } }

/* --- Schnellzugriff: Pillen als Flaechen, ohne Linie --- */
.wz .program-quicknav { background: transparent; border-bottom: 0; padding: 1.5rem 0 0; }
.wz .program-quicknav-inner { padding: 0 1.5rem; }
.wz .program-quicknav-label { font-size: var(--t4-meta); color: var(--text); }

/* --- Balkendiagramme --- */
.wz .compare-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 2.5rem 4rem; }
.wz .compare-label { font-size: var(--t4-gross); margin-bottom: 0.6rem; }
.wz .compare-label-hinweis { font-size: var(--t4-meta); color: var(--text-light); line-height: 1.45; margin-top: 0.2rem; }
.wz .compare-bars { gap: 0.4rem; }
.wz .compare-bar-name { width: 3.5rem; font-size: var(--t4-meta); color: var(--text); }
.wz .compare-bar-outer { background: var(--uni-blau-lighter); height: 22px; min-width: 0; }
.wz .compare-bar-fill { padding: 0; min-width: 0; font-size: var(--t-klein); }
.wz .compare-bar-value { font-size: var(--t4-meta); color: var(--text); width: 3.5rem; }
@media (prefers-reduced-motion: no-preference) {
  .wz .bw-vor .compare-bar-fill { transform: scaleX(0); transform-origin: left; }
  .wz .bw-da .compare-bar-fill { transform: none; transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s; }
}

/* --- Echte Tabellen (Linien erlaubt); mobil als gestapelte Zeilen --- */
.wz .module-table { font-size: var(--t4-knapp); background: white; }
.wz .module-table th { font-size: var(--t4-meta); padding: 0.7rem 0.75rem; }
.wz .module-table td { padding: 0.65rem 0.75rem; }
.wz .module-table tr:hover td { background: var(--uni-blau-lighter); }
.wz .module-pflicht, .wz .module-wp { font-size: var(--t4-meta); padding: 0.2rem 0.55rem; cursor: default; }
.wz .module-none { color: var(--muted); }
.wz-scroll { overflow-x: auto; }
.wz .pfad-status { display: inline-block; padding: 0.2rem 0.55rem; border-radius: 4px; font-size: var(--t4-meta); }
.wz .pfad-matrix { overflow: visible; }
/* Mathe-Tabelle: mobil als gestapelte Zeilen (:where haelt die Spezifitaet niedrig, damit die
   .mathe-tabelle-Regeln weiter unten greifen) */
@media (max-width: 760px) {
  .wz-scroll, .wz .pfad-matrix { overflow: visible; }
  .wz .module-table:where(:not(.wz-matrix)), .wz .module-table:where(:not(.wz-matrix)) tbody, .wz .module-table:where(:not(.wz-matrix)) tr, .wz .module-table:where(:not(.wz-matrix)) td { display: block; width: 100%; }
  .wz .module-table:where(:not(.wz-matrix)) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); visibility: hidden; }
  .wz .module-table:where(:not(.wz-matrix)) tr { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-strong); }
  .wz .module-table:where(:not(.wz-matrix)) td { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.3rem 0; border: 0; text-align: right; }
  .wz .module-table:where(:not(.wz-matrix)) td::before { content: attr(data-label); font-weight: 600; text-align: left; color: var(--text); flex-shrink: 0; }
  .wz .module-table:where(:not(.wz-matrix)) td:first-child { display: block; text-align: left; font-weight: 700; font-size: var(--t4-knapp); color: var(--uni-blau); padding-bottom: 0.4rem; }
  .wz .module-table:where(:not(.wz-matrix)) td:first-child::before { content: none; }
  .wz .module-table tr:hover td { background: transparent; }
}

/* --- Vergleichs-Matrizen (Modulueberlappung, Bachelor -> Master) ---
   Zeilenkoepfe als th[scope=row], auf dem Desktop wie normale Zellen.
   Mobil bleibt die Matrix erhalten: schmale Spalten mit Zeichen statt Wort-Etiketten,
   das Wort bleibt fuer Screenreader im DOM (visuell versteckt). */
.wz .wz-matrix tbody th { background: transparent; color: inherit; text-align: left; font-weight: 500; font-size: inherit; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border); }
.wz .mz-zeichen, .wz .mz-umfang, .wz .wz-legende { display: none; }
@media (max-width: 760px) {
  .wz .wz-matrix { table-layout: fixed; }
  .wz .wz-matrix th, .wz .wz-matrix td { padding: 0.55rem 0; }
  .wz .wz-matrix thead th { font-size: var(--t-klein); padding: 0.5rem 0; line-height: 1.25; }
  .wz .wz-matrix thead th:first-child, .wz .wz-matrix tbody th { padding-left: 0.6rem; padding-right: 0.5rem; }
  .wz .wz-matrix tbody th { font-size: var(--t4-meta); line-height: 1.35; hyphens: auto; overflow-wrap: break-word; }
  .wz .wz-matrix-module thead th:not(:first-child) { width: 2.4rem; }
  /* Pfad-Matrix: Zeilenkopf schmal, Spalte "ISoSySc" breit genug fuer das ungebrochene Kuerzel */
  .wz .wz-matrix-pfad thead th:first-child { width: 7rem; }
  .wz .wz-matrix-pfad thead th:nth-child(2) { width: 3.25rem; }
  .wz .wz-matrix .mz-umfang-spalte, .wz .wz-matrix-module thead th:nth-child(2) { display: none; }
  .wz .mz-umfang { display: block; font-size: var(--t-klein); font-weight: 400; color: var(--text-light); margin-top: 0.15rem; }
  .wz .mz-wort, .wz .mz-grad { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .wz .mz-zeichen { display: inline-block; vertical-align: middle; width: 0.85rem; height: 0.85rem; border: 2px solid var(--uni-blau); border-radius: 50%; }
  .wz .mz-voll { background: var(--uni-blau); }
  .wz .mz-halb { background: linear-gradient(90deg, var(--uni-blau) 50%, transparent 50%); }
  .wz .module-table .module-none { color: var(--muted); }
  .wz .wz-legende { display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; margin: 0 0 0.75rem; font-size: var(--t4-meta); color: var(--text); }
  .wz .wz-legende-item { display: inline-flex; align-items: center; gap: 0.45rem; }
  .wz .wz-legende .module-none { color: var(--muted); }
}
@media (max-width: 360px) {
  .wz .wz-matrix-module thead th:not(:first-child) { width: 2rem; }
  .wz .wz-matrix-module thead th:first-child, .wz .wz-matrix-module tbody th { padding-left: 0.5rem; padding-right: 0.25rem; }
  .wz .wz-matrix-pfad thead th:first-child { width: 4.6rem; }
  .wz .wz-matrix-pfad thead th:nth-child(2) { width: 3.1rem; }
  .wz .wz-matrix-pfad thead th:first-child, .wz .wz-matrix-pfad tbody th { padding-left: 0.4rem; padding-right: 0.25rem; }
}

/* --- Hinweistexte --- */
.wz .wz-hinweis { background: var(--uni-blau-lighter); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.5rem; font-size: var(--t4-knapp); line-height: 1.6; color: var(--text); max-width: 33em; }
.wz .wz-text { font-size: var(--t4-knapp); line-height: 1.65; color: var(--text); max-width: 33em; margin-top: 1.25rem; text-wrap: pretty; }

/* --- Mathe --- */
.wz .mathe-text { font-size: var(--t4-knapp); color: var(--text); line-height: 1.7; max-width: 33em; }
.wz .mathe-h3 { font-size: var(--t3); }
.wz .mathe-quelle, .wz .mathe-fussnote { font-size: var(--t4-meta); color: var(--text-light); line-height: 1.55; max-width: 33em; }
.wz .mathe-hinweis { font-size: var(--t4-knapp); color: var(--text); line-height: 1.65; max-width: 33em; }
.wz .mathe-zitat { border-radius: var(--radius); }
.wz .two-col { gap: 2.5rem 4rem; }
/* Module als redaktionelle Liste statt Kartenreihe */
.wz .mathe-module { display: block; margin-top: 1rem; }
.wz .mathe-modul { background: none; border: 0; border-radius: 0; padding: 2rem 0; display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 0.5rem 3rem; align-items: start; }
.wz .mathe-modul h3 { grid-row: 1 / span 2; display: block; font-size: 1.5rem; line-height: 1.2; margin: 0; text-wrap: balance; }
.wz .mathe-modul h3 span { display: block; margin-top: 0.5rem; font-size: var(--t4-knapp); font-weight: 600; color: var(--accent); }
.wz .mathe-modul-inhalt { font-size: var(--t4-knapp); color: var(--text); line-height: 1.65; margin: 0 0 0.75rem; }
.wz .mathe-modul-alltag { font-size: var(--t4-knapp); color: var(--text-light); line-height: 1.65; margin: 0; }
@media (max-width: 760px) {
  .wz .mathe-modul { grid-template-columns: 1fr; gap: 0.5rem; padding: 1.5rem 0; }
  .wz .mathe-modul h3 { grid-row: auto; }
}
.wz .mathe-tabelle td, .wz .mathe-tabelle th { vertical-align: top; }
.wz .mathe-tabelle td a { color: var(--accent); font-weight: 600; }
.wz .mathe-weiter a { background: white; font-size: var(--t4-knapp); }
.wz .mathe-weiter a:hover { background: var(--uni-blau); color: white; }

/* --- Themensuche --- */
.wz .ms-suchbox { background: var(--bg); }
.wz .ms-sg-chip { font-size: var(--t4-meta); }
.wz .ms-status { font-size: var(--t4-knapp); color: var(--text); }
.wz .ms-liste { gap: 0.5rem; }
.wz .ms-item { background: white; border-radius: var(--radius); padding: 0 1.5rem 1.1rem; }
.wz .ms-item { cursor: pointer; transition: box-shadow var(--transition); }
.wz .ms-item:hover { box-shadow: inset 0 0 0 2px var(--uni-blau-lighter); }
.wz .ms-item.open { cursor: auto; }
/* Aufklapp-Hinweis: Wort + Dreieck in einer Pille statt eines winzigen Dreiecks */
.ms-auf { display: inline-flex; align-items: center; gap: 0.4rem; flex-shrink: 0; align-self: flex-start; margin-top: 0.15rem; padding: 0.3rem 0.75rem; border-radius: 999px; background: var(--uni-blau-lighter); color: var(--uni-blau); font-size: var(--t4-meta); font-weight: 600; }
.ms-auf .faq-chevron { font-size: var(--t4-knapp); }
.ms-item.open .ms-auf .faq-chevron { transform: rotate(180deg); }
.ms-item-kopf:hover .ms-auf, .ms-item:hover .ms-auf { background: #d3e3fc; }
.wz .ms-item-titel { font-size: var(--t3); }
.wz .ms-item-titel-en { font-size: var(--t4-meta); color: var(--text-light); }
.wz .ms-item-meta { font-size: var(--t4-meta); color: var(--text); }
.wz .ms-item-id { font-size: var(--t-klein); color: var(--text-light); }
.wz .ms-snippet { font-size: var(--t4-knapp); color: var(--text); line-height: 1.6; }
.wz .ms-via { font-size: var(--t4-meta); color: var(--text-light); }
.wz .ms-badge { font-size: var(--t4-meta); }
.wz .ms-badge-status { border-left: 0; padding-left: 0; margin-left: 0.1rem; }
.wz .ms-details-inner { border-top: 0; font-size: var(--t4-knapp); color: var(--text); background: var(--bg); border-radius: var(--radius); padding: 0.9rem 1rem 0.5rem; }
.wz .ms-details-inner h4 { font-size: var(--t4-knapp); }
.wz .ms-details-inner p + h4 { margin-top: 1rem; } /* Inhalte / Lernziele / Pruefung als getrennte Bloecke */
.wz .ms-einbringbar { margin: 0 0 0.9rem; padding-left: 1.2rem; font-size: var(--t4-meta); }
.wz .ms-details-fakten { font-size: var(--t4-meta); }
.wz .ms-details-quelle { font-size: var(--t4-meta); color: var(--text-light); }
.wz .ms-leer { color: var(--text); }
.wz .ms-leer-text { font-size: var(--t4-knapp); }
.wz .ms-leer-hinweis { font-size: var(--t4-knapp); color: var(--text); }
.wz .ms-stand { border-top: 0; font-size: var(--t4-meta); color: var(--text-light); max-width: 33em; margin-top: 3rem; padding-top: 0; }
.wz .ms-stand a { color: var(--accent); }
@media (max-width: 480px) {
  .wz #ms-section { padding: 2rem 1.5rem; }
  .wz .ms-item { padding: 0 1rem 1rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .wz .ms-item { animation: kopftext 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .wz .ms-chip, .wz .ms-filter .faq-filter-btn, .wz .ms-beispiel, .wz .ms-mehr { transition: transform 0.15s ease, background-color var(--transition), color var(--transition); }
  .wz .ms-chip:active, .wz .ms-filter .faq-filter-btn:active, .wz .ms-beispiel:active { transform: scale(0.97); }
}
.wz .mathe-tabelle td { text-align: left; }
.wz .mathe-tabelle td.num, .wz .mathe-tabelle th.num { text-align: center; }
.wz .mathe-tabelle td:first-child { hyphens: none; min-width: 10rem; }
@media (max-width: 760px) { .wz .mathe-tabelle td { text-align: right; } .wz .mathe-tabelle td:first-child { text-align: left; min-width: 0; } .wz .mathe-tabelle td { display: block; text-align: left; } .wz .mathe-tabelle td::before { display: block; margin-bottom: 0.1rem; } .wz .mathe-tabelle td.num { white-space: normal; text-align: left; } }
