/* ============================================================
   Hilfsklassen
   ============================================================ */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.warn { color: #b56625; font-weight: 600; }
.alert-info { background: #eef4fb; color: #24527a; border: 1px solid #cddff0; }
form.inline { display: inline; }
form.inline button { margin-right: 0; }

/* Bruch: Zähler über Nenner (aus math_html()) */
.frac {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    vertical-align: middle;
    line-height: 1.05;
    font-size: 0.92em;
    margin: 0 0.08em;
}
.frac-num { border-bottom: 1.5px solid currentColor; padding: 0 0.15em; }
.frac-den { padding: 0 0.15em; }

/* ============================================================
   Kopfleiste für eingeloggte Kinder
   ============================================================ */
.topnav {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}
.topnav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    flex: none;
}
.topnav-brand { font-weight: 800; color: var(--color-text); letter-spacing: -0.01em; }
.topnav-brand:hover { text-decoration: none; color: var(--color-accent); }
.topnav ul { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.topnav ul a {
    display: block;
    padding: 0.4rem 0.7rem;
    border-radius: var(--radius);
    color: var(--color-text);
    font-size: var(--fs-sm);
    font-weight: 500;
}
.topnav ul a.is-active,
.topnav ul a:hover { background: var(--color-accent-soft); color: var(--color-accent); text-decoration: none; }

/* ============================================================
   Seitenköpfe, Fortschritt
   ============================================================ */
.page-head { padding: 1.75rem 0 1.25rem; }
.page-title {
    font-size: clamp(1.75rem, 4vw, var(--fs-2xl));
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.due-note { color: var(--color-text-muted); font-size: var(--fs-sm); margin-top: 0.4rem; }
.camp-intro { margin-top: 0.75rem; max-width: 65ch; line-height: 1.55; }

.progress { margin-bottom: 1.5rem; }
.progress-bar, .bar {
    display: block;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    height: 14px;
    overflow: hidden;
}
.progress-fill, .bar-fill {
    display: block;
    background: linear-gradient(90deg, var(--color-success), #4cb9ad);
    height: 100%;
    transition: width 400ms ease;
}
.progress-text { margin-top: 0.5rem; font-size: var(--fs-sm); color: var(--color-text-muted); }

/* ============================================================
   Startseite
   ============================================================ */
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.home-card h2 { font-size: var(--fs-lg); }
.home-card .btn { margin-top: 0.75rem; }
.home-kue-latest { margin: 0.5rem 0; }
.home-kue-points { font-size: var(--fs-2xl); font-weight: 800; }

.minibars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 48px;
    margin-top: 0.5rem;
}
.minibar {
    flex: 1;
    max-width: 22px;
    height: var(--h);
    min-height: 3px;
    background: var(--color-success);
    border-radius: 3px 3px 0 0;
    opacity: 0.85;
}

.camps h2 { font-size: var(--fs-xl); margin-bottom: 0.75rem; }
.camp-list { display: grid; gap: 0.75rem; }
.camp-item {
    display: grid;
    gap: 0.3rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    color: var(--color-text);
    transition: border-color 120ms ease, transform 80ms ease;
}
.camp-item:hover { text-decoration: none; border-color: var(--color-accent); transform: translateY(-1px); }
.camp-kind { font-size: var(--fs-xs); color: var(--color-accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.camp-title { font-size: var(--fs-lg); }
.camp-due { font-size: var(--fs-sm); color: var(--color-text-muted); }
.camp-progress { display: grid; gap: 0.3rem; margin-top: 0.3rem; }

/* ============================================================
   Kopfübungen (Kinder)
   ============================================================ */
.kue-score { font-size: var(--fs-lg); margin-top: 0.4rem; }
.kue-score strong { font-size: var(--fs-2xl); font-weight: 800; }

.kue-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    height: 180px;
    padding-top: 1.5rem;
    margin: 0.75rem 0;
    overflow-x: auto;
}
.kue-col {
    flex: 1 0 28px;
    max-width: 56px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 0.25rem;
    color: var(--color-text);
}
.kue-col:hover { text-decoration: none; }
.kue-col:hover .kue-col-bar { background: var(--color-accent); }
.kue-col-bar {
    width: 100%;
    height: var(--h);
    min-height: 3px;
    background: var(--color-success);
    border-radius: 4px 4px 0 0;
}
.kue-col-value { font-size: var(--fs-xs); font-weight: 700; }
.kue-col-label { font-size: var(--fs-xs); color: var(--color-text-muted); }

.kue-list { display: grid; gap: 0.5rem; margin-top: 1.5rem; }
.kue-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.8rem 1rem;
    color: var(--color-text);
}
.kue-item:hover { text-decoration: none; border-color: var(--color-accent); }
.kue-item strong { display: block; }
.kue-item-points { font-weight: 800; font-size: var(--fs-lg); white-space: nowrap; }

.kue-grid { display: grid; gap: 0.5rem; }
.kue-slot {
    display: grid;
    grid-template-columns: 2rem 2rem 1fr;
    align-items: start;
    gap: 0.5rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.7rem 0.9rem;
}
.kue-slot-ok      { border-left-color: var(--color-success); }
.kue-slot-bad     { border-left-color: var(--color-accent); }
.kue-slot-unclear { border-left-color: var(--color-help); }
.kue-letter { font-weight: 700; }
.kue-mark { font-weight: 800; font-size: var(--fs-lg); line-height: 1.2; }
.kue-slot-ok .kue-mark      { color: var(--color-success); }
.kue-slot-bad .kue-mark     { color: var(--color-accent); }
.kue-slot-unclear .kue-mark { color: #b56625; }
.kue-body { display: grid; gap: 0.2rem; }
.kue-topic { font-size: var(--fs-xs); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.kue-task { font-size: var(--fs-base); }
.kue-reading, .kue-solution { font-size: var(--fs-sm); }
.kue-solution strong { color: var(--color-success); }

/* ============================================================
   Trainingslager
   ============================================================ */
.area-title {
    font-size: var(--fs-xl);
    margin: 2rem 0 0.75rem;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid var(--color-border);
}
.skill {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1rem;
}
.skill-head { display: flex; gap: 0.75rem; align-items: baseline; }
.skill-nr {
    flex: none;
    min-width: 2rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: var(--color-bg-soft);
    font-weight: 700;
    font-size: var(--fs-sm);
    text-align: center;
}
.skill-text { font-weight: 600; line-height: 1.45; }
.skill-sheet { display: block; font-weight: 400; color: var(--color-text-muted); font-size: var(--fs-xs); margin-top: 0.15rem; }

.rating { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0.8rem 0 0.2rem; }
.rating-q { font-size: var(--fs-sm); color: var(--color-text-muted); margin-right: 0.25rem; }
.rating-btn {
    padding: 0.35rem 0.7rem;
    min-height: 36px;
    border: 2px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-bg);
    font-size: var(--fs-sm);
    font-weight: 500;
    transition: background 120ms ease, border-color 120ms ease;
}
.rating-btn:hover { border-color: var(--color-text); }
.rating-btn.is-active { color: #fff; font-weight: 700; }
.rating-1.is-active { background: #1f8a5b; border-color: #1f8a5b; }
.rating-2.is-active { background: #5fae6e; border-color: #5fae6e; }
.rating-3.is-active { background: #e09447; border-color: #e09447; }
.rating-4.is-active { background: #d0503f; border-color: #d0503f; }

.task-list { display: grid; gap: 0.6rem; margin-top: 0.9rem; }
.task {
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.75rem 0.9rem;
    background: #fcfcfb;
}
.task-richtig { border-left-color: var(--color-success); background: #f6fbfa; }
.task-falsch  { border-left-color: var(--color-accent); }
.task-self    { border-left-color: var(--color-help); }
.task-head { display: flex; gap: 0.6rem; align-items: baseline; }
.task-label { font-weight: 700; flex: none; }
.task-content { line-height: 1.6; }

.task-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.6rem; }
.task-input { display: flex; align-items: center; gap: 0.4rem; margin: 0; font-weight: 400; flex: 1 1 12rem; max-width: 20rem; }
.task-input input {
    margin: 0;
    width: 100%;
    padding: 0.5rem 0.7rem;
    font-size: 1.05rem;
}
.task-unit { color: var(--color-text-muted); font-weight: 600; }
.task-form button { margin-right: 0; }

.task-result { margin-top: 0.5rem; display: grid; gap: 0.3rem; font-size: var(--fs-sm); }
.task-given strong, .task-solution strong { font-size: var(--fs-base); }
.task-solution strong { color: var(--color-success); }
.task-hint { color: var(--color-text-muted); }
.task-note { color: var(--color-text-muted); font-style: italic; }
.task-self, .task-dispute { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.2rem; }
.task-self button, .task-dispute button { margin-right: 0; }
.task-self-q { font-weight: 600; }
.task-error { color: var(--color-error); font-size: var(--fs-sm); margin-top: 0.4rem; }

.pill {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    font-size: var(--fs-xs);
    font-weight: 700;
}
.pill-ok  { background: var(--color-success-soft); color: #1d6e64; }
.pill-bad { background: var(--color-accent-soft); color: #b3202d; }

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 600px) {
    .container { padding: 1rem; }
    .hero { padding: 2rem 0 1.5rem; }
    .btn { padding: 0.65rem 1rem; }
    .skill { padding: 0.9rem; }
    .topnav-row { padding-top: 0.5rem; padding-bottom: 0.5rem; }
    .topnav-brand { font-size: var(--fs-sm); }
    .topnav ul a { padding: 0.35rem 0.5rem; }
    .kue-slot { grid-template-columns: 1.6rem 1.6rem 1fr; padding: 0.6rem; }
}

/* ============================================================
   Admin
   ============================================================ */
.admin-shell {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1.5rem;
    width: 100%;
    max-width: var(--max-content);
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
}
.admin-nav {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem;
    height: fit-content;
    position: sticky;
    top: 1rem;
}
.admin-nav h3 { font-size: var(--fs-sm); color: var(--color-text-muted); text-transform: uppercase; margin-bottom: 0.5rem; }
.admin-nav ul { display: grid; gap: 0.2rem; }
.admin-nav a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    color: var(--color-text);
    font-weight: 500;
}
.admin-nav a.is-active,
.admin-nav a:hover { background: var(--color-accent-soft); color: var(--color-accent); text-decoration: none; }

.admin-main { min-width: 0; }
.admin-main h1 { font-size: var(--fs-2xl); margin-bottom: 1.25rem; font-weight: 800; letter-spacing: -0.01em; }
.admin-main h2 { font-size: var(--fs-xl); margin: 1.75rem 0 0.75rem; }
.admin-main h3 { font-size: var(--fs-lg); margin: 1.25rem 0 0.5rem; }
.admin-main .card { margin-bottom: 1rem; }

table.data {
    width: 100%;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 0.75rem;
}
table.data th, table.data td {
    padding: 0.55rem 0.8rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--color-border);
    font-size: var(--fs-sm);
}
table.data th { background: var(--color-bg-soft); font-weight: 600; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #fcfbf9; }
table.data tr.row-warn td { background: #fff8ec; }
table.data tr.is-archived td { color: var(--color-text-muted); }
table.data select, table.data input[type="text"] { margin-top: 0; padding: 0.3rem 0.5rem; }
.input-team { max-width: 4.5rem; }

.table-scroll { overflow-x: auto; }
table.matrix th, table.matrix td { text-align: center; padding: 0.4rem 0.5rem; }
table.matrix td:nth-child(2), table.matrix th:nth-child(2) { text-align: left; }

.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; margin-bottom: 1rem; }
.filter-bar label { margin-bottom: 0; }
.filter-bar select { min-width: 12rem; }

.checkbox-row { display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; align-items: center; border: 0; margin-bottom: 0.75rem; }
.checkbox-row legend { font-weight: 600; margin-bottom: 0.4rem; }
.checkbox-row label { display: inline-flex; align-items: center; gap: 0.3rem; margin: 0; font-weight: 400; }
.score-radios { white-space: nowrap; }
.score-radios label { display: inline-flex; gap: 0.2rem; margin: 0 0.5rem 0 0; font-weight: 400; }

.preview { border-color: var(--color-accent); }
.preview ul { margin: 0.75rem 0 1rem 1.25rem; list-style: disc; }
.preview li { margin-bottom: 0.3rem; }
.preview details { margin-bottom: 1rem; }

.rating-dist { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0.5rem 0 0.75rem; }
.rating-chip { padding: 0.15rem 0.6rem; border-radius: 999px; font-size: var(--fs-xs); background: var(--color-bg-soft); }
.rating-chip.rating-1 { background: #ddf1e6; }
.rating-chip.rating-2 { background: #e8f4ea; }
.rating-chip.rating-3 { background: #fbecd9; }
.rating-chip.rating-4 { background: #f8dcd8; }
.wrong-answer {
    display: inline-block;
    margin: 0 0.3rem 0.2rem 0;
    padding: 0.05rem 0.45rem;
    border-radius: var(--radius);
    background: var(--color-accent-soft);
    font-size: var(--fs-xs);
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}
.stat-label { color: var(--color-text-muted); font-size: var(--fs-sm); }
.stat-value { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.02em; }
.stat-card-warn {
    border-color: var(--color-help);
    background: var(--color-help-soft);
}
.stat-card-warn .stat-value { color: #b56625; }

@media (max-width: 800px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-nav { position: static; }
    .admin-nav ul { display: flex; flex-wrap: wrap; }
}

/* KÜ-Ergebnis bearbeiten: Zeilenfarbe folgt der angeklickten Wertung (live, ohne JS),
   „Nur ?" blendet bereits gewertete Zeilen aus (gespeicherter Stand). */
.score-table tr:has(input[value="1"]:checked) td { background: #e6f4ec; }
.score-table tr:has(input[value="0"]:checked) td { background: #fbe7e6; }
.score-table tr:has(input[value="?"]:checked) td { background: #fff4d6; }
.score-table tr:has(input[value="1"]:checked) td:first-child { box-shadow: inset 4px 0 0 var(--color-success); }
.score-table tr:has(input[value="0"]:checked) td:first-child { box-shadow: inset 4px 0 0 var(--color-accent); }
.score-table tr:has(input[value="?"]:checked) td:first-child { box-shadow: inset 4px 0 0 var(--color-help); }
.score-edit:has(#only-unclear:checked) tr.saved-done { display: none; }
.toggle { display: inline-flex; align-items: center; gap: 0.4rem; margin-bottom: 0.75rem; font-weight: 600; cursor: pointer; }

/* ============================================================
   Material (k.php Kursseite, m.php Blattseite)
   Kinder öffnen die Seiten ohne Login über Kurs-Link oder QR-Code.
   ============================================================ */
.mat { display: grid; gap: 1.5rem; align-content: start; }
.mat > * { min-width: 0; }
.mat .hero { padding-bottom: 0; }
.mat-h1 { font-size: var(--fs-xl); }
@media (min-width: 700px) { .mat-h1 { font-size: var(--fs-2xl); } }
.mat-fehler-titel { font-size: var(--fs-xl); margin-bottom: 0.5rem; }
.mat-leer {
    background: var(--color-bg);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.25rem;
    text-align: center;
    color: var(--color-text-muted);
}
.mat-hinweis { color: var(--color-text-muted); }

/* Suche (nur mit JavaScript sichtbar) */
.mat-search {
    display: flex; align-items: center; gap: 0.5rem;
    background: var(--color-bg); border: 1px solid var(--color-border);
    border-radius: 12px; padding: 0 0.75rem; color: var(--color-text-muted);
}
.mat-search[hidden], .mat-keine[hidden], .mat-item[hidden], .mat-topic[hidden], .mat-sektion[hidden] { display: none; }
.mat-search:focus-within { border-color: var(--color-accent); }
.mat-search input {
    flex: 1; min-width: 0; border: 0; background: none; font: inherit;
    color: var(--color-text); padding: 0.7rem 0; outline: none;
}
.mat-keine { text-align: center; color: var(--color-text-muted); padding: 1rem 0; }

.mat-sektion { display: grid; gap: 0.75rem; }
.mat-sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.mat-sec-h h2 { font-size: var(--fs-lg); }
.mat-sec-h span { font-size: var(--fs-xs); color: var(--color-text-muted); }

/* Neu */
.mat-newgrid { display: grid; gap: 0.6rem; }
@media (min-width: 700px) { .mat-newgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mat-newcard {
    display: grid; gap: 0.25rem; align-content: start;
    background: var(--color-bg); border: 1px solid var(--color-border);
    border-radius: var(--radius-lg); padding: 0.9rem 1rem; color: var(--color-text);
}
.mat-newcard:hover { text-decoration: none; border-color: var(--color-accent); }
.mat-newcard strong { line-height: 1.3; }
.mat-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: var(--fs-xs); color: var(--color-text-muted); }
.mat-pill {
    font-size: 0.7rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 99px;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.mat-pill-neu { background: var(--color-accent-soft); color: var(--color-accent); }

/* Themen als <details> */
.mat-topic {
    background: var(--color-bg); border: 1px solid var(--color-border);
    border-radius: var(--radius-lg); overflow: hidden;
}
.mat-topic-h {
    display: grid; grid-template-columns: 1fr auto auto; gap: 0.75rem; align-items: center;
    padding: 0.9rem 1rem; cursor: pointer; list-style: none;
}
.mat-topic-h::-webkit-details-marker { display: none; }
.mat-topic-h h3 { font-size: var(--fs-base); font-weight: 700; }
.mat-count { font-size: var(--fs-xs); color: var(--color-text-muted); }
.mat-chev { color: var(--color-text-muted); transition: transform 0.2s; }
.mat-topic[open] .mat-chev { transform: rotate(90deg); }
.mat-topic-h:focus-visible { outline: 3px solid var(--color-accent-soft); outline-offset: -3px; }
.mat-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--color-border); }
.mat-item {
    display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); gap: 0.3rem 0.75rem; align-items: center;
    padding: 0.75rem 1rem; border-bottom: 1px solid var(--color-border);
}
.mat-item:last-child { border-bottom: 0; }
.mat-nr {
    font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: var(--fs-xs); font-weight: 600;
    background: var(--color-bg-soft); border-radius: 8px; min-height: 2.4rem; padding: 0 0.3rem;
    display: grid; place-items: center; overflow-wrap: anywhere; text-align: center;
}
.mat-t { display: grid; gap: 1px; min-width: 0; }
.mat-t strong { font-size: var(--fs-sm); line-height: 1.3; }
.mat-t > span { font-size: var(--fs-xs); color: var(--color-text-muted); }
.mat-btns { grid-column: 2; display: flex; gap: 0.4rem; flex-wrap: wrap; }
@media (min-width: 700px) {
    .mat-item { grid-template-columns: 3.2rem minmax(0, 1fr) auto; }
    .mat-btns { grid-column: auto; }
}

/* Knöpfe */
.mat-b {
    display: inline-flex; align-items: center; justify-content: center; min-height: 40px;
    padding: 0.35rem 0.8rem; border: 1px solid var(--color-border); background: var(--color-bg);
    border-radius: 9px; font-size: var(--fs-xs); font-weight: 600; color: var(--color-text); white-space: nowrap;
}
a.mat-b:hover { text-decoration: none; border-color: var(--color-text); }
a.mat-b:focus-visible { outline: 3px solid var(--color-accent-soft); outline-offset: 2px; }
.mat-b-loes { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
a.mat-b-loes:hover { border-color: var(--color-accent); filter: brightness(0.95); }
.mat-b-off { background: var(--color-bg-soft); color: var(--color-text-muted); cursor: default; }

.mat-foot {
    font-size: var(--fs-xs); color: var(--color-text-muted); border-top: 1px solid var(--color-border);
    padding-top: 1rem; display: grid; gap: 0.25rem;
}

/* Blattseite */
.mat-back { justify-self: start; font-weight: 600; }
.mat-tabs {
    display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: 100%; max-width: 360px;
    background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 12px; padding: 4px;
}
.mat-tab {
    text-align: center; padding: 0.55rem 0.75rem; border-radius: 9px; font-weight: 600;
    color: var(--color-text-muted); min-height: 40px; display: grid; place-items: center;
}
.mat-tab:hover { text-decoration: none; color: var(--color-text); }
.mat-tab.is-active { background: var(--color-accent); color: #fff; }
.mat-viewer { display: grid; gap: 1.25rem; }
@media (min-width: 800px) { .mat-viewer { grid-template-columns: minmax(0, 1fr) 260px; align-items: start; } }
.mat-sheets { display: grid; gap: 0.75rem; min-width: 0; }
.mat-sheet {
    display: block; width: 100%; height: auto; aspect-ratio: auto 210 / 297;
    background: #fff; border: 1px solid var(--color-border); border-radius: 4px;
}
.mat-aufdecken { display: grid; gap: 0.75rem; }
.mat-aufdecken > summary {
    list-style: none; cursor: pointer; justify-self: start;
    background: var(--color-accent); color: #fff; font-weight: 700; border-radius: var(--radius);
    padding: 0.7rem 1.25rem; min-height: 44px; display: inline-flex; align-items: center;
}
.mat-aufdecken > summary::-webkit-details-marker { display: none; }
.mat-aufdecken > summary:focus-visible { outline: 3px solid var(--color-accent-soft); outline-offset: 2px; }
.mat-aufdecken[open] > summary { background: var(--color-bg-soft); color: var(--color-text-muted); border: 1px solid var(--color-border); }
.mat-aufdecken[open] > summary { margin-bottom: 0.25rem; }
.mat-side { display: grid; gap: 0.75rem; align-content: start; }
.mat-card {
    background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
    padding: 0.9rem 1rem; display: grid; gap: 0.5rem;
}
.mat-card h2 {
    font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--color-text-muted); font-weight: 600; margin: 0;
}
.mat-sibs { list-style: none; margin: 0; padding: 0; display: grid; }
.mat-sib {
    display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); gap: 0.5rem; align-items: center;
    padding: 0.4rem 0; border-top: 1px solid var(--color-border); color: var(--color-text); font-size: var(--fs-sm);
}
.mat-sibs li:first-child .mat-sib { border-top: 0; }
.mat-sib:hover { text-decoration: none; color: var(--color-accent); }
.mat-sib .mat-nr { min-height: 2rem; }
