/* InteractiveQuestions: nur was die Vorlage nicht schon mitbringt. Grundlage ist quibiq/quibiq-app.css (App Design System,
   Gangart Aufgelockert). Farben kommen ausschließlich aus den Tokens; eigene Klassen beginnen mit q-. */

html, body { height: 100%; }
body { overscroll-behavior: none; }
.qb-app { height: 100dvh; overflow: hidden; }
.qb-app h1, .qb-app h2, .qb-app h3 { margin: 0; }
.qb-app button, .qb-app a, .qb-app summary { touch-action: manipulation; }
[hidden] { display: none !important; }
.sro { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Band „Neue Version“ steht zwischen Kopf und Inhalt */
.app.easy .a-body { grid-template-rows: minmax(0, 1fr); }
.app.easy .a-body:has(> .upd) { grid-template-rows: auto minmax(0, 1fr); }
.a-page { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }

/* Wortmarke: Text, solange es kein fertiges Produkt-Logo gibt */
.q-wm { color: var(--head-foreground); text-decoration: none; font-weight: 600; font-size: 16px; white-space: nowrap; }
.q-wm .ws { display: none; }
@container app (max-width: 767px) {
  .q-wm .wl { display: none; }
  .q-wm .ws { display: inline; }
}
.a-head .q-hidden-mobile { display: grid; }
.aplogo img { width: 91px; height: 22px; display: block; }

/* Seitenkopf der Gangart */
.ez-h p.q-fold { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; white-space: normal; cursor: pointer; }
.ez-h p { white-space: pre-line; }
.q-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }

/* Reiter bleiben beim Scrollen oben */
.q-tabs { position: sticky; top: -16px; z-index: 3; background: var(--background); margin: -4px 0 -12px; padding-top: 4px; }
@container app (max-width: 767px) { .q-tabs { top: -12px; } }
.q-tabs .ltabs button { height: 44px; font-size: 14px; }

/* Fragekarte */
.q-card { scroll-margin-top: 56px; }
.q-card h3 { font-size: 18px; line-height: 24px; }
.q-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; font-size: 13px; color: var(--muted-foreground); margin-bottom: -10px; }
.q-meta .mono { color: var(--foreground); font-weight: 600; }
.q-detail { white-space: pre-line; }
.q-detail.q-clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; white-space: normal; }
.q-more { margin-top: -10px; }
.q-more .lnk { font-size: 14px; padding: 6px 0; }
@container app (min-width: 768px) {
  .q-detail.q-clamp { display: block; white-space: pre-line; }
  .q-more { display: none; }
}
.q-why { color: var(--muted-foreground); white-space: pre-line; font-size: 15px; }
.q-why b { color: var(--foreground); }
.q-todo { display: flex; gap: 8px; align-items: flex-start; background: var(--info-soft); color: var(--foreground); border-left: 3px solid var(--info); padding: 8px 12px; font-size: 15px; white-space: pre-line; }
.q-todo .ic { color: var(--info); margin-top: 4px; }
.q-links { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 15px; }
.q-card code { font-family: ui-monospace, "Cascadia Code", Menlo, Consolas, monospace; font-size: .9em; background: var(--muted); padding: 0 4px; }

/* Antwortmöglichkeiten: Auswahl = graue Fläche mit blauem Rahmen, Wabe gefüllt */
.q-opts { display: grid; gap: 8px; }
.q-opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: var(--ctl); padding: 8px 12px; border: 1px solid var(--border); background: var(--card); color: var(--foreground); text-align: left; font-size: 16px; line-height: 1.35; }
@media (hover: hover) { .q-opt:hover { background: var(--muted); border-color: var(--input); } }
.q-opt:active { background: var(--accent); }
.q-opt[aria-pressed="true"] { background: var(--selected); border-color: var(--selected-border); font-weight: 600; }
.q-opt .hxn { width: 32px; height: 32px; font-size: 13px; }
.q-opt-t { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }

.q-note { display: block; width: 100%; min-height: 76px; resize: vertical; border: 1px solid var(--input); background: var(--card); color: var(--foreground); padding: 8px 10px; font-size: 16px; line-height: 1.4; }
.q-note:hover:not(:focus) { box-shadow: inset 0 -2px 0 var(--marker); }
.q-note::placeholder { color: var(--subtle-foreground); }
.ezf.q-foot { align-items: center; flex-wrap: wrap; gap: 4px 16px; }
.ezf.q-foot .lnk { font-size: 14px; padding: 10px 0; }
.ezf.q-foot .q-push { margin-left: auto; }

/* Geklärt */
.q-answer { display: grid; gap: 6px; }
.q-answer-line { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.q-answer p { white-space: pre-line; }
.q-history { display: grid; gap: 10px; border-left: 3px solid var(--border); padding-left: 12px; font-size: 14px; }
.q-history small, .q-small { font-size: 13px; color: var(--muted-foreground); }
.q-card details > summary { cursor: pointer; font-size: 14px; font-weight: 600; padding: 6px 0; }
.q-card details[open] > summary { margin-bottom: 8px; }
.q-card details .q-stack { display: grid; gap: 10px; font-size: 15px; }

/* Board-Liste */
.ezr .hxn { width: 36px; height: 36px; font-size: 13px; }

/* Formulare und Listen in Karten */
.q-form { display: grid; gap: 12px; }
.q-field { display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
.q-field .inp, .q-field textarea.inp { font-weight: 400; font-size: 16px; }
textarea.inp { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; }
.q-check { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.q-check input { width: 20px; height: 20px; accent-color: var(--primary); }
.q-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.q-row > .q-grow { flex: 1 1 220px; }
.q-grid2 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; }
.q-list { list-style: none; margin: 0; padding: 0; }
.q-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 15px; }
.q-list li:first-child { border-top: 0; padding-top: 0; }
.q-list li:last-child { padding-bottom: 0; }
.q-list .q-grow { flex: 1 1 200px; min-width: 0; }
.q-list select.inp { width: auto; }
.q-copy { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--muted); padding: 4px 4px 4px 10px; font-size: 14px; }
.q-copy .mono { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.btn.q-full { align-self: stretch; }

/* Rückmeldung unten, über der Handy-Leiste */
.q-toast { position: absolute; z-index: 9; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); width: min(calc(100% - 24px), 520px); min-height: 44px; font-size: 14px; }
.q-toast .lnk { margin-left: auto; font-size: 14px; font-weight: 600; padding: 10px 4px; }
@container app (max-width: 767px) { .q-toast { bottom: calc(68px + env(safe-area-inset-bottom)); } }

/* Hilfe */
.q-help h4 { font-size: 15px; margin: 0 0 2px; }
.q-help p { font-size: 14px; color: var(--muted-foreground); }

/* Suche */
.q-results { list-style: none; margin: 0; padding: 4px; max-height: 50dvh; overflow: auto; }
.q-results a { display: flex; flex-direction: column; padding: 8px; color: var(--foreground); text-decoration: none; }
.q-results a:hover, .q-results a:focus-visible { background: var(--muted); }
.q-results small { font-size: 12px; color: var(--muted-foreground); }

/* Anmeldung ohne App-Rahmen */
.q-gate { min-height: 100dvh; display: grid; place-items: start center; padding: 48px 16px; background: var(--background); overflow: auto; }
.q-gate .ez-w { max-width: 480px; }
.q-gate .q-brand { display: flex; align-items: center; gap: 12px; }
.q-gate .q-brand img { width: 120px; height: 29px; }

/* Aufklappbare Karte „Neues Board anlegen“ */
.q-sum { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; list-style: none; }
.q-sum::-webkit-details-marker { display: none; }
details[open] > .q-sum { margin-bottom: 12px; }

/* Anmeldung: Firmenkonto zuerst, Gast-Login-Link aufgeklappt darunter */
.q-gate a.btn.ezb { display: flex; justify-content: center; text-decoration: none; }
.q-guest { margin-top: 8px; }
.q-guest > summary { cursor: pointer; padding: 8px 0; color: var(--muted-foreground); font-weight: 600; }
.q-guest[open] > summary { margin-bottom: 8px; }

/* ---------- Reiche Fragen: Markdown und Bausteine ---------- */
.q-md { display: grid; gap: 8px; }
.q-md p { white-space: pre-line; }
.q-md-h { font-size: 16px; line-height: 22px; margin: 4px 0 -4px; }
.q-md-l { margin: 0; padding-left: 22px; display: grid; gap: 4px; }
.q-md-q { margin: 0; border-left: 3px solid var(--border); padding: 2px 12px; color: var(--muted-foreground); white-space: pre-line; }
.q-detail.q-clamp .q-md { display: block; }
.q-detail.q-clamp .q-md > * + * { margin-top: 8px; }
.q-detail.q-clamp { white-space: normal; }
.q-call { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-left: 3px solid var(--info); background: var(--info-soft); font-size: 15px; }
.q-call .ic { margin-top: 3px; flex: none; color: var(--info); }
.q-call > div { display: grid; gap: 4px; min-width: 0; }
.q-call.warning { border-color: var(--warning); background: var(--warning-soft); } .q-call.warning .ic { color: var(--warning); }
.q-call.risk { border-color: var(--danger); background: var(--danger-soft); } .q-call.risk .ic { color: var(--danger); }
.q-call.success { border-color: var(--success); background: var(--success-soft); } .q-call.success .ic { color: var(--success); }
.q-tbl { overflow-x: auto; border: 1px solid var(--border); }
.q-tbl table { border-collapse: collapse; width: 100%; font-size: 14px; }
.q-tbl caption { caption-side: bottom; text-align: left; padding: 6px 10px; font-size: 13px; color: var(--muted-foreground); }
.q-tbl th, .q-tbl td { text-align: left; vertical-align: top; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.q-tbl th { background: var(--muted); font-weight: 600; white-space: nowrap; }
.q-tbl tr:last-child td { border-bottom: 0; }
.q-code { position: relative; border: 1px solid var(--border); background: var(--muted); }
.q-code pre { margin: 0; padding: 10px 12px; overflow-x: auto; font-size: 13px; line-height: 1.45; }
.q-code pre code { background: none; padding: 0; }
.q-code-l { position: absolute; top: 0; right: 0; font-size: 11px; padding: 2px 6px; color: var(--muted-foreground); }
.q-fig { margin: 0; display: grid; gap: 6px; }
.q-fig-b { padding: 0; border: 1px solid var(--border); background: #fff; cursor: zoom-in; display: block; width: 100%; }
.q-fig img { display: block; max-width: 100%; max-height: 420px; margin: 0 auto; }
.q-fig figcaption { font-size: 13px; color: var(--muted-foreground); }
.q-zoom { position: fixed; inset: 0; z-index: 50; background: rgb(0 0 0 / .7); display: grid; place-items: center; padding: 16px; }
.q-zoom-c { position: relative; background: #fff; max-width: min(1200px, 100%); max-height: 100%; overflow: auto; padding: 40px 16px 16px; }
.q-zoom-c img { display: block; max-width: 100%; height: auto; }
.q-zoom-c p { color: #333; font-size: 14px; margin-top: 8px; }
.q-zoom-x { position: absolute; top: 4px; right: 4px; color: #333; }
.q-det { border: 1px solid var(--border); padding: 0 12px; }
.q-card .q-det > summary { padding: 8px 0; }
.q-card .q-det[open] { padding-bottom: 10px; }
.q-steps { margin: 0; padding-left: 0; list-style: none; counter-reset: st; display: grid; gap: 10px; }
.q-steps li { counter-increment: st; display: grid; grid-template-columns: 28px 1fr; gap: 2px 10px; }
.q-steps li::before { content: counter(st); grid-row: span 2; width: 28px; height: 28px; display: grid; place-items: center; background: var(--primary); color: var(--primary-foreground); font-weight: 700; font-size: 13px; }
.q-facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.q-facts > div { border: 1px solid var(--border); padding: 8px 10px; }
.q-facts dt { font-size: 12px; color: var(--muted-foreground); }
.q-facts dd { margin: 0; font-weight: 600; font-size: 16px; }

/* ---------- Optionen mit Details ---------- */
.q-opt-w { display: grid; gap: 4px; }
.q-opt-x { display: grid; gap: 6px; padding-left: 56px; font-size: 14px; }
.q-opt-x .q-det { border: 0; padding: 0; }
.q-opt-x .q-det > summary { padding: 2px 0; font-size: 13px; color: var(--muted-foreground); }
.q-chips { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.q-chip { font-size: 12px; background: var(--muted); padding: 2px 8px; color: var(--muted-foreground); }
.q-chip b { color: var(--foreground); }
.q-pc { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin-top: 6px; }
.q-pro, .q-con { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.q-pro li::before { content: "+ "; color: var(--success); font-weight: 700; }
.q-con li::before { content: "− "; color: var(--danger); font-weight: 700; }

/* ---------- Antworttypen ---------- */
.q-hint { color: var(--muted-foreground); }
.q-rank { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.q-rank-i { display: flex; align-items: flex-start; gap: 12px; border: 1px solid var(--border); background: var(--card); padding: 8px 8px 8px 12px; }
.q-rank-i .hxn { width: 32px; height: 32px; font-size: 13px; flex: none; }
.q-rank-i .q-grow { display: grid; gap: 4px; padding-top: 5px; }
.q-rank-i .q-opt-x { padding-left: 0; }
.q-rank-b { display: flex; gap: 2px; }
.ic.q-up { transform: rotate(-90deg); } .ic.q-dn { transform: rotate(90deg); }
.q-scale { display: grid; gap: 6px; }
.q-scale-top { display: flex; align-items: baseline; gap: 12px; }
.q-scale-v { font-size: 24px; font-weight: 700; min-width: 60px; }
.q-range { width: 100%; height: 32px; accent-color: var(--primary); }
.q-range.q-unset { opacity: .5; }
.q-scale-ends { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted-foreground); }
.q-matrix { display: grid; gap: 4px; }
.q-mrow { display: grid; grid-template-columns: minmax(140px, 1fr) 2fr; gap: 6px 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }
@media (max-width: 640px) { .q-mrow { grid-template-columns: 1fr; } }
.q-mrow-l { font-weight: 600; }
.q-seg { display: flex; flex-wrap: wrap; gap: 4px; }
.q-seg-b { min-height: 40px; padding: 6px 12px; border: 1px solid var(--border); background: var(--card); color: var(--foreground); font: inherit; font-size: 14px; cursor: pointer; }
@media (hover: hover) { .q-seg-b:hover { background: var(--muted); } }
.q-seg-b[aria-checked="true"] { background: var(--selected); border-color: var(--selected-border); font-weight: 600; }
.q-seg-b.q-rec::after { content: " ★"; color: var(--info); }
.q-alloc { display: grid; gap: 12px; }
.q-alloc-i { display: grid; gap: 6px; }
.q-alloc-h { display: grid; grid-template-columns: 1fr 40px 76px 40px 16px; align-items: center; gap: 6px; }
.q-num { width: 76px; text-align: right; }
.q-stp { width: 40px; padding: 0; font-size: 18px; }
.q-bar { display: block; height: 6px; background: var(--muted); }
.q-bar-f { display: block; height: 100%; background: var(--primary); transition: width .15s; }
.q-alloc-i .q-opt-x { padding-left: 0; }
