/* qmax5.css – Gestaltung der qPicdoc-Familie (Grundlage: qteach.de/qpicdoc/qpicdoc.css
   und qfeedback.css, kopiert, weil qMax5 auf einer eigenen Domain läuft).
   Kopf Navy, Karten, Knöpfe; Überschriften Didact Gothic, Text Arial.
   Akzent Orange aus dem Titelbild Stil 1 (KONZEPT E11). Symbole: qm5_qi(). */
@font-face {
    font-family: 'Didact Gothic';
    src: local('Didact Gothic'), local('DidactGothic-Regular'), url('/assets/fonts/didact-gothic.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

:root {
    --navy: #1e3a5f;
    --akzent: #ef6c3a;
    --akzent-hell: #f4895f;
    --akzent-zart: #fff4ee;
    --grund: #f7f3ea;
    --karte: #fff;
    --text: #1f2937;
    --leise: #64748b;
    --linie: #e2dccf;
    --gut: #16a34a;
    --rot: #b91c1c;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--grund);
    color: var(--text);
    line-height: 1.45;
}

h1, h2 { font-family: 'Didact Gothic', Arial, sans-serif; font-weight: 400; }

/* Symbole überall gleich: Linie in Schriftfarbe */
.qi { width: 1.2em; height: 1.2em; vertical-align: -.22em; fill: none; stroke: currentColor;
      stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.qi .f { fill: currentColor; stroke: none; }
.nur-leser { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Kopf */
.kopf {
    display: flex; align-items: center; gap: 14px;
    background: var(--navy); color: #fff;
    padding: 14px 20px;
}
.kopf .marke { width: 46px; height: 46px; border-radius: 11px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); display: block; }
.kopf h1 { margin: 0; font-size: 1.7rem; line-height: 1.1; }
.kopf h1 b { font-weight: 400; color: var(--akzent); }
.kopf p { margin: 2px 0 0; opacity: .85; font-size: .95rem; }
.kopf-start { display: block; line-height: 0; }
.kopf-rechts { margin-left: auto; display: flex; gap: 18px; align-items: center; font-size: .92rem; }
.kopf-rechts a { color: #fff; opacity: .85; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.kopf-rechts a:hover { opacity: 1; text-decoration: underline; }
.kopf-wer { opacity: .7; }
@media (max-width: 560px) {
    .kopf { flex-wrap: wrap; }
    .kopf-rechts { margin-left: 0; width: 100%; flex-wrap: wrap; gap: 6px 16px; }
    .kopf-rechts a { white-space: nowrap; }
}

/* Raster und Karten */
.raster { max-width: 1280px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.raster.einzeln { display: block; max-width: 1100px; }
.raster.qm5-schmal { max-width: 760px; }
.karte {
    background: var(--karte); border: 1px solid var(--linie); border-radius: 12px;
    padding: 16px 18px; margin-bottom: 16px;
}
h2 { margin: 0 0 12px; font-size: 1.3rem; color: var(--navy); display: flex; align-items: center; gap: 10px; }
h2 .qi { color: var(--akzent); }
h2 small { font-family: Arial, sans-serif; font-size: .85rem; color: var(--leise); }

/* Knöpfe */
.knopf {
    display: inline-block; border: 0; border-radius: 10px; cursor: pointer;
    background: var(--akzent); color: #1f2937; font: inherit; font-weight: bold;
    padding: 10px 18px; text-align: center; text-decoration: none;
}
.knopf:hover { background: var(--akzent-hell); }
.knopf .qi { width: 1.35em; height: 1.35em; vertical-align: -.3em; margin-right: .45em; }
.knopf:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.knopf.gross { font-size: 1.1rem; padding: 14px 22px; width: 100%; }
.knopf.zweit { background: #fff; border: 2px solid var(--navy); color: var(--navy); }
.knopf.zweit:hover { background: var(--akzent-zart); }
.knopf:disabled { opacity: .45; cursor: default; }
.knoepfe { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.knoepfe .knopf.gross { flex: 1 1 220px; width: auto; }

/* Texte */
.hinweis { color: var(--leise); font-size: .9rem; margin: 10px 0 0; }
.hinweis a, .meldung a { color: var(--navy); }
.meldung { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 8px; padding: 8px 12px; font-size: .92rem; margin: 12px 0 0; }
.meldung.gut { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.leer { color: var(--leise); }

/* Fuß */
.fuss { text-align: center; font-size: .82rem; color: var(--leise); padding: 20px 16px 28px; }
.fuss a { color: inherit; }

/* Formularteile (wie qpicdoc.css) */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.karte { border: 1px solid var(--linie); padding: 16px 18px; margin-bottom: 16px; }
.feld { display: block; font-weight: bold; font-size: .92rem; margin: 0 0 12px; }
.feld small { font-weight: normal; color: var(--leise); }
.feld input, .feld select, .feld textarea {
    display: block; width: 100%; margin-top: 6px; font: inherit; font-weight: normal; font-size: 1rem;
    padding: 8px 10px; border: 1px solid #c9c1b0; border-radius: 6px; background: #fff; color: var(--text);
}
.feld textarea { resize: vertical; line-height: 1.4; }
.feld select { width: auto; max-width: 100%; }
.zeile { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; cursor: pointer; }
.zeile input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--navy); }
.wahl { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.wahl label { position: relative; }
.wahl input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.wahl span { display: block; border: 2px solid #c9c1b0; border-radius: 8px; padding: 6px 12px; min-width: 44px; text-align: center; cursor: pointer; background: #fff; }
.wahl input:checked + span { border-color: var(--navy); background: var(--navy); color: #fff; }
.wahl input:focus-visible + span { outline: 3px solid #2563eb; outline-offset: 2px; }
.wahl small { display: block; font-size: .78rem; opacity: .8; }
.leiste { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.mini {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    border: 1px solid #c9c1b0; background: #fff; border-radius: 6px; cursor: pointer;
    min-width: 36px; min-height: 34px; font: inherit; font-size: .9rem; padding: 2px 8px; color: var(--text); text-decoration: none;
}
.mini:hover:not(:disabled) { border-color: var(--navy); }
.mini:disabled { opacity: .35; cursor: default; }
.mini.rot, .knopf.rot { color: var(--rot); border-color: #fca5a5; }
.knopf.zweit.rot:hover { background: #fef2f2; }
.klein { font-size: .88rem; color: var(--leise); }
.knoepfe form { margin: 0; display: flex; }

/* Startseite: links Startkarte + Editor, rechts Vorlagen (solange leer) und die Listen */
@media (min-width: 1000px) {
    .raster.qm5-raster { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
    .qm5-spalte-rechts { position: sticky; top: 16px; }
}
.qm5-seitentitel { margin: 4px 0 12px; }

/* Editor */
.qm5-zaehler { margin-left: auto; font-weight: bold; color: var(--navy) !important; background: var(--akzent-zart); border-radius: 999px; padding: 2px 10px; }
.qm5-zaehler.voll { background: var(--akzent); color: #1f2937 !important; }
.qm5-frage.mit-fehler, .qm5-teil.mit-fehler { border: 2px solid #fdba74; }
.qm5-frage-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.qm5-frage-kopf .nr, .qm5-kurz .nr {
    display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
    background: var(--navy); color: #fff; font-weight: bold; flex: none;
}
.qm5-typ select { font: inherit; font-weight: bold; color: var(--navy); padding: 6px 8px; border: 1px solid #c9c1b0; border-radius: 6px; background: #fff; }
.qm5-pflicht { display: inline-flex; align-items: center; gap: 6px; font-size: .92rem; cursor: pointer; }
.qm5-pflicht input { width: 17px; height: 17px; accent-color: var(--navy); }
.qm5-frage-kopf .leiste { margin-left: auto; }
.qm5-einst { margin-top: 2px; }
.qm5-schnell { margin: -4px 0 12px; }
.qm5-enden-feld { display: grid; gap: 0 12px; }
@media (min-width: 560px) { .qm5-enden-feld { grid-template-columns: 1fr 1fr; } }
.qm5-typwahl { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qm5-typknopf span { min-width: 0; hyphens: auto; overflow-wrap: break-word; }
@media (max-width: 420px) { .qm5-typknopf { flex-direction: column; align-items: flex-start; gap: 4px; padding: 9px 10px; } }
/* Leere Umfrage: die Typen der ersten Frage stehen in der Titelkarte */
.qm5-neu-titel { display: flex; align-items: center; gap: 8px; margin: 18px 0 10px; font-size: 1.05rem; color: var(--navy); }
.qm5-neu-titel .qi { color: var(--akzent); }
.qm5-neu-titel small { font-weight: normal; font-size: .85rem; color: var(--leise); }
.qm5-typknopf {
    display: flex; align-items: center; gap: 10px; font: inherit; font-weight: bold; color: var(--navy);
    background: #fff; border: 2px solid var(--navy); border-radius: 12px; padding: 10px 12px; cursor: pointer; text-align: left;
}
.qm5-typknopf .qi { width: 1.6em; height: 1.6em; color: var(--navy); }
.qm5-typknopf:hover { background: var(--akzent-zart); border-color: var(--akzent); }
.qm5-typknopf:hover .qi { color: var(--akzent); }
.qm5-max { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: bold; color: var(--navy); }
.qm5-max .qi { color: var(--gut); }

/* Vorschau */
.qm5-geraet {
    background: #ece6d8; border: 2px dashed #c9bfa8; border-radius: 14px;
    padding: 16px; margin-bottom: 16px;
}
.qm5-geraet::before {
    content: 'So sehen es die Teilnehmenden'; display: block; margin: -4px 0 10px;
    font-size: .82rem; font-weight: bold; color: var(--leise); text-transform: uppercase; letter-spacing: .04em;
}
.hinweis.oben { margin: 0 0 4px; }

/* Bogen */
.qm5-bogen-titel { font-size: 1.6rem; margin: 4px 0 14px; }
.qm5-teil legend {
    float: left; width: 100%; padding: 0; margin-bottom: 12px;
    font-family: 'Didact Gothic', Arial, sans-serif; font-size: 1.2rem; color: var(--navy); line-height: 1.3;
}
.qm5-teil legend + * { clear: both; }
.qm5-wievielte { display: block; font-family: Arial, sans-serif; font-size: .8rem; font-weight: bold; color: var(--akzent); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.qm5-teil .meldung { margin: 0 0 10px; clear: both; }
.qm5-tipp { margin: 0 0 8px; color: var(--leise); font-size: .9rem; clear: both; }
.qm5-optionen { display: grid; gap: 8px; clear: both; }
.qm5-option {
    display: flex; align-items: center; gap: 12px; cursor: pointer; margin: 0;
    border: 2px solid #d6cfbf; border-radius: 10px; padding: 11px 14px; background: #fff;
}
.qm5-option:hover { border-color: var(--navy); }
.qm5-option:has(input:checked) { border-color: var(--navy); background: #eef2f7; }
.qm5-option input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--navy); }
.qm5-option.gesperrt { opacity: .5; cursor: not-allowed; }

/* Sterne: DOM 5…1, angezeigt 1…5 (row-reverse) – so füllt :checked ~ label die kleineren mit */
.qm5-sterne { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; clear: both; }
.qm5-sterne input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.qm5-sterne label { cursor: pointer; line-height: 0; padding: 2px; border-radius: 8px; }
.qm5-sterne label .qi { width: 46px; height: 46px; stroke: #b9ad94; stroke-width: 1.6; fill: none; transition: fill .1s; }
.qm5-sterne input:checked ~ label .qi { fill: var(--akzent); stroke: var(--akzent); }
.qm5-sterne:hover input ~ label .qi { fill: none; stroke: #b9ad94; }
.qm5-sterne input ~ label:hover .qi, .qm5-sterne input ~ label:hover ~ label .qi { fill: var(--akzent-hell); stroke: var(--akzent); }
.qm5-sterne input:focus-visible + label { outline: 3px solid #2563eb; outline-offset: 1px; }

/* Smileys */
/* Immer fünf in einer Reihe – auf schmalen Handys werden sie kleiner statt umzubrechen */
.qm5-smileys { display: grid; grid-template-columns: repeat(5, minmax(0, 60px)); gap: 4px; clear: both; }
.qm5-smiley { position: relative; cursor: pointer; line-height: 0; border: 2px solid transparent; border-radius: 50%; padding: 3px; }
.qm5-smiley input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.qm5-gesicht { width: 100%; height: auto; aspect-ratio: 1; fill: none; stroke: #8c8170; stroke-width: 1.5; stroke-linecap: round; }
.qm5-gesicht .f { fill: #8c8170; stroke: none; }
.qm5-smiley:hover .qm5-gesicht { stroke: var(--navy); }
.qm5-smiley:hover .qm5-gesicht .f { fill: var(--navy); }
.qm5-smiley:has(input:checked) { border-color: var(--akzent); background: var(--akzent-zart); }
.qm5-smiley:has(input:checked) .qm5-gesicht { stroke: var(--akzent); }
.qm5-smiley:has(input:checked) .qm5-gesicht .f { fill: var(--akzent); }
.qm5-smiley:has(input:focus-visible) { outline: 3px solid #2563eb; outline-offset: 1px; }

/* Skala: Zahlen als Pillen */
.qm5-pillen { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; clear: both; max-width: 480px; }
.qm5-pillen.viele { grid-template-columns: repeat(11, minmax(0, 1fr)); max-width: 640px; gap: 4px; }
.qm5-pillen:not(.viele):has(> :nth-child(5):last-child) { grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 400px; }
.qm5-pille { position: relative; cursor: pointer; }
.qm5-pille input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.qm5-pille span {
    display: block; text-align: center; font-weight: bold; font-size: 1.15rem; padding: 10px 0;
    border: 2px solid #d6cfbf; border-radius: 10px; background: #fff;
}
.qm5-pillen.viele .qm5-pille span { font-size: 1rem; padding: 9px 0; border-radius: 8px; }
.qm5-pille:hover span { border-color: var(--navy); }
.qm5-pille input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.qm5-pille input:focus-visible + span { outline: 3px solid #2563eb; outline-offset: 2px; }
.qm5-enden { display: flex; justify-content: space-between; gap: 12px; color: var(--leise); font-size: .88rem; margin-top: 6px; max-width: 640px; }
.qm5-enden-5 { max-width: 260px; }
.qm5-pillen:not(.viele) + .qm5-enden { max-width: 480px; }

.qm5-textfeld { display: block; clear: both; }
.qm5-textfeld input, .qm5-textfeld textarea {
    display: block; width: 100%; font: inherit; font-size: 1rem; padding: 10px;
    border: 1px solid #c9c1b0; border-radius: 8px; resize: vertical; background: #fff;
}
.qm5-anonym { display: flex; gap: 10px; align-items: flex-start; color: var(--leise); font-size: .9rem; margin: 4px 0 14px; }
.qm5-anonym .qi { margin-top: 2px; }
.qm5-danke h2 { color: var(--gut); }
.qm5-danke h2 .qi { color: var(--gut); }

/* Startkarte */
.karte-aktiv { border: 2px solid var(--gut); }
.qm5-start h2 .qi { color: var(--gut); }
.qm5-start h2 small { font-weight: normal; }
.ausgabe { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.ausgabe .qr { width: 210px; aspect-ratio: 1; flex: none; background: #fff; }
.ausgabe .qr svg, .qm5-gross .qr svg { display: block; width: 100%; height: 100%; }
.ausgabe p { margin: 0; }
.ausgabe .klein { font-size: .95rem; }
.ausgabe .adresse { font-family: 'Didact Gothic', Arial, sans-serif; font-size: 2.2rem; color: var(--navy); line-height: 1.1; }
.code-gross { font-family: ui-monospace, Consolas, monospace; font-size: 2.8rem; font-weight: 800; letter-spacing: .08em; line-height: 1.15; color: var(--navy); }
.qm5-link { font-family: ui-monospace, Consolas, monospace; font-size: .95rem; overflow-wrap: anywhere; }
.stand { margin: 14px 0 0; font-weight: bold; color: var(--navy); }
.qm5-start.aus .qr, .qm5-start.aus .code-gross { opacity: .3; }
.ausgabe[data-gross-auf] { cursor: zoom-in; border-radius: 8px; }
.ausgabe[data-gross-auf]:hover .code-gross { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.ausgabe[data-gross-auf]:focus-visible { outline: 3px solid var(--navy); outline-offset: 6px; }
.qm5-stand-zeit { font-weight: normal; color: var(--leise); font-size: .9rem; }

/* Code groß (Beamer) */
.qm5-gross {
    position: fixed; inset: 0; z-index: 1000; background: #fff; cursor: zoom-out;
    display: flex; align-items: center; justify-content: center; gap: 5vw; padding: 4vh 4vw;
}
.qm5-gross[hidden] { display: none; }
.qm5-gross .qr { width: min(42vw, 78vh); aspect-ratio: 1; flex: none; }
.qm5-gross-text p { margin: 0; }
.qm5-gross-text .klein { font-size: min(2.6vw, 4.5vh); color: var(--text); }
.qm5-gross-text .adresse { font-family: 'Didact Gothic', Arial, sans-serif; font-size: min(6.5vw, 12vh); color: var(--navy); line-height: 1.1; }
.qm5-gross-text .code-gross { font-size: min(9vw, 17vh); margin: 1vh 0; }
.qm5-gross-text .qm5-link { font-size: min(2vw, 3.5vh); max-width: 40vw; }
.qm5-gross-zu { position: absolute; right: 2vw; bottom: 2vh; margin: 0; color: var(--leise); font-size: .9rem; }
@media (orientation: portrait) {
    .qm5-gross { flex-direction: column; gap: 3vh; text-align: center; }
    .qm5-gross .qr { width: min(80vw, 45vh); }
    .qm5-gross-text .klein { font-size: 5vw; }
    .qm5-gross-text .adresse { font-size: 11vw; }
    .qm5-gross-text .code-gross { font-size: 15vw; }
}

/* Liste */
.qm5-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.qm5-eintrag a { display: grid; gap: 1px; border: 1px solid var(--linie); border-radius: 10px; padding: 8px 10px; color: inherit; text-decoration: none; }
.qm5-eintrag a:hover .qm5-code { text-decoration: underline; }
.qm5-eintrag.offen a { background: #f0fdf4; border-color: #86efac; }
.qm5-eintrag.jetzt a { border: 2px solid var(--navy); padding: 7px 9px; }
.qm5-code { font-family: ui-monospace, Consolas, monospace; font-weight: 700; letter-spacing: .06em; }
.qm5-titel { font-weight: bold; overflow-wrap: anywhere; }
.qm5-info { color: var(--leise); font-size: .85rem; }

/* ===== Auswertung (ergebnis.php, sehen.php) ===== */
.qm5-auswertung-kopf h2 { font-size: 1.5rem; }
.qm5-mitmachen { margin: 0; font-size: 1.05rem; }
.qm5-ergebnis-stand { margin: 0 0 12px; font-size: 1.05rem; color: var(--navy); }
.qm5-live { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; font-size: .8rem; font-weight: bold;
    color: var(--gut); text-transform: uppercase; letter-spacing: .06em; }
.qm5-live i { width: 9px; height: 9px; border-radius: 50%; background: var(--gut); animation: qm5-puls 1.6s ease-in-out infinite; }
@keyframes qm5-puls { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .qm5-live i { animation: none; } }
.qm5-block h3 { margin: 0 0 2px; font-family: 'Didact Gothic', Arial, sans-serif; font-weight: 400; font-size: 1.25rem; color: var(--navy); line-height: 1.3; }
.qm5-bn { margin: 0 0 12px; color: var(--leise); font-size: .88rem; }

/* Balken: Beschriftung | Balken | Zahl. <progress> statt style-Breite (CSP). */
.qm5-bzeile { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) auto; align-items: center; gap: 10px; margin: 6px 0; }
.qm5-bl { display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.qm5-bl .qm5-gesicht { width: 26px; flex: none; }
.qm5-bw { white-space: nowrap; color: var(--leise); font-size: .92rem; min-width: 5.5em; text-align: right; }
.qm5-bw b { color: var(--text); }
.qm5-balken { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 14px; border: 0; border-radius: 4px; background: #ece6d8; overflow: hidden; }
.qm5-balken::-webkit-progress-bar { background: #ece6d8; border-radius: 4px; }
.qm5-balken::-webkit-progress-value { background: var(--navy); border-radius: 4px; }
.qm5-balken::-moz-progress-bar { background: var(--navy); border-radius: 4px; }
@media (max-width: 560px) {
    .qm5-bzeile { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
    .qm5-bzeile .qm5-balken { grid-column: 1 / -1; grid-row: 2; }
}

/* Kennzahl groß */
.qm5-held { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 4px 0 12px; }
.qm5-held-zahl { font-family: 'Didact Gothic', Arial, sans-serif; font-size: 2.2rem; color: var(--navy); line-height: 1; }
.qm5-held-zahl small { font-size: 1rem; color: var(--leise); }
.qm5-held-bild .qm5-gesicht { width: 52px; stroke: var(--akzent); }
.qm5-held-bild .qm5-gesicht .f { fill: var(--akzent); }
.qm5-sternmittel { width: 170px; height: auto; }
.qm5-sternmittel .leer path { fill: none; stroke: #b9ad94; stroke-width: 1.4; }
.qm5-sternmittel .voll path { fill: var(--akzent); stroke: var(--akzent); stroke-width: 1.4; }

/* Säulen (Skala) */
.qm5-saeulen { display: block; width: 100%; max-width: 640px; height: auto; }
.qm5-saeulen .spur { fill: #f3efe5; }
.qm5-saeulen .wert { fill: var(--navy); }
.qm5-saeulen text { font: 15px Arial, sans-serif; text-anchor: middle; }
.qm5-saeulen .anz { fill: var(--text); font-weight: bold; }
.qm5-saeulen .wert-text { fill: var(--leise); }
.qm5-saeulen g:hover .wert { fill: var(--akzent); }

/* Likert-Stapel und Legende */
.qm5-stapel { display: block; width: 100%; height: 34px; border-radius: 4px; }
.qm5-legende { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .92rem; }
.qm5-legende li { display: inline-flex; align-items: center; gap: 6px; }
.qm5-farbe { width: 12px; height: 12px; flex: none; }

/* Freitexte */
.qm5-woerter { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 0 0 12px; }
.qm5-wort { border-radius: 999px; padding: 3px 12px; background: var(--akzent-zart); color: var(--navy); }
.qm5-wort small { color: var(--leise); }
.qm5-wort.stufe-2 { font-size: 1.15rem; }
.qm5-wort.stufe-3 { font-size: 1.35rem; font-weight: bold; }
.qm5-texte summary { cursor: pointer; font-weight: bold; color: var(--navy); padding: 6px 0; }
.qm5-texte ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; }
.qm5-texte li { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between;
    border-left: 4px solid var(--akzent); background: #fbf9f4; border-radius: 0 8px 8px 0; padding: 8px 10px; }
.qm5-texte li span { overflow-wrap: anywhere; }
.qm5-aus { flex: none; min-width: 30px; min-height: 30px; padding: 2px; }
.qm5-ausgeblendet { margin: 8px 0 0; }

/* Beamer: ohne Kopf, große Schrift, Blöcke zweispaltig */
html.beamer .kopf, html.beamer .fuss, html.beamer .qm5-auswertung-kopf .hinweis,
html.beamer .qm5-auswertung-kopf form, html.beamer .qm5-auswertung-kopf a.knopf, html.beamer .qm5-aus { display: none; }
html.beamer body { background: #fff; font-size: 1.25rem; }
html.beamer .raster.einzeln { max-width: none; padding: 1.5vh 2vw; }
html.beamer .qm5-auswertung-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
html.beamer .qm5-auswertung-kopf h2 { font-size: 2.2rem; margin: 0; }
html.beamer .qm5-auswertung-kopf .knoepfe { margin: 0 0 0 auto; }
html.beamer .qm5-mitmachen { font-size: 1.6rem; }
html.beamer .qm5-ergebnis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 540px), 1fr)); gap: 0 16px; align-items: start; }
html.beamer .qm5-ergebnis-stand { grid-column: 1 / -1; font-size: 1.4rem; }
html.beamer .qm5-block h3 { font-size: 1.7rem; }
html.beamer .qm5-balken { height: 20px; }
html.beamer .qm5-held-zahl { font-size: 3.2rem; }
html.beamer .qm5-stapel { height: 48px; }

/* Ohne Konto (Stufe 3) */
.qm5-regeln ul { margin: 0; padding-left: 20px; }
.qm5-regeln li { margin: 6px 0; }
.qm5-regeln a, .qm5-dabei a:not(.knopf) { color: var(--navy); font-weight: bold; }
.qm5-frei-frist { display: flex; gap: 6px; align-items: flex-start; }
.qm5-frei-frist .qi { flex: none; margin-top: 2px; }

/* „Du hast schon teilgenommen“ */
.qm5-dabei .knoepfe { margin-top: 14px; }
.qm5-dabei .qm5-nochmal { margin: 18px 0 0; font-size: .92rem; }


/* Drucken mit Optionen (Stufe 4) */
.nur-druck { display: none; }
.qm5-ablage { margin-top: 8px; }
.qm5-druck h3 { font-family: 'Didact Gothic', Arial, sans-serif; font-weight: 400; font-size: 1.1rem; color: var(--navy); margin: 18px 0 8px; }
.qm5-druckfelder { display: grid; gap: 10px 14px; }
@media (min-width: 640px) { .qm5-druckfelder { grid-template-columns: 1fr 1fr; } }
.qm5-druckfelder input::placeholder { color: #94a3b8; font-style: italic; }
.qm5-druckoptionen textarea {
    display: block; width: 100%; margin-top: 6px; font: inherit; font-weight: normal; font-size: 1rem;
    padding: 8px 10px; border: 1px solid #c7d0db; border-radius: 6px; resize: vertical;
}
.qm5-druckoptionen .knoepfe { align-items: center; }
.qm5-ungespeichert { color: #92400e; font-size: .9rem; }
.qm5-druckkopf { font-size: 11pt; border-bottom: 1px solid #94a3b8; padding-bottom: 6px; margin: 4px 0 0; }
.qm5-druckkopf span { display: inline-block; margin: 0 18px 4px 0; white-space: nowrap; }
.qm5-druckkopf em { font-style: normal; color: #64748b; font-size: 8.5pt; letter-spacing: .06em; text-transform: uppercase; margin-right: 6px; }
.qm5-druckkopf b { font-weight: normal; }
.qm5-druckkopf b:empty { display: inline-block; min-width: 80px; border-bottom: 1px solid #94a3b8; height: 1em; vertical-align: -2px; }
.qm5-bem-text { min-height: 70px; border: 1px solid #cbd5e1; border-radius: 5px; padding: 6px 9px; white-space: pre-wrap; }


/* Meine Umfragen, gespeicherte Fragen (Stufe 4) */
.qm5-alle { margin: 12px 0 0; }
.qm5-alle a, .qm5-meine td a.qm5-titel { color: var(--navy); font-weight: bold; display: inline-flex; align-items: center; gap: 6px; }
.qm5-entwuerfe .qm5-eintrag { display: flex; gap: 6px; align-items: stretch; }
.qm5-entwuerfe .qm5-eintrag a { flex: 1; min-width: 0; }
.qm5-entwuerfe .qm5-eintrag form { display: flex; }
.qm5-mehr { margin-top: 8px; }
.qm5-mehr summary { cursor: pointer; color: var(--navy); font-weight: bold; padding: 4px 0; }
.qm5-mehr .qm5-liste { margin-top: 8px; }
.qm5-speichern-zeile { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.qm5-speichern-zeile .feld { flex: 1 1 220px; margin: 0; }
.qm5-tabelle-rahmen { overflow-x: auto; }
.qm5-tabelle { width: 100%; border-collapse: collapse; }
.qm5-tabelle th, .qm5-tabelle td { padding: 8px; border-bottom: 1px solid var(--linie); text-align: left; vertical-align: middle; }
.qm5-tabelle th { font-size: .88rem; color: var(--leise); }
.qm5-tabelle .zahl { text-align: center; white-space: nowrap; }
.qm5-tabelle tr.offen td:first-child { box-shadow: inset 3px 0 0 var(--gut); }
.qm5-tabelle td .qm5-code, .qm5-tabelle td .klein { display: block; font-size: .85rem; }
.qm5-aktionen { white-space: nowrap; }
.qm5-aktionen > * { display: inline-flex; vertical-align: middle; margin-left: 4px; }
@media (max-width: 640px) {
    /* Handy: jede Umfrage als Block statt Tabellenzeile */
    .qm5-tabelle thead { display: none; }
    .qm5-tabelle, .qm5-tabelle tbody { display: block; }
    .qm5-tabelle tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0 10px 8px; border-bottom: 1px solid var(--linie); }
    .qm5-tabelle tr.offen { box-shadow: inset 3px 0 0 var(--gut); }
    .qm5-tabelle tr.offen td:first-child { box-shadow: none; }
    .qm5-tabelle td { display: block; border: 0; padding: 0; }
    .qm5-tabelle td:first-child { grid-column: 1 / -1; }
    .qm5-tabelle td:nth-child(2), .qm5-tabelle td:nth-child(3) { grid-column: 1; font-size: .88rem; color: var(--leise); }
    .qm5-tabelle td.zahl { grid-column: 2; grid-row: 2; text-align: right; font-size: .88rem; }
    .qm5-tabelle td.zahl::after { content: " Antw."; color: var(--leise); }
    .qm5-tabelle td.qm5-aktionen { grid-column: 2; grid-row: 3; }
}

@media print {
    .kopf-rechts, .nicht-drucken, .fuss { display: none !important; }
    body { background: #fff; }
    .qm5-block { break-inside: avoid; }
    .qm5-block-text { break-inside: auto; }
    .qm5-balken::-webkit-progress-value, .qm5-stapel rect, .qm5-saeulen rect, .qm5-farbe rect { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .kopf { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .karte { border-color: #ccc; box-shadow: none; }
    .nur-druck { display: block; }
    html:not(.druck-schlicht) .druck-aus, .druck-schlicht .nur-druck,
    html:not(.druck-schlicht) .druck-ohne-texte .qm5-texte { display: none !important; }
    .qm5-live, .qm5-aus, .qm5-ausgeblendet, .qm5-texte summary { display: none !important; }
    .qm5-texte li[hidden] { display: none !important; }
}

/* ===== Vorlagen (Stufe 5): Karten mit Miniatur aus den Fragedaten (V10) ===== */
.qm5-vk-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
.qm5-vk-raster.einzeln { grid-template-columns: minmax(0, 220px); }
/* Startseite rechts: zwei Karten nebeneinander, Miniatur etwas flacher (KONZEPT §4.1) */
.qm5-vk-raster.start { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.qm5-vk-raster.start .qm5-mini { height: 118px; }
.qm5-vorlagen .hinweis { margin: 8px 0 0; }
.qm5-vk {
    display: flex; flex-direction: column; border: 1px solid var(--linie); border-radius: 12px; overflow: hidden;
    background: #fff; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s;
}
.qm5-vk:hover, .qm5-vk:focus-visible { border-color: var(--navy); box-shadow: 0 2px 10px rgba(30, 58, 95, .14); }
.qm5-vk:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.qm5-vk { min-width: 0; }
.qm5-vk-text { hyphens: auto; overflow-wrap: anywhere; display: grid; gap: 3px; padding: 9px 11px 11px; border-top: 1px solid var(--linie); flex: 1; align-content: start; }
.qm5-vk-titel { font-weight: bold; color: var(--navy); line-height: 1.25; }
.qm5-vk-beschr { font-size: .84rem; color: var(--leise); line-height: 1.3; }
.qm5-vk-typen { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin-top: 3px; color: var(--akzent); }
.qm5-vk-typen .qi { width: 1.05em; height: 1.05em; }
.qm5-vk-typen .n { color: var(--leise); font-size: .8rem; margin-left: 4px; }

/* Miniatur: ein verkleinerter Bogen, unten ausgeblendet */
.qm5-mini {
    position: relative; display: flex; flex-direction: column; gap: 5px; height: 150px; overflow: hidden;
    padding: 9px 10px; background: var(--grund); font-size: .56rem; line-height: 1.25; color: var(--text);
}
.qm5-mini::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 26px; background: linear-gradient(rgba(247, 243, 234, 0), var(--grund)); }
.qm5-mini-kopf { font-family: 'Didact Gothic', Arial, sans-serif; font-size: .78rem; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qm5-mini-frage { display: grid; gap: 3px; background: #fff; border: 1px solid var(--linie); border-radius: 5px; padding: 4px 5px; }
.qm5-mini-text { font-weight: bold; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.qm5-mini-ant { min-width: 0; overflow: hidden; display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: center; color: var(--leise); }
.qm5-mini-ant .o { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.qm5-mini-ant .o i { display: inline-block; width: 6px; height: 6px; border: 1px solid #94a3b8; border-radius: 50%; }
.qm5-mini-ant.typ-mehrfach .o i { border-radius: 1.5px; }
.qm5-mini-ant .o.mehr { font-weight: bold; }
.qm5-mini-ant.typ-sterne { gap: 1px; color: var(--akzent); }
.qm5-mini-ant.typ-sterne .qi, .qm5-mini-ant .qm5-gesicht { width: 11px; height: 11px; }
.qm5-mini-ant .qm5-gesicht { fill: none; stroke: var(--navy); stroke-width: 1.6; stroke-linecap: round; }
.qm5-mini-ant .qm5-gesicht .f { fill: var(--navy); stroke: none; }
.qm5-mini-ant.typ-skala { gap: 2px; }
.qm5-mini-ant.typ-skala b { display: inline-block; min-width: 11px; padding: 0 1px; border: 1px solid #94a3b8; border-radius: 3px; text-align: center; font-weight: normal; }
.qm5-mini-ant.typ-likert { gap: 3px; flex-wrap: nowrap; }
.qm5-mini-ant.typ-likert i { display: inline-block; width: 6px; height: 6px; border: 1px solid #94a3b8; border-radius: 50%; flex: none; }
.qm5-mini-ant.typ-likert .ende { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.qm5-mini-ant .feld { display: block; width: 100%; height: 9px; margin: 0; border: 1px solid #94a3b8; border-radius: 3px; background: #fff; }
.qm5-mini-ant .feld.lang { height: 20px; }
.qm5-mini > * { flex: none; }
.qm5-mini.leer { justify-content: center; align-items: center; color: var(--akzent); }
.qm5-mini.leer::after { display: none; }
.qm5-mini.leer .qi { width: 46px; height: 46px; stroke-width: 1.6; }
.qm5-vk.leer { border-style: dashed; border-color: #c9c1b0; }
.qm5-vk.leer .qm5-vk-text { border-top-style: dashed; }

/* Zahl neuer Vorschläge im Kopf */
.qm5-zahl { display: inline-block; min-width: 1.4em; padding: 0 .35em; border-radius: 999px; background: var(--akzent); color: #1f2937; font-size: .8rem; font-weight: bold; text-align: center; line-height: 1.4; }

/* Vorschlagen */
.qm5-vorschlag { display: grid; gap: 18px; }
@media (min-width: 760px) { .qm5-vorschlag { grid-template-columns: minmax(0, 1fr) 220px; align-items: start; } }
.qm5-vorschlag-karte .klein { margin: 0 0 6px; }
.qm5-stand-oeffentlich { color: var(--gut); font-weight: bold; }
.qm5-stand-abgelehnt { color: var(--leise); }

/* Vorlagen verwalten */
.qm5-gruppe { font-family: 'Didact Gothic', Arial, sans-serif; font-weight: 400; color: var(--navy); font-size: 1.1rem; margin: 22px 0 8px; border-bottom: 1px solid var(--linie); padding-bottom: 4px; }
.qm5-gruppe small { font-family: Arial, sans-serif; font-size: .85rem; color: var(--leise); }
.qm5-vadmin { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--linie); }
.qm5-vadmin .qm5-vk-raster.einzeln { grid-template-columns: minmax(0, 1fr); }
.qm5-vadmin-info .knoepfe { margin-top: 8px; }
.qm5-vadmin-kopf { margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.qm5-vadmin-felder { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: flex-end; }
.qm5-vadmin-felder .feld { margin-bottom: 8px; }
.qm5-vadmin-felder input[type=number] { width: 7em; }
.qm5-vadmin-felder .knopf { margin-bottom: 8px; }
.qm5-marke { display: inline-block; background: var(--navy); color: #fff; border-radius: 6px; padding: 0 8px; font-size: .8rem; }
.qm5-von { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 8px; font-size: .9rem; }
.qm5-von .qi { margin-top: 2px; color: var(--akzent); }
.qm5-begleit { display: block; margin-top: 4px; color: var(--leise); font-style: italic; }
@media (max-width: 640px) {
    .qm5-vadmin { grid-template-columns: minmax(0, 1fr); }
    .qm5-vadmin .qm5-vk-raster.einzeln { grid-template-columns: minmax(0, 220px); }
}

/* Editor: eine Frage offen, die übrigen als Zeile (zum Anklicken) */
.qm5-frage.offen { border: 2px solid var(--navy); }
.qm5-frage.zu { padding: 8px 10px; }
.qm5-frage.zu.mit-fehler, .qm5-frage.zu:has(.meldung) { border-color: #fed7aa; }
.qm5-kurz { display: flex; gap: 10px; align-items: center; }
.qm5-kurz-text {
    flex: 1; min-width: 0; display: grid; gap: 1px; text-align: left; cursor: pointer;
    background: none; border: 0; border-radius: 8px; padding: 6px 8px; font: inherit; color: inherit;
}
.qm5-kurz-text:hover { background: var(--akzent-zart); }
.qm5-kurz-text:focus-visible { outline: 3px solid #2563eb; outline-offset: 1px; }
.qm5-kurz-text strong { overflow-wrap: anywhere; }
.qm5-kurz-text em { color: var(--leise); font-weight: normal; }
.qm5-kurz-typ { display: flex; align-items: center; gap: 5px; font-size: .82rem; color: var(--leise); }
.qm5-kurz-typ .qi { color: var(--akzent); }
.qm5-kurz-ant { font-size: .86rem; color: var(--leise); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qm5-frage.zu .meldung { margin: 6px 0 2px; }
.qm5-fertig { margin-top: 4px; }
html { scroll-padding-top: 12px; }
@media (max-width: 560px) {
    .qm5-kurz { flex-wrap: wrap; gap: 4px 10px; }
    .qm5-kurz-text { flex-basis: calc(100% - 40px); }
    .qm5-kurz .leiste { margin-left: auto; }
}
