/* Werkzeugkunde – Kälte Kleinsorg */
:root {
  --blau: #1F458E;
  --tiefblau: #242E5B;
  --rot: #D02627;
  --gruen: #2C7A4B;
  --gelb: #B98300;

  --bg: #F1F4F6;
  --paper: #FFFFFF;
  --ink: #16212A;
  --muted: #56636E;
  --rule: #D5DCE2;
  --accent: var(--blau);
  --accent-soft: #E6ECF6;
  --warn: #8A6200;
  --warn-bg: #FFF5D6;
  --warn-rule: #E5B83A;
  --danger: #B3201F;
  --danger-bg: #FCE9E9;
  --ok-bg: #E4F2E9;
  --bubble-bg: #FFFFFF;
  --tab-bg: #FFFFFF;
  --frame: #16212A;
  --shadow: 4px 4px 0 rgba(22, 33, 42, .18);

  --f-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --f-comic: "Comic Neue", "Comic Sans MS", var(--f-body);

  --tabbar-h: 62px;
  --gutter: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1522; --paper: #182133; --ink: #E8EDF3; --muted: #A2AFBD; --rule: #2C3950;
    --accent: #7FA4EA; --accent-soft: #1D2B48; --warn: #F0C451; --warn-bg: #2E2710; --warn-rule: #8E6D12;
    --danger: #FF8A89; --danger-bg: #3A1618; --ok-bg: #12301F; --bubble-bg: #1E2A40; --tab-bg: #141C2C;
    --frame: #0A0F18; --shadow: 4px 4px 0 rgba(0, 0, 0, .45); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1522; --paper: #182133; --ink: #E8EDF3; --muted: #A2AFBD; --rule: #2C3950;
  --accent: #7FA4EA; --accent-soft: #1D2B48; --warn: #F0C451; --warn-bg: #2E2710; --warn-rule: #8E6D12;
  --danger: #FF8A89; --danger-bg: #3A1618; --ok-bg: #12301F; --bubble-bg: #1E2A40; --tab-bg: #141C2C;
  --frame: #0A0F18; --shadow: 4px 4px 0 rgba(0, 0, 0, .45); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.5 var(--f-body);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
img { max-width: 100%; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; text-transform: uppercase; letter-spacing: .02em; line-height: 1.05; margin: 0; }
h1 { font-size: 34px; }
h2 { font-size: 25px; }
h3 { font-size: 20px; }
.code { font-family: var(--f-mono); font-weight: 700; font-size: .82em; letter-spacing: .02em; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Kopfzeile & Tabbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px;
  padding: calc(6px + env(safe-area-inset-top)) 8px 6px; min-height: 54px;
  background: var(--tiefblau); color: #fff; border-bottom: 4px solid var(--rot);
}
.brand { display: flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; font-family: var(--f-display); font-weight: 700; font-size: 22px; text-transform: uppercase; letter-spacing: .04em; margin-right: auto; padding-left: 6px; }
.brand-k { display: grid; place-items: center; width: 30px; height: 30px; background: var(--blau); border: 2px solid #fff; border-radius: 50%; font-size: 18px; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; background: none; border: 0; color: #fff; border-radius: 10px; cursor: pointer; }
.icon-btn:active { background: rgba(255, 255, 255, .15); }
.offline-badge { font-size: 12px; font-weight: 700; text-transform: uppercase; background: var(--gelb); color: #fff; padding: 2px 8px; border-radius: 99px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--tab-bg); border-top: 1px solid var(--rule);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 600; min-width: 0; }
.tabbar svg { width: 25px; height: 25px; fill: currentColor; stroke: currentColor; }
.tabbar svg path[fill="none"], .tabbar svg circle[fill="none"] { fill: none; }
.tabbar a.aktiv { color: var(--accent); }
.tabbar a.aktiv span { font-weight: 700; }

main { display: block; max-width: 900px; margin: 0 auto; padding: 18px var(--gutter) 32px; outline: none; }
.laden { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- Karten, Ampel ---------- */
.karte { background: var(--paper); border: 2px solid var(--frame); border-radius: 12px; box-shadow: var(--shadow); padding: 16px; }
.abschnitt { margin-top: 26px; }
.abschnitt > h2 { margin-bottom: 10px; }
.eyebrow { font-family: var(--f-display); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: 15px; color: var(--accent); }

.ampel-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--frame); flex: none; vertical-align: -2px; }
.ampel-gruen { --ampel: var(--gruen); }
.ampel-gelb { --ampel: var(--gelb); }
.ampel-rot { --ampel: var(--rot); }
.ampel-dot { background: var(--ampel); }
.ampel-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px 3px 8px; border-radius: 99px; background: var(--ampel); color: #fff; font-weight: 700; font-size: 14px; }
.ampel-badge::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.ampel-liste { display: grid; gap: 10px; }
.ampel-zeile { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--paper); border: 1px solid var(--rule); border-left: 8px solid var(--ampel); }
.ampel-zeile .ampel-dot { width: 30px; height: 30px; border-width: 3px; }
.ampel-zeile b { display: block; font-family: var(--f-display); text-transform: uppercase; font-size: 18px; letter-spacing: .04em; }

/* ---------- Startseite ---------- */
.hero { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; background: var(--tiefblau); color: #fff; border-radius: 14px; padding: 18px 12px 0 18px; overflow: hidden; border: 2px solid var(--frame); box-shadow: var(--shadow); }
.hero h1 { font-size: 38px; color: #fff; }
.hero .unter { margin: 6px 0 4px; color: #D6DDEB; font-size: 16px; }
.hero .betrieb { display: inline-block; margin: 6px 0 16px; font-family: var(--f-display); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--rot); padding: 2px 10px; border-radius: 4px; }
.hero img { height: 190px; width: auto; display: block; }
.hero-text { align-self: center; padding-bottom: 12px; }

.michael { display: grid; grid-template-columns: 92px 1fr; gap: 6px; align-items: end; margin: 18px 0 0; }
.michael img { width: 92px; height: auto; display: block; }
.bubble {
  position: relative; background: var(--bubble-bg); border: 3px solid var(--accent); border-radius: 18px;
  padding: 12px 14px; font-family: var(--f-comic); font-weight: 700; font-size: 16.5px; line-height: 1.35; margin-bottom: 30px;
  box-shadow: var(--shadow);
}
.bubble::before { content: ""; position: absolute; left: -17px; bottom: 18px; border: 9px solid transparent; border-right: 14px solid var(--accent); }
.bubble::after { content: ""; position: absolute; left: -10px; bottom: 21px; border: 6px solid transparent; border-right: 10px solid var(--bubble-bg); }
.bubble .titel { display: block; font-family: var(--f-display); text-transform: uppercase; letter-spacing: .05em; color: var(--accent); font-size: 15px; margin-bottom: 3px; }
.michael.warnung .bubble { border-color: var(--rot); }
.michael.warnung .bubble::before { border-right-color: var(--rot); }
.michael.warnung .bubble .titel { color: var(--danger); }

.einstieg { display: flex; align-items: center; gap: 14px; margin-top: 22px; padding: 14px 16px; text-decoration: none; color: inherit; background: var(--rot); color: #fff; border-radius: 12px; border: 2px solid var(--frame); box-shadow: var(--shadow); }
.einstieg b { font-family: var(--f-display); text-transform: uppercase; font-size: 24px; letter-spacing: .03em; display: block; line-height: 1.05; }
.einstieg span { font-size: 15px; opacity: .92; }
.einstieg .pfeil { margin-left: auto; font-size: 28px; font-weight: 700; }

.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; }
.kachel { display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--paper); border: 2px solid var(--frame); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); min-height: 44px; }
.kachel .bild { aspect-ratio: 4 / 3; background: #fff; display: grid; place-items: center; border-bottom: 2px solid var(--frame); }
.kachel .bild img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.kachel .txt { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.kachel .buchst { font-family: var(--f-mono); font-weight: 700; color: var(--accent); font-size: 13px; }
.kachel b { font-family: var(--f-display); font-size: 19px; line-height: 1.05; text-transform: uppercase; letter-spacing: .02em; }
.kachel .anzahl { font-size: 13.5px; color: var(--muted); margin-top: auto; }
.balken { height: 7px; background: var(--rule); border-radius: 99px; overflow: hidden; }
.balken i { display: block; height: 100%; background: var(--gruen); border-radius: 99px; }

.install { margin-top: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: 10px; border: 2px solid var(--frame); background: var(--accent); color: #fff; font-weight: 700; font-size: 17px; text-decoration: none; cursor: pointer; box-shadow: 3px 3px 0 rgba(22, 33, 42, .2); }
.btn.hell { background: var(--paper); color: var(--ink); }
.btn.rot { background: var(--rot); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-reihe { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Listen (Gruppe, Suche) ---------- */
.liste { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.eintrag { display: grid; grid-template-columns: 86px 1fr auto; gap: 12px; align-items: center; min-height: 76px; padding: 8px 12px 8px 8px; background: var(--paper); border: 1px solid var(--rule); border-left: 7px solid var(--ampel); border-radius: 10px; text-decoration: none; color: inherit; }
.eintrag:active { background: var(--accent-soft); }
.eintrag .vorschau { width: 86px; height: 64px; background: #fff; border-radius: 6px; border: 1px solid var(--rule); display: grid; place-items: center; overflow: hidden; }
.eintrag .vorschau img { width: 100%; height: 100%; object-fit: contain; }
.eintrag .name { font-weight: 700; font-size: 17.5px; line-height: 1.2; display: block; }
.eintrag .zeile2 { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); margin-top: 3px; flex-wrap: wrap; }
.eintrag .schnipsel { display: block; font-size: 14px; color: var(--muted); margin-top: 3px; line-height: 1.3; }
.eintrag .schnipsel mark { background: #FFE58A; color: #16212A; border-radius: 2px; }
.eintrag .haken { display: flex; gap: 4px; }
.haken-mini { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--rule); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: transparent; }
.haken-mini.an { background: var(--gruen); border-color: var(--gruen); color: #fff; }

.kopf { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }

/* ---------- Suche ---------- */
.suchfeld { position: relative; }
.suchfeld input { width: 100%; min-height: 52px; font-size: 18px; padding: 12px 44px 12px 16px; border: 2px solid var(--frame); border-radius: 12px; background: var(--paper); color: var(--ink); outline: none; }
.suchfeld input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.suchfeld .leeren { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; border: 0; background: none; font-size: 22px; color: var(--muted); cursor: pointer; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 40px; padding: 7px 14px; border-radius: 99px; border: 2px solid var(--rule); background: var(--paper); font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.chip.an { border-color: var(--accent); background: var(--accent); color: #fff; }
.filter-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 10px; }
.treffer-info { margin: 14px 0 8px; color: var(--muted); font-size: 15px; }

/* ---------- Steckbrief ---------- */
.sb-kopf { display: flex; flex-direction: column; gap: 6px; }
.sb-kopf .meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sb-kopf .code-gross { font-family: var(--f-mono); font-weight: 700; font-size: 16px; background: var(--tiefblau); color: #fff; padding: 2px 9px; border-radius: 5px; }
.sb-kopf h1 { font-size: 36px; }
.ampel-hinweis { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: var(--paper); border: 1px solid var(--rule); border-left: 8px solid var(--ampel); font-size: 15.5px; }
.ampel-hinweis b { font-family: var(--f-display); text-transform: uppercase; letter-spacing: .04em; font-size: 17px; }

.foto { margin: 18px 0 0; }
.foto-rahmen { background: #fff; border: 3px solid var(--frame); border-radius: 12px; padding: 8px; box-shadow: var(--shadow); cursor: zoom-in; position: relative; }
.foto-box { position: relative; width: 100%; line-height: 0; }
.foto-box img { display: block; width: 100%; height: auto; }
.zoom-zeile { display: flex; justify-content: flex-end; align-items: center; gap: 5px; margin-top: 6px; font-size: 12.5px; font-weight: 600; color: #56636E; line-height: 1; }
.pt {
  position: absolute; transform: translate(-50%, -50%); width: 28px; height: 28px; border-radius: 50%;
  background: var(--blau); color: #fff; border: 3px solid #fff; box-shadow: 0 0 0 1.5px #16212A, 0 2px 4px rgba(0, 0, 0, .35);
  display: grid; place-items: center; font: 700 14px/1 var(--f-body); padding: 0; cursor: pointer; line-height: 1;
}
.pt.hl { background: var(--rot); transform: translate(-50%, -50%) scale(1.25); z-index: 2; }
.foto figcaption { margin-top: 10px; font-size: 15.5px; color: var(--muted); font-style: italic; }
.foto .lizenz { display: block; margin-top: 4px; font-style: normal; font-size: 13px; }
.legende { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.legende li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; font-size: 16px; padding: 4px 6px; border-radius: 8px; cursor: pointer; }
.legende li.hl { background: var(--accent-soft); }
.legende .nr { width: 26px; height: 26px; border-radius: 50%; background: var(--blau); color: #fff; border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--frame); display: grid; place-items: center; font-weight: 700; font-size: 13px; margin-top: 1px; }

.zeichnung { margin: 18px 0 0; }
.zeichnung .svg-box { background: #fff; border: 3px solid var(--frame); border-radius: 12px; padding: 10px; box-shadow: var(--shadow); overflow-x: auto; }
.zeichnung svg { display: block; width: 100%; min-width: 300px; height: auto; }
.zeichnung figcaption { margin-top: 10px; font-size: 15.5px; color: var(--muted); font-style: italic; }
/* Klassen aus den Handbuch-Zeichnungen */
.zeichnung .st, .zeichnung .st2, .zeichnung .dk, .zeichnung .bd, .zeichnung .rd, .zeichnung .yl, .zeichnung .cu { stroke-width: 3.5; stroke-linejoin: round; }
.zeichnung .tool { filter: drop-shadow(5px 5px 0 rgba(22, 33, 42, .30)); }
.zeichnung .st { fill: #BCC6CD; stroke: #16212A; }
.zeichnung .st2 { fill: #8F9BA4; stroke: #16212A; }
.zeichnung .dk { fill: #34424C; stroke: #16212A; }
.zeichnung .bd { fill: #4A6878; stroke: #16212A; }
.zeichnung .rd { fill: #C8342B; stroke: #16212A; }
.zeichnung .yl { fill: #F2C230; stroke: #16212A; }
.zeichnung .cu { fill: #D98646; stroke: #16212A; }
.zeichnung .dot { fill: #16212A; }
.zeichnung .lead { stroke: #16212A; stroke-width: 1.8; fill: none; stroke-linecap: round; }
.zeichnung .lbl { font-family: var(--f-comic); font-weight: 700; font-size: 15px; fill: #16212A; }
.zeichnung .lbl.b { font-weight: 700; }

.wofuer { font-size: 18px; }
.varianten { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.variante { background: var(--paper); border: 1px solid var(--rule); border-top: 5px solid var(--accent); border-radius: 10px; padding: 11px 14px; }
.variante b { display: block; font-size: 17.5px; margin-bottom: 2px; }
.schritte { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 10px; }
.schritte li { counter-increment: s; display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: start; padding: 12px; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; }
.schritte li::before { content: counter(s); font-family: var(--f-display); font-weight: 700; font-size: 23px; width: 38px; height: 38px; display: grid; place-items: center; background: var(--tiefblau); color: #fff; border-radius: 8px; }
.schritte b { display: block; font-size: 17.5px; }

.box { border-radius: 12px; padding: 14px 16px; margin-top: 16px; }
.box h2 { font-size: 22px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.box ul { margin: 0; padding-left: 22px; display: grid; gap: 7px; }
.box.sicherheit { background: var(--warn-bg); border: 2px solid var(--warn-rule); }
.box.sicherheit h2 { color: var(--warn); }
.box.fehler { background: var(--danger-bg); border: 2px solid var(--danger); }
.box.fehler h2 { color: var(--danger); }
.box.pflege { background: var(--accent-soft); border: 2px solid var(--accent); }
.box.pflege h2 { color: var(--accent); }
.box .sym { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 17px; font-family: var(--f-body); }
.box.sicherheit .sym { background: var(--gelb); }
.box.fehler .sym { background: var(--rot); }
.box.pflege .sym { background: var(--blau); }

.fragen { display: grid; gap: 10px; }
.frage { background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.frage summary { list-style: none; cursor: pointer; padding: 14px 16px; display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: start; font-weight: 700; min-height: 48px; }
.frage summary::-webkit-details-marker { display: none; }
.frage summary .nr { width: 28px; height: 28px; border-radius: 6px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 14px; }
.frage summary .auf { font-size: 13px; font-weight: 700; color: var(--accent); white-space: nowrap; padding-top: 3px; }
.frage[open] summary .auf { color: var(--muted); }
.frage .antwort { padding: 0 16px 14px 56px; color: var(--ink); }
.frage .antwort::before { content: "Antwort: "; font-weight: 700; color: var(--gruen); }

.fortschritt-box { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toggle { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 12px; background: var(--paper); border: 2px solid var(--rule); border-radius: 10px; cursor: pointer; font-weight: 700; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .kasten { flex: none; width: 28px; height: 28px; border-radius: 7px; border: 2.5px solid var(--muted); display: grid; place-items: center; color: transparent; font-size: 18px; }
.toggle input:checked + .kasten { background: var(--gruen); border-color: var(--gruen); color: #fff; }
.toggle:has(input:checked) { border-color: var(--gruen); background: var(--ok-bg); }
.toggle input:focus-visible + .kasten { outline: 3px solid var(--accent); outline-offset: 2px; }

.blaettern { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 30px; }
.blaettern a { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; min-height: 64px; background: var(--paper); border: 2px solid var(--frame); border-radius: 10px; text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.blaettern a.weiter { text-align: right; grid-column: 2; }
.blaettern small { font-size: 13px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.blaettern b { font-size: 16px; line-height: 1.2; }

/* Wissen-Tabelle */
.tabelle-wrap { overflow-x: auto; border: 2px solid var(--frame); border-radius: 10px; background: var(--paper); }
table.tab { border-collapse: collapse; width: 100%; font-size: 15.5px; min-width: 460px; }
.tab th, .tab td { padding: 9px 11px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.tab thead th { background: var(--tiefblau); color: #fff; font-family: var(--f-display); text-transform: uppercase; letter-spacing: .04em; font-size: 16px; }
.tab tbody th { font-weight: 700; background: var(--accent-soft); }
.tab.schmal { min-width: 0; }
.merke { background: var(--accent-soft); border-left: 7px solid var(--accent); border-radius: 10px; padding: 12px 14px; font-weight: 600; }

/* Einleitung */
.block { margin-top: 22px; }
.block ol, .block ul { margin: 8px 0 0; padding-left: 0; list-style: none; display: grid; gap: 8px; }
.block li { background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: 10px 14px; }
.block ol { counter-reset: r; }
.block ol li { counter-increment: r; display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: start; border-left: 6px solid var(--rot); }
.block ol li::before { content: counter(r); width: 34px; height: 34px; display: grid; place-items: center; background: var(--rot); color: #fff; font-family: var(--f-display); font-weight: 700; font-size: 22px; border-radius: 50%; }
.block ul li { border-left: 6px solid var(--accent); }
a.code-link { font-family: var(--f-mono); font-weight: 700; font-size: .85em; text-decoration: none; background: var(--accent-soft); color: var(--accent); padding: 1px 6px; border-radius: 5px; white-space: nowrap; }

/* ---------- Quiz ---------- */
.quiz-start { display: grid; gap: 12px; }
.modus { text-align: left; display: grid; gap: 3px; padding: 16px; background: var(--paper); border: 2px solid var(--frame); border-radius: 12px; box-shadow: var(--shadow); cursor: pointer; }
.modus b { font-family: var(--f-display); text-transform: uppercase; font-size: 22px; letter-spacing: .03em; }
.qfrage { margin-top: 16px; }
.qfrage h3 { font-family: var(--f-body); text-transform: none; letter-spacing: 0; font-size: 19px; line-height: 1.3; margin-bottom: 10px; }
.qfrage .qnr { font-family: var(--f-mono); font-size: 13px; font-weight: 700; color: var(--accent); display: block; margin-bottom: 4px; }
.antworten { display: grid; gap: 9px; }
.antwort-btn { text-align: left; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; min-height: 54px; padding: 10px 14px; background: var(--paper); border: 2px solid var(--rule); border-radius: 10px; cursor: pointer; font-size: 16.5px; }
.antwort-btn .bst { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--muted); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.antwort-btn.gewaehlt { border-color: var(--accent); background: var(--accent-soft); }
.antwort-btn.gewaehlt .bst { background: var(--accent); border-color: var(--accent); color: #fff; }
.antwort-btn.richtig { border-color: var(--gruen); background: var(--ok-bg); }
.antwort-btn.richtig .bst { background: var(--gruen); border-color: var(--gruen); color: #fff; }
.antwort-btn.falsch { border-color: var(--rot); background: var(--danger-bg); }
.antwort-btn.falsch .bst { background: var(--rot); border-color: var(--rot); color: #fff; }
.antwort-btn:disabled { cursor: default; color: var(--ink); }
.erklaerung { margin-top: 10px; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); font-size: 15.5px; }
.erklaerung b { color: var(--accent); }
.qfortschritt { display: flex; justify-content: space-between; align-items: center; font-weight: 700; color: var(--muted); font-size: 15px; }
.ergebnis { text-align: center; padding: 20px 16px; border-radius: 14px; border: 3px solid var(--frame); box-shadow: var(--shadow); color: #fff; }
.ergebnis.ok { background: var(--gruen); }
.ergebnis.nok { background: var(--rot); }
.ergebnis .punkte { font-family: var(--f-display); font-size: 54px; font-weight: 700; line-height: 1; }
.ergebnis b { font-family: var(--f-display); text-transform: uppercase; font-size: 24px; letter-spacing: .04em; }
.sticky-unten { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); margin-top: 18px; display: flex; justify-content: flex-end; }

/* ---------- Fortschritt ---------- */
.gesamt { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.zahl { background: var(--paper); border: 2px solid var(--frame); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.zahl b { display: block; font-family: var(--f-display); font-size: 34px; line-height: 1; }
.zahl span { font-size: 14px; color: var(--muted); font-weight: 600; }
.grp { margin-top: 22px; }
.grp-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.grp-kopf span { font-size: 14px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.doppelbalken { display: grid; gap: 4px; margin-bottom: 10px; }
.doppelbalken .balken i.geuebt { background: var(--accent); }
.doppelbalken small { font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; }
.check-tab { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.check-zeile { background: var(--paper); }
.check-zeile td { padding: 6px 8px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); vertical-align: middle; }
.check-zeile td:first-child { border-left: 6px solid var(--ampel); border-radius: 10px 0 0 10px; }
.check-zeile td:last-child { border-right: 1px solid var(--rule); border-radius: 0 10px 10px 0; }
.check-zeile a { color: inherit; text-decoration: none; font-weight: 600; line-height: 1.2; display: block; }
.check-zeile .code { color: var(--muted); display: block; font-size: 12px; }
.check-tab th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: center; padding: 0 4px; font-weight: 700; }
.check-tab th:first-child { text-align: left; }
.cb { display: grid; place-items: center; width: 52px; height: 48px; cursor: pointer; margin: 0 auto; }
.cb input { position: absolute; opacity: 0; pointer-events: none; }
.cb .kasten { width: 30px; height: 30px; border-radius: 8px; border: 2.5px solid var(--muted); display: grid; place-items: center; color: transparent; font-size: 19px; font-weight: 700; }
.cb input:checked + .kasten { background: var(--gruen); border-color: var(--gruen); color: #fff; }
.cb.geuebt input:checked + .kasten { background: var(--accent); border-color: var(--accent); }
.cb input:focus-visible + .kasten { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Bildnachweis ---------- */
.quelle { background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px; display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: start; }
.quelle .mini { width: 64px; height: 50px; background: #fff; border-radius: 6px; border: 1px solid var(--rule); display: grid; place-items: center; overflow: hidden; }
.quelle .mini img { width: 100%; height: 100%; object-fit: contain; }
.quelle .datei { font-family: var(--f-mono); font-size: 12.5px; color: var(--muted); word-break: break-all; }
.quelle .beschr { font-weight: 600; margin: 2px 0; }
.quelle ul { margin: 4px 0 0; padding-left: 18px; font-size: 14.5px; }
.quelle a { word-break: break-all; }
.quelle .verw { font-size: 13.5px; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.quelle.cc { border: 2px solid var(--gruen); background: var(--ok-bg); }
.hinweis-rechte { background: var(--danger-bg); border: 2px solid var(--danger); border-radius: 12px; padding: 14px 16px; }
.hinweis-rechte b { color: var(--danger); font-family: var(--f-display); text-transform: uppercase; font-size: 19px; letter-spacing: .03em; display: block; margin-bottom: 4px; }
.cc-box a, .hinweis-rechte a { overflow-wrap: anywhere; }
.cc-box { border: 2px solid var(--gruen); background: var(--ok-bg); border-radius: 12px; padding: 14px 16px; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: #0B0F16; display: flex; flex-direction: column; touch-action: none; }
.lightbox[hidden] { display: none; }
.lb-leiste { display: flex; align-items: center; gap: 8px; padding: calc(6px + env(safe-area-inset-top)) 8px 6px 14px; color: #fff; }
.lb-leiste .lb-titel { flex: 1; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-stage { position: relative; flex: 1; overflow: hidden; }
.lb-inner { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: #fff; will-change: transform; }
.lb-inner img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.lb-inner .pt { transform: translate(-50%, -50%) scale(calc(1 / var(--s, 1))); }
.lb-inner .pt.hl { transform: translate(-50%, -50%) scale(calc(1.25 / var(--s, 1))); }
.lb-fuss { color: #E8EDF3; padding: 8px 14px calc(10px + env(safe-area-inset-bottom)); max-height: 34vh; overflow-y: auto; background: #141A25; touch-action: pan-y; }
.lb-fuss .legende li { font-size: 15px; }
.lb-fuss .legende .nr { box-shadow: 0 0 0 1.5px #000; }
.lb-fuss .legende li.hl { background: #243553; }
.lb-fuss .tipp { font-size: 13px; color: #9AA7B6; }
.lb-btn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; font-size: 24px; display: grid; place-items: center; cursor: pointer; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; }
.lb-nav.links { left: 8px; }
.lb-nav.rechts { right: 8px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); z-index: 60; background: var(--tiefblau); color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); display: flex; gap: 12px; align-items: center; max-width: calc(100% - 32px); font-size: 15px; }
.toast button { background: var(--rot); color: #fff; border: 0; border-radius: 8px; padding: 8px 12px; font-weight: 700; cursor: pointer; }

.druck-only { display: none; }

@media (min-width: 700px) {
  h1 { font-size: 42px; }
  .sb-kopf h1 { font-size: 46px; }
  .hero h1 { font-size: 52px; }
  .hero img { height: 250px; }
  .michael { grid-template-columns: 120px 1fr; }
  .michael img { width: 120px; }
  .tabbar { max-width: 640px; left: 50%; transform: translateX(-50%); border: 1px solid var(--rule); border-bottom: 0; border-radius: 14px 14px 0 0; }
}

@media (hover: hover) {
  .kachel:hover, .eintrag:hover, .blaettern a:hover { border-color: var(--accent); }
}

/* ---------- Druck (Checkliste) ---------- */
@media print {
  @page { size: A4 portrait; margin: 12mm; }
  :root { --ink: #000; }
  body { background: #fff; color: #000; padding: 0; font-size: 11pt; }
  .topbar, .tabbar, .toast, .lightbox, .bildschirm-only, main > :not(.druck-only) { display: none !important; }
  main { padding: 0; max-width: none; }
  .druck-only { display: block !important; }
  .druck h1 { font-size: 22pt; color: #242E5B; }
  .druck .kopfzeile { display: flex; justify-content: space-between; align-items: end; border-bottom: 3px solid #D02627; padding-bottom: 6px; margin-bottom: 8px; }
  .druck .azubi { display: flex; gap: 24px; margin: 8px 0 12px; font-size: 11pt; }
  .druck .azubi span { flex: 1; border-bottom: 1px solid #000; padding-bottom: 14px; }
  .druck table { width: 100%; border-collapse: collapse; font-size: 10pt; }
  .druck th, .druck td { border: 1px solid #555; padding: 4px 6px; text-align: left; }
  .druck thead th { background: #242E5B !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .druck tr.grp-z td { background: #E6ECF6 !important; font-weight: 700; font-family: var(--f-display); text-transform: uppercase; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .druck td.leer { width: 25mm; height: 7.5mm; }
  .druck tr { break-inside: avoid; }
  .druck .ampel-dot { -webkit-print-color-adjust: exact; print-color-adjust: exact; border-color: #000; }
  .druck .legende-druck { margin-top: 8px; font-size: 9pt; }
}

/* ---------- Schulung: Zertifikatsweg, Anmeldung, Profil, Verwaltung ---------- */
.klein { font-size: 13.5px; }
.weg { margin-top: 20px; }
.weg h2 { font-size: 22px; margin-bottom: 10px; }
.weg ol { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 8px; }
.weg li a { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: center; min-height: 52px; padding: 8px 10px; border-radius: 10px; background: var(--bg); color: inherit; text-decoration: none; border: 1px solid var(--rule); }
.weg li b { display: block; font-size: 16.5px; }
.weg li small { display: block; color: var(--muted); font-size: 14px; }
.weg li .balken { margin-top: 5px; }
.schritt-nr { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 19px var(--f-display); background: var(--paper); border: 2.5px solid var(--muted); color: var(--muted); }
.weg li.ok .schritt-nr { background: var(--gruen); border-color: var(--gruen); color: #fff; }
.weg li.ok a { border-color: var(--gruen); background: var(--ok-bg); }
.weg .btn { margin-top: 10px; width: 100%; }
.weg.fertig { border-color: var(--gruen); }

.fertig-bereich { background: var(--paper); border: 2px solid var(--frame); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.fertig-bereich p { margin: 0 0 10px; }
.toggle.gross { min-height: 64px; font-size: 17.5px; border-width: 2.5px; }
.toggle.gross .kasten { width: 34px; height: 34px; font-size: 22px; }
.status { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; background: var(--bg); border: 1px dashed var(--rule); border-radius: 10px; font-weight: 600; }
.status .kasten { flex: none; width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--rule); display: grid; place-items: center; color: transparent; font-size: 15px; }
.status.an { border-style: solid; border-color: var(--gruen); background: var(--ok-bg); }
.status.an .kasten { background: var(--gruen); border-color: var(--gruen); color: #fff; }

.haken-mini.gelesen.an { background: var(--accent); border-color: var(--accent); }
.st-icon { display: grid; place-items: center; width: 28px; height: 28px; margin: 0 auto; border-radius: 7px; border: 2px solid var(--rule); color: #fff; font-weight: 700; }
.st-icon.an { background: var(--gruen); border-color: var(--gruen); }
.gesamt.drei { grid-template-columns: repeat(3, 1fr); margin-top: 16px; }
.gesamt.drei .zahl b { font-size: 28px; }
.zahl b small { font-size: 16px; }

.modus.pruefung { border-color: var(--rot); }
.modus.pruefung b { color: var(--rot); }
.modus.zu { opacity: .7; border-style: dashed; }
.modus.zu b { color: var(--muted); }
.pruef-hinweis { padding: 12px 14px; border-radius: 10px; background: var(--danger-bg); border: 2px solid var(--rot); font-size: 15.5px; }
.pruef-hinweis b { display: block; font-family: var(--f-display); text-transform: uppercase; font-size: 19px; color: var(--danger); letter-spacing: .03em; }
.versuche { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.versuche li { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 8px; background: var(--paper); border: 1px solid var(--rule); border-left: 6px solid var(--rot); font-size: 15px; }
.versuche li.ok { border-left-color: var(--gruen); }
.versuche li span:last-child { text-align: right; color: var(--muted); }

.einstieg.blau { background: var(--blau); }
.formular { display: grid; gap: 12px; }
.formular label { display: grid; gap: 4px; font-weight: 600; font-size: 15px; }
.formular label.zeile { display: flex; align-items: center; gap: 10px; font-weight: 400; }
.formular label.zeile input { width: 22px; height: 22px; }
.formular input:not([type=checkbox]), .login-form input { width: 100%; min-height: 50px; font-size: 17px; padding: 10px 14px; border: 2px solid var(--rule); border-radius: 10px; background: var(--paper); color: var(--ink); outline: none; }
.formular input:focus, .login-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.eingabe-zeile { display: flex; gap: 8px; }
.eingabe-zeile input { flex: 1; min-width: 0; }
.btn.klein { min-height: 38px; padding: 6px 12px; font-size: 14.5px; }
.pw-kasten { margin-top: 12px; display: grid; gap: 4px; padding: 12px 14px; border-radius: 10px; background: var(--warn-bg); border: 2px solid var(--warn-rule); }
.pw-kasten .code.gross { font-size: 24px; letter-spacing: .06em; user-select: all; color: var(--ink); }
.pw-kasten small { color: var(--muted); }
.nutzer { display: grid; gap: 7px; padding: 12px 14px; background: var(--paper); border: 1px solid var(--rule); border-left: 7px solid var(--accent); border-radius: 10px; text-decoration: none; color: inherit; }
.nutzer.gesperrt { opacity: .6; border-left-color: var(--muted); }
.nutzer-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nutzer-kopf b { font-size: 18px; }
.nutzer-kopf .code { color: var(--muted); }
.nutzer-daten { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; color: var(--muted); }
.chip-klein { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; color: #fff; white-space: nowrap; }
.chip-klein.gruen { background: var(--gruen); }
.chip-klein.rot { background: var(--rot); }
.stand-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.stand-liste li { padding: 10px 12px 10px 40px; position: relative; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; }
.stand-liste li::before { content: "○"; position: absolute; left: 14px; color: var(--muted); font-weight: 700; }
.stand-liste li.ok::before { content: "✓"; color: var(--gruen); }
.zert-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; }
.login-fehler { color: var(--danger); background: var(--danger-bg); border: 1.5px solid var(--danger); border-radius: 10px; padding: 10px 12px; font-weight: 600; margin: 0; }

/* Anmeldeseite */
.login-seite { padding-bottom: 0; }
.login { max-width: 480px; }
.login .hero h1 { font-size: 34px; }
.login .hero img { height: 170px; }
.login-form { margin-top: 18px; display: grid; gap: 14px; }
.login-form h2 { font-size: 24px; }
.login-form label { display: grid; gap: 4px; font-weight: 600; font-size: 15px; }
.login-form .btn { width: 100%; }
.login-form p { margin: 0; }
.login-hinweis { margin-top: 16px; text-align: center; }
/* Checkliste mit 4 Spalten passt auch auf 360 px breite Handys */
.check-tab td { padding: 6px 4px; }
.check-tab td:first-child { padding-left: 8px; }
.check-tab th { font-size: 11px; padding: 0 2px; }
.check-tab .cb { width: 40px; height: 44px; }
.check-tab .cb .kasten { width: 28px; height: 28px; }
.check-tab .st-icon { width: 26px; height: 26px; }
/* Bildnachweis: lange URLs/Dateinamen dürfen umbrechen */
.quelle > div { min-width: 0; overflow-wrap: anywhere; }
/* Listeneinträge: lange Werkzeugnamen trennen, drei Status-Häkchen kompakt */
.eintrag { grid-template-columns: 76px minmax(0, 1fr) auto; gap: 10px; }
.eintrag .vorschau { width: 76px; height: 58px; }
.eintrag .name { hyphens: auto; overflow-wrap: anywhere; }
.eintrag .haken { gap: 3px; }
.eintrag .haken-mini { width: 20px; height: 20px; font-size: 11.5px; border-radius: 5px; }

/* Zugangskarten (nur im Druck) */
@media print {
  .zugangskarten { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8mm; }
  .zugangskarte { border: 1.5px dashed #555; border-radius: 3mm; padding: 5mm; break-inside: avoid; font-size: 11pt; }
  .zugangskarte b { display: block; font-family: var(--f-display); text-transform: uppercase; font-size: 14pt; color: #242E5B; }
  .zugangskarte > span { display: block; font-weight: 700; margin-bottom: 2mm; }
  .zugangskarte dl { display: grid; grid-template-columns: auto 1fr; gap: 1mm 4mm; margin: 0 0 2mm; }
  .zugangskarte dt { color: #555; }
  .zugangskarte dd { margin: 0; font-weight: 700; word-break: break-all; }
  .zugangskarte small { color: #555; font-size: 8.5pt; }
  .zugangskarte .ds { margin: 2.5mm 0 0; padding-top: 2mm; border-top: 1px solid #bbb; font-size: 7.5pt; line-height: 1.35; color: #333; }
  .zugangskarte .ds b { display: inline; font-family: inherit; text-transform: none; font-size: inherit; color: #16212A; }
}
