/* =====================================================================
   Uni App — Design-System "iOS Native Light"
   Reines CSS, keine Frameworks. Mobile-first, Desktop nachrangig.
   Design-Tokens/Grundkomponenten 1:1 aus der Wäsche-App (dort aus der
   Fitness-App) übernommen, damit sich alle lixapps-Apps optisch vertraut
   anfühlen — ergänzt um Katalog-Kacheln, Import, Statistiken und die
   Quiz-Oberfläche (kein gemeinsamer Code über die apps/-Grenze hinweg).
   ===================================================================== */

:root {
    --bg: #F2F2F7;
    --card: #FFFFFF;
    --accent: #007AFF;
    --accent-dark: #0062CC;
    --indigo: #5E5CE6;
    --text: #000000;
    --text-2: #8E8E93;
    --sep: #C6C6C8;
    --sep-light: #E5E5EA;
    --red: #FF3B30;
    --red-bg: #FFEDED;
    --green: #34C759;
    --green-dark: #248A3D;
    --green-bg: #E9FBEF;
    --orange: #FF9500;
    --radius: 10px;
    --radius-lg: 16px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --header-h: 52px;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
/* Klassen mit eigenem display (flex/grid, .btn) gewinnen sonst gegen das
   UA-Default [hidden]{display:none} — Autoren-Regeln greifen immer vor dem
   User-Agent-Stylesheet. quiz.js blendet Buttons/Karten per .hidden aus. */
[hidden] { display: none !important; }
html {
    -webkit-text-size-adjust: 100%;
    /* Sprungziele (#manage, #editUserCard …) nicht unter dem Sticky-Header verstecken */
    scroll-padding-top: calc(var(--header-h) + var(--safe-top) + 12px);
}

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: contain;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, p { margin: 0; }
code { font-family: var(--mono); font-size: 0.92em; background: var(--sep-light); padding: 1px 5px; border-radius: 5px; }

/* Importierte Texte: Zeilenumbrüche behalten, lange Wörter/URLs umbrechen */
.pre-line { white-space: pre-line; overflow-wrap: anywhere; }

/* Formeln (KaTeX) und Tabellen in importierten Texten (assets/js/richtext.js) */
.katex { font-size: 1.1em; font-weight: 400; }
/* KaTeX' unsichtbare MathML-Kopie ist position:absolute — ohne eigenen
   Bezugsrahmen entkommt sie overflow:hidden (z.B. der einzeiligen Vorschau)
   und macht die Seite seitlich scrollbar. */
.rich-math, .rich-math-display { position: relative; }
.rich-math-display { display: block; max-width: 100%; overflow-x: auto; overflow-y: hidden; }
.rich-math-display .katex-display { margin: 0.5em 0; }
.rich-math-error { background: var(--red-bg); outline: 1px dashed var(--red); border-radius: 3px; }
.katex-error { font-family: var(--mono); font-size: 0.9em; color: var(--red) !important; white-space: pre-wrap; }
.rich-table { max-width: 100%; overflow-x: auto; margin: 10px 0; -webkit-overflow-scrolling: touch; }
.rich-table table { border-collapse: collapse; font-size: 13px; font-weight: 400; line-height: 1.35; font-variant-numeric: tabular-nums; white-space: normal; overflow-wrap: normal; }
.rich-table th, .rich-table td { padding: 5px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--sep-light); }
.rich-table th { font-weight: 700; border-bottom-color: var(--sep); white-space: nowrap; }
.rich-table td[style*="right"] { white-space: nowrap; }
.rich-table tr:last-child td { border-bottom: none; }

/* --- App-Header (kein Burger-Menü) --------------------------------------- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    height: calc(var(--header-h) + var(--safe-top));
    padding: var(--safe-top) 12px 0;
    background: rgba(242, 242, 247, 0.92);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--sep-light);
}
.app-header-title { flex: 1; font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-header-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

/* --- Main / Layout --------------------------------------------------------- */
.app-main { padding: 16px 16px calc(24px + var(--safe-bottom)); max-width: 640px; margin: 0 auto; }

/* --- Section-Header --------------------------------------------------------- */
.section-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 22px 0 10px; }
.section-header:first-child { margin-top: 4px; }
.section-title { font-size: 20px; font-weight: 700; }
.section-subtitle { font-size: 13px; color: var(--text-2); margin-top: 2px; }

/* --- Karten --------------------------------------------------------------- */
.card { background: var(--card); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 12px; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; }

/* --- Listen --------------------------------------------------------------- */
.list { background: var(--card); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 12px; }
.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 16px;
    min-height: 44px;
    border-bottom: 1px solid var(--sep-light);
}
.list-row:last-child { border-bottom: none; }
.list-row-title { font-size: 16px; font-weight: 500; }
.list-row-subtitle { font-size: 13px; color: var(--text-2); margin-top: 1px; }
.list-row-actions { display: flex; gap: 8px; flex-shrink: 0; }
.list-empty { padding: 32px 16px; text-align: center; color: var(--text-2); font-size: 14px; }

.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
    vertical-align: middle;
}
.badge-success { background: var(--green-bg); color: var(--green-dark); }
.badge-pending { background: rgba(255, 149, 0, 0.15); color: var(--orange); }
.badge-admin { background: rgba(0, 122, 255, 0.12); color: var(--accent); }

/* --- Katalog-Kacheln (Startseite) ------------------------------------------ */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}
.catalog-tile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 136px;
    padding: 14px;
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.catalog-tile:active { transform: scale(0.98); }
.catalog-tile-name {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.catalog-tile-meta { font-size: 12px; color: var(--text-2); }
.catalog-tile-status { margin-top: auto; font-size: 12px; font-weight: 600; color: var(--text-2); }
.catalog-tile-status.is-active { color: var(--accent); }
.catalog-tile-empty {
    align-items: center;
    justify-content: center;
    text-align: center;
    background: transparent;
    border: 2px dashed var(--sep);
    box-shadow: none;
    color: var(--accent);
}
.catalog-tile-plus { font-size: 44px; font-weight: 300; line-height: 1; }
.catalog-tile-empty-label { font-size: 14px; font-weight: 600; }
@media (hover: hover) {
    .catalog-tile:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08); }
    .catalog-tile-empty:hover { border-color: var(--accent); box-shadow: none; }
}

/* Kachel mit Drei-Punkte-Menü (Admin) und Suchleiste über den Listen */
.catalog-tile-wrap { position: relative; display: flex; }
.catalog-tile-wrap > .catalog-tile { flex: 1; min-width: 0; }
.catalog-tile-meta-shared { font-size: 12px; color: var(--indigo); font-weight: 600; }
.tile-menu { position: absolute; top: 6px; right: 6px; z-index: 2; }
.tile-menu > summary {
    width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    list-style: none; cursor: pointer; font-size: 20px; line-height: 1; color: var(--text-2);
}
.tile-menu > summary::-webkit-details-marker { display: none; }
.tile-menu[open] > summary { background: var(--bg); }
.tile-menu-panel {
    position: absolute; top: 34px; right: 0; min-width: 190px; padding: 6px;
    background: var(--card); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}
.tile-menu-panel .btn { width: 100%; justify-content: flex-start; }
.catalog-tile-wrap.has-menu .catalog-tile-name { padding-right: 26px; }

.search-input {
    display: block; width: 100%; margin: 0 0 12px; padding: 10px 12px;
    font: inherit; font-size: 16px; color: var(--text);
    background: var(--card); border: 1px solid var(--sep-light); border-radius: var(--radius);
    -webkit-appearance: none; appearance: none;
}
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15); }
.filter-none { padding: 18px 8px; text-align: center; color: var(--text-2); font-size: 14px; }

/* Teilen-Auswahl (Import) */
.share-box { margin-top: 12px; padding: 12px; border: 1px solid var(--sep-light); border-radius: var(--radius); background: var(--bg); }
.share-list { max-height: 220px; overflow-y: auto; margin-top: 4px; }
.share-row { display: flex; align-items: center; gap: 10px; padding: 8px 2px; font-size: 15px; cursor: pointer; }
.share-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex-shrink: 0; }
.share-row-all { font-weight: 700; border-bottom: 1px solid var(--sep-light); }
/* .field label (grau, klein, block) würde sonst die Zeilen überschreiben */
.field .share-row { display: flex; margin: 0; font-size: 15px; font-weight: 500; color: var(--text); }
.field .share-row-all { font-weight: 700; }

/* Rangliste */
.rank-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--sep-light); }
.rank-row:last-child { border-bottom: none; }
.rank-row.is-you { background: rgba(0, 122, 255, 0.06); }
.rank-pos { width: 30px; flex-shrink: 0; text-align: center; font-size: 18px; font-weight: 700; color: var(--text-2); }
.rank-main { flex: 1; min-width: 0; }
.rank-name { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-detail { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.rank-score { flex-shrink: 0; font-size: 20px; font-weight: 700; }
.rank-bar { height: 5px; margin-top: 6px; border-radius: 3px; background: var(--sep-light); overflow: hidden; }
.rank-bar > span { display: block; height: 100%; background: var(--green); }

/* --- Import ------------------------------------------------------------------ */
.format-help { padding: 0; }
.format-help > summary { padding: 14px 16px; font-weight: 600; color: var(--accent); cursor: pointer; list-style: none; }
.format-help > summary::-webkit-details-marker { display: none; }
.format-help > summary::before { content: '▸\00a0'; }
.format-help[open] > summary::before { content: '▾\00a0'; }
.format-help-body { padding: 0 16px 16px; font-size: 14px; line-height: 1.5; }
.format-help-body > p { margin-bottom: 10px; }
.format-help-rules { margin: 10px 0 14px; padding-left: 18px; color: var(--text-2); font-size: 13px; }
.format-help-rules li { margin-bottom: 4px; }
.code-block {
    margin: 0;
    padding: 12px;
    background: #1C1C1E;
    color: #F2F2F7;
    border-radius: var(--radius);
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre;
}
.prompt-box {
    display: block;
    width: 100%;
    margin: 0 0 8px;
    padding: 10px 12px;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.45;
    border: 1px solid var(--sep);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    resize: vertical;
}

.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 12px 12px 40px;
    border: 2px solid var(--sep-light);
    border-radius: var(--radius);
    background: var(--card);
    cursor: pointer;
}
.choice-card input { position: absolute; left: 12px; top: 13px; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.choice-card-title { font-size: 15px; font-weight: 700; }
.choice-card-text { font-size: 12px; color: var(--text-2); line-height: 1.35; }
.choice-card:has(input:checked) { border-color: var(--accent); background: rgba(0, 122, 255, 0.06); }
@media (max-width: 360px) { .choice-cards { grid-template-columns: 1fr; } }

.divider-or { display: flex; align-items: center; gap: 10px; margin: 2px 0 14px; color: var(--text-2); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.divider-or::before, .divider-or::after { content: ''; flex: 1; height: 1px; background: var(--sep-light); }

.import-summary { margin: 16px 0 12px; padding: 14px 16px; border-radius: var(--radius-lg); font-size: 14px; line-height: 1.45; }
.import-summary.is-ok { background: var(--green-bg); color: var(--green-dark); }
.import-summary.is-error { background: var(--red-bg); color: var(--red); }

.error-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.error-list li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--sep-light); line-height: 1.4; }
.error-list li:first-child { padding-top: 0; }
.error-list li:last-child { border-bottom: none; padding-bottom: 0; }
.error-line { flex-shrink: 0; min-width: 66px; font-weight: 700; color: var(--red); font-variant-numeric: tabular-nums; }

/* --- Aufklappbare Fragen (Vorschau, Problemfragen, Auswertung) ---------------- */
.preview-question { border-bottom: 1px solid var(--sep-light); }
.preview-question:last-child { border-bottom: none; }
.preview-question > summary { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; list-style: none; }
.preview-question > summary::-webkit-details-marker { display: none; }
.preview-question[open] > summary { padding-bottom: 6px; }
.preview-question-text { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-question[open] .preview-question-text { color: var(--text-2); }
.preview-question-count { flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--text-2); }
.preview-question-body { padding: 0 16px 14px; font-size: 14px; line-height: 1.45; }
.q-badge {
    flex-shrink: 0;
    display: inline-block;
    min-width: 34px;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(94, 92, 230, 0.12);
    color: var(--indigo);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.answer-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.answer-item { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--bg); color: var(--text-2); }
.answer-item.is-correct { background: var(--green-bg); color: var(--green-dark); font-weight: 600; }
.answer-item.is-wrong { background: var(--red-bg); color: var(--red); }
.answer-mark { flex-shrink: 0; width: 16px; font-weight: 700; }
.answer-item-text { flex: 1; min-width: 0; }
.answer-picked { flex-shrink: 0; align-self: center; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.explanation-text {
    margin-top: 10px;
    padding: 10px 12px;
    border-left: 3px solid var(--indigo);
    border-radius: 0 8px 8px 0;
    background: rgba(94, 92, 230, 0.07);
    color: var(--text);
}

/* --- Katalogseite ------------------------------------------------------------ */
.catalog-hero-title { font-size: 22px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.catalog-hero-meta { margin-top: 4px; font-size: 13px; color: var(--text-2); }

.mode-card-head { display: flex; align-items: flex-start; gap: 12px; }
.mode-card-icon { font-size: 28px; line-height: 1.1; }
.mode-card-title { font-size: 17px; font-weight: 700; }
.mode-card-text { margin-top: 2px; font-size: 13px; line-height: 1.4; color: var(--text-2); }
.mode-card-start, .mode-card-progress { margin-top: 14px; }
.mode-card-progress-text { display: block; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--accent); }
.mode-card-actions { display: flex; gap: 10px; margin-top: 12px; }
.mode-card-actions > * { flex: 1; }
.mode-card-actions .btn { width: 100%; }

.progress-track { height: 6px; border-radius: 3px; background: var(--sep-light); overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: 3px; background: var(--accent); transition: width 0.3s ease; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.stat-label { display: block; font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.03em; }
.stat-value { display: block; margin-top: 2px; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-empty { font-size: 14px; }

.knowledge-bar { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; background: var(--sep-light); }
.knowledge-bar span { min-width: 0; }
.knowledge-right { background: var(--green); }
.knowledge-wrong { background: var(--red); }
.knowledge-never { background: var(--sep); }
.knowledge-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.dot { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 50%; }
.dot-right { background: var(--green); }
.dot-wrong { background: var(--red); }
.dot-never { background: var(--sep); }

/* --- Einstellungen: Schalter --------------------------------------------------- */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--sep-light); cursor: pointer; }
.toggle-row:first-of-type { padding-top: 0; }
.toggle-row-text { display: flex; flex-direction: column; gap: 2px; }
.toggle-row-label { font-size: 15px; font-weight: 600; }
.toggle-row-hint { font-size: 12px; line-height: 1.4; color: var(--text-2); }
.switch {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex-shrink: 0;
    width: 51px;
    height: 31px;
    margin: 0;
    border-radius: 16px;
    background: var(--sep-light);
    cursor: pointer;
    transition: background 0.2s ease;
}
.switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.link-box {
    width: 100%;
    margin-bottom: 10px;
    padding: 10px;
    font-size: 13px;
    border: 1px solid var(--sep);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
}

/* --- Quiz ---------------------------------------------------------------------- */
.quiz-status {
    position: sticky;
    top: calc(var(--header-h) + var(--safe-top));
    z-index: 15;
    padding: 8px 16px 10px;
    background: rgba(242, 242, 247, 0.92);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--sep-light);
}
.quiz-status-inner { display: flex; justify-content: space-between; gap: 12px; max-width: 608px; margin: 0 auto 6px; font-size: 13px; }
.quiz-status .progress-track { max-width: 608px; margin: 0 auto; }
.quiz-status-text { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.quiz-status-catalog { min-width: 0; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.quiz-main { padding-bottom: 12px; }
.quiz-question-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.quiz-hint { font-size: 12px; color: var(--text-2); text-align: right; }
.quiz-question { font-size: 18px; font-weight: 600; line-height: 1.4; white-space: pre-line; overflow-wrap: anywhere; }

.quiz-answers { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.answer-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 14px;
    font: inherit;
    font-size: 16px;
    line-height: 1.4;
    text-align: left;
    color: var(--text);
    background: var(--card);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}
.answer-option:disabled { cursor: default; color: var(--text); }
.answer-letter {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--sep-light);
    color: var(--text-2);
    font-size: 14px;
    font-weight: 700;
}
/* Multiple Choice: eckige Buchstaben-Marker wie Checkboxen */
.quiz-answers.is-multi .answer-letter { border-radius: 7px; }
.answer-text { flex: 1; min-width: 0; padding-top: 3px; white-space: pre-line; overflow-wrap: anywhere; }
.answer-option.is-selected { border-color: var(--accent); background: rgba(0, 122, 255, 0.06); }
.answer-option.is-selected .answer-letter { background: var(--accent); color: #fff; }
.answer-option.is-correct { border-color: var(--green); background: var(--green-bg); }
.answer-option.is-correct .answer-letter { background: var(--green); color: #fff; }
.answer-option.is-wrong { border-color: var(--red); background: var(--red-bg); }
.answer-option.is-wrong .answer-letter { background: var(--red); color: #fff; }
.answer-option.is-missed { border-color: var(--green); border-style: dashed; }
.answer-option.is-missed .answer-letter { background: var(--green-bg); color: var(--green-dark); }
.answer-option.is-dimmed { opacity: 0.5; }
@media (hover: hover) {
    .answer-option:not(:disabled):hover { border-color: var(--sep); }
    .answer-option.is-selected:not(:disabled):hover { border-color: var(--accent); }
}

.quiz-feedback { margin-bottom: 12px; padding: 12px 16px; border-radius: var(--radius-lg); font-size: 16px; font-weight: 700; }
.quiz-feedback.is-correct { background: var(--green-bg); color: var(--green-dark); }
.quiz-feedback.is-wrong { background: var(--red-bg); color: var(--red); }
.quiz-feedback-sub { display: block; margin-top: 2px; font-size: 13px; font-weight: 500; }
.quiz-explanation-label { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 700; color: var(--indigo); text-transform: uppercase; letter-spacing: 0.04em; }
.quiz-explanation p { font-size: 15px; line-height: 1.45; }

.quiz-round { padding: 28px 20px; text-align: center; }
.quiz-round-icon { font-size: 40px; }
.quiz-round-title { margin-top: 8px; font-size: 22px; font-weight: 800; }
.quiz-round-text { margin-top: 6px; font-size: 15px; line-height: 1.45; color: var(--text-2); }

.quiz-actions {
    position: sticky;
    bottom: 0;
    z-index: 10;
    margin: 0 -16px;
    padding: 14px 16px calc(12px + var(--safe-bottom));
    background: linear-gradient(to bottom, rgba(242, 242, 247, 0), var(--bg) 40%);
}
.quiz-keys { margin-top: 4px; font-size: 12px; text-align: center; color: var(--text-2); }
@media (hover: none) { .quiz-keys { display: none; } }

/* --- Ergebnis ------------------------------------------------------------------ */
.result-hero { padding: 26px 16px; text-align: center; }
.result-hero-mode { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.result-hero-value { margin-top: 10px; font-size: 54px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.result-hero-value.is-good { color: var(--green-dark); }
.result-hero-value.is-medium { color: var(--orange); }
.result-hero-value.is-bad { color: var(--red); }
.result-hero-text { margin-top: 10px; font-size: 16px; font-weight: 600; }
.round-row-value { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.result-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }

/* --- Buttons --------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 20px;
    border-radius: var(--radius);
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:active { background: var(--accent-dark); }
.btn-secondary { background: rgba(0, 122, 255, 0.1); color: var(--accent); }
.btn-secondary:active { background: rgba(0, 122, 255, 0.2); }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-danger:active { background: #FFDADA; }
.btn-plain { background: none; color: var(--accent); padding: 0 8px; min-height: 36px; font-weight: 500; }
.btn-icon { width: 36px; height: 36px; min-height: 0; padding: 0; border-radius: 8px; }
.btn:disabled { opacity: 0.4; cursor: default; }

/* --- Formulare --------------------------------------------------------- */
.field { margin-bottom: 16px; }
.field label, .field-label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.field input[type="text"],
.field input[type="number"],
.field input[type="password"],
.field input[type="email"],
.field select {
    width: 100%;
    font-size: 16px;
    padding: 12px 14px;
    border: 1px solid var(--sep);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    appearance: none;
    -webkit-appearance: none;
}
.field textarea {
    display: block;
    width: 100%;
    min-height: 200px;
    padding: 12px 14px;
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.45;
    border: 1px solid var(--sep);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    resize: vertical;
}
.field input[type="file"] {
    display: block;
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 1px dashed var(--sep);
    border-radius: var(--radius);
    background: var(--bg);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15); }
.field-hint { font-size: 12px; color: var(--text-2); margin-top: 4px; }

/* --- Flash / Toast --------------------------------------------------------- */
.flash { padding: 12px 14px; border-radius: var(--radius); font-size: 14px; line-height: 1.4; margin-bottom: 14px; }
.flash > div + div { margin-top: 4px; }
.flash-error { background: var(--red-bg); color: var(--red); }
.flash-success { background: var(--green-bg); color: var(--green-dark); }
.flash-info { background: rgba(0, 122, 255, 0.1); color: var(--accent-dark); }

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(24px + var(--safe-bottom));
    transform: translate(-50%, 20px);
    max-width: calc(100vw - 32px);
    background: rgba(28, 28, 30, 0.92);
    color: #fff;
    padding: 12px 20px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 50;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* --- Login-Formular ------------------------------------------------------ */
.login-body { background: var(--bg); }
.login-wrap { max-width: 360px; margin: 0 auto; padding: calc(var(--safe-top) + 64px) 20px 40px; text-align: center; }
.login-logo { font-size: 44px; margin-bottom: 8px; }
.login-title { font-size: 26px; font-weight: 700; }
.login-subtitle { font-size: 14px; color: var(--text-2); margin-top: 4px; margin-bottom: 24px; }
.login-form { text-align: left; }
.login-form label { display: block; font-size: 13px; color: var(--text-2); margin: 14px 0 6px; font-weight: 500; }
.login-form input { width: 100%; font-size: 16px; padding: 13px 14px; border: 1px solid var(--sep); border-radius: var(--radius); background: var(--card); }
.login-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15); }
.login-form .btn { margin-top: 22px; }
.login-invite-link { display: block; margin-top: 14px; font-size: 12px; color: var(--text-2); text-align: center; text-decoration: none; }
.login-invite-link:hover { color: var(--accent); text-decoration: underline; }

.select-on-click { cursor: pointer; }

/* --- Utility --------------------------------------------------------------- */
.text-secondary { color: var(--text-2); }
.text-center { text-align: center; }

/* --- Desktop (nachrangig, aber vorhanden) --------------------------------- */
@media (min-width: 768px) {
    .app-main { padding: 24px 16px 40px; }
    .card, .list { margin-bottom: 16px; }
    .quiz-question { font-size: 20px; }
}
