/* Lernportal PG Sicherheitsakademie – Fachspezifisches Deutsch für das Sicherheitsgewerbe */
:root {
  --navy: #0B2545; --navy2: #13315C; --navy3: #1D3F6E;
  --turq: #14A3A8; --turq-d: #0E7F83; --turq-l: #E3F5F5;
  --orange: #F28C28; --orange-d: #D9731A; --orange-l: #FDF0E2;
  --bg: #F3F5F8; --card: #FFFFFF; --ink: #1E2530; --muted: #5B6675; --line: #DDE3EA;
  --ok: #1E8E5A; --ok-l: #E5F5EC; --mid: #B7791F; --mid-l: #FDF5E3; --no: #C0392B; --no-l: #FCEAE8;
  --der: #2563EB; --die: #D9465F; --das: #1F9D55; --verb: #6B7280;
  --s: #2563EB; --v: #F28C28; --x: #64748B; --e: #8B5CF6;
  --radius: 14px; --shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 14px rgba(15,23,42,.06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-ar: "Segoe UI", "Noto Naskh Arabic", "Arabic Typesetting", Tahoma, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--turq-d); }
strong { font-weight: 650; }
.app { max-width: 1040px; margin: 0 auto; padding: 20px 16px 120px; }

/* ---------- Kopfzeile ---------- */
.topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.topbar-in { max-width: 1040px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; min-width: 0; flex: 1; }
.brand img { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; flex: none; }
.brand-txt { min-width: 0; }
.brand-txt b { display: block; font-size: 15px; font-weight: 650; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-txt span { display: block; font-size: 12px; color: #9FB3CC; letter-spacing: .02em; }
.lang-sel { background: var(--navy2); color: #fff; border: 1px solid #2D4F7E; border-radius: 10px; padding: 7px 8px; font-size: 14px; max-width: 150px; }
.icon-btn { background: transparent; border: 1px solid #2D4F7E; color: #fff; border-radius: 10px; padding: 7px 10px; font-size: 14px; cursor: pointer; }
.icon-btn:hover { background: var(--navy2); }

/* ---------- Bausteine ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.stack > * + * { margin-top: 14px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 22px; font-weight: 650; }
h3 { font-size: 17px; font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.kicker { font-size: 12.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--turq-d); }
.pill { display: inline-block; font-size: 12px; font-weight: 650; padding: 2px 9px; border-radius: 99px; background: var(--turq-l); color: var(--turq-d); }
.pill.lv { background: #E8EDF5; color: var(--navy2); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 11px; padding: 11px 18px; font-weight: 600; cursor: pointer; background: var(--turq); color: #fff; text-decoration: none; min-height: 44px; transition: background .15s, transform .05s; }
.btn:hover { background: var(--turq-d); }
.btn:active { transform: translateY(1px); }
.btn.cta { background: var(--orange); }
.btn.cta:hover { background: var(--orange-d); }
.btn.ghost { background: #fff; color: var(--navy2); border: 1px solid var(--line); }
.btn.ghost:hover { background: #F6F8FB; }
.btn.navy { background: var(--navy2); }
.btn.navy:hover { background: var(--navy); }
.btn.sm { padding: 6px 12px; min-height: 34px; font-size: 14px; border-radius: 9px; }
.btn[disabled] { opacity: .45; cursor: default; }
.btn .ic { font-size: 13px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.field input { width: 100%; padding: 11px 12px; border: 1px solid #C9D2DD; border-radius: 10px; background: #fff; font-size: 16px; }
.field input:focus, .lang-sel:focus { outline: 2px solid var(--turq); outline-offset: 1px; }
.msg { padding: 10px 14px; border-radius: 10px; font-size: 15px; }
.msg.err { background: var(--no-l); color: var(--no); }
.msg.ok { background: var(--ok-l); color: var(--ok); }
.msg.info { background: var(--turq-l); color: #0B5D60; }
.hidden { display: none !important; }

/* Übersetzung */
.tr { font-family: var(--font-ar); color: #0B5D60; background: #EEF8F8; border-left: 3px solid var(--turq); border-radius: 8px; padding: 6px 10px; margin-top: 6px; font-size: 16px; line-height: 1.7; }
.tr[dir=rtl] { direction: rtl; text-align: right; border-left: 0; border-right: 3px solid var(--turq); }
.tr.inline { display: block; }
[dir=rtl] .tr, .tr[dir=rtl] { unicode-bidi: plaintext; }

/* ---------- Anmeldung ---------- */
.login-wrap { display: grid; gap: 18px; grid-template-columns: 1.1fr 1fr; align-items: stretch; }
.login-hero { border-radius: var(--radius); overflow: hidden; position: relative; min-height: 360px; background: var(--navy); color: #fff; }
.login-hero img { width: 100%; height: 100%; object-fit: cover; opacity: .55; position: absolute; inset: 0; }
.login-hero .in { position: relative; padding: 28px; display: flex; flex-direction: column; height: 100%; justify-content: flex-end; }
.login-hero h1 { font-size: 30px; }
.login-hero ul { margin: 12px 0 0; padding-left: 20px; }
.tabs { display: flex; gap: 6px; background: #EDF1F5; padding: 4px; border-radius: 12px; margin-bottom: 16px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 9px; font-weight: 600; cursor: pointer; color: var(--muted); }
.tabs button.on { background: #fff; color: var(--navy); box-shadow: var(--shadow); }

/* ---------- Übersicht ---------- */
.hello { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.continue { background: linear-gradient(120deg, var(--navy) 0%, var(--navy3) 100%); color: #fff; display: grid; grid-template-columns: 1fr 220px; gap: 0; padding: 0; overflow: hidden; }
.continue .in { padding: 22px; }
.continue img { width: 100%; height: 100%; object-fit: cover; }
.continue .kicker { color: #7FE3E6; }
.bar { height: 8px; background: #E4E9EF; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--turq); border-radius: 99px; }
.continue .bar { background: rgba(255,255,255,.18); }
.parts { display: grid; gap: 10px; }
.part { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.part .num { width: 40px; height: 40px; border-radius: 10px; background: var(--turq-l); color: var(--turq-d); font-weight: 700; display: grid; place-items: center; flex: none; }
.part.locked { opacity: .55; }
.part.locked .num { background: #EEF1F5; color: var(--muted); }
.part:not(.locked):hover { border-color: var(--turq); }
.chapters { margin: 8px 0 0 54px; display: grid; gap: 6px; }
.chapter { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #F7FAFC; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 15px; }
.chapter:hover { border-color: var(--turq); background: #fff; }
.chapter .st { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #C5CED9; flex: none; display: grid; place-items: center; font-size: 12px; color: #fff; }
.chapter .st.done { background: var(--ok); border-color: var(--ok); }
.chapter .st.half { border-color: var(--turq); background: conic-gradient(var(--turq) 0 50%, transparent 50% 100%); }
.tile { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); }
.tile:hover { outline: 2px solid var(--turq); }
.tile .big { font-size: 30px; font-weight: 700; color: var(--navy2); }
.lic { font-size: 14px; color: var(--muted); }

/* ---------- Lektion ---------- */
.lesson-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.lesson-head .t { flex: 1; min-width: 0; }
.lesson-head .t b { display: block; font-size: 14px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.path { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 16px; }
.path span { font-size: 11.5px; font-weight: 650; letter-spacing: .06em; padding: 4px 10px; border-radius: 99px; background: #E6EBF1; color: #7A8796; }
.path span.on { background: var(--orange); color: #fff; }
.screen { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.screen-title { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.type-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--turq-d); text-transform: uppercase; margin-bottom: 4px; }
.photo { position: relative; border-radius: var(--radius); overflow: hidden; background: #1B2635; aspect-ratio: 16/9; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.subs { position: absolute; left: 10px; right: 10px; bottom: 10px; display: grid; gap: 6px; }
.sub { background: rgba(11,18,32,.84); color: #fff; border-left: 4px solid var(--turq); border-radius: 8px; padding: 8px 12px; display: flex; gap: 10px; align-items: center; }
.sub .who { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; color: #7FE3E6; text-transform: uppercase; }
.sub .txt { font-size: 16px; }
.sub .tr { background: rgba(255,255,255,.08); color: #CFF3F4; border-color: var(--turq); }
.play { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--orange); color: #fff; cursor: pointer; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.play:hover { background: var(--orange-d); }
.play svg { width: 16px; height: 16px; fill: currentColor; }
.play.playing { background: var(--turq); animation: pulse 1.2s infinite; }
.play.sm { width: 34px; height: 34px; }
.play.sm svg { width: 13px; height: 13px; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(20,163,168,.45); } 50% { box-shadow: 0 0 0 8px rgba(20,163,168,0); } }
.btn-audio { gap: 10px; }
.btn-audio svg { width: 14px; height: 14px; fill: currentColor; }
.btn-audio.playing { background: var(--navy); }
.box { border-radius: 12px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); }
.box.q { border-left: 4px solid var(--orange); }
.box.rule { background: #F0F7FF; border-color: #CFE0F5; }
.box.why { background: var(--orange-l); border-color: #F6D8B5; }
.box.note { background: var(--turq-l); border-color: #BFE6E7; }
.box .lbl { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.reveal-body { margin-top: 10px; padding: 12px 14px; border-radius: 10px; background: var(--ok-l); border: 1px solid #BFE3CD; }
.tips { display: grid; gap: 8px; margin-top: 16px; }
details.tip { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; }
details.tip summary { cursor: pointer; padding: 12px 0; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
details.tip summary::-webkit-details-marker { display: none; }
details.tip summary::before { content: "+"; width: 22px; height: 22px; border-radius: 6px; background: #EEF2F6; display: grid; place-items: center; font-weight: 700; color: var(--muted); }
details.tip[open] summary::before { content: "–"; }
details.tip > div { padding: 0 0 14px; }
.lesson-nav { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); z-index: 15; backdrop-filter: blur(6px); }
.lesson-nav .in { max-width: 1040px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 10px; align-items: center; }
.lesson-nav .count { font-size: 14px; color: var(--muted); flex: 1; text-align: center; }

/* Abschnitt */
.section-hero { background: linear-gradient(120deg, var(--navy) 0%, var(--navy3) 100%); color: #fff; border-radius: var(--radius); padding: 30px 26px; }
.section-hero .num { font-size: 13px; font-weight: 700; letter-spacing: .12em; color: #7FE3E6; }
.section-hero h1 { font-size: 32px; margin: 6px 0 8px; }
.section-hero .tr { background: rgba(255,255,255,.08); color: #CFF3F4; }
.goals { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.goals li { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.goals li::before { content: ""; flex: none; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%; background: var(--turq) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='white' stroke-width='2.2' d='M4 8.5l2.6 2.5L12 5.5'/%3E%3C/svg%3E") center/16px no-repeat; }
.goals li > div { flex: 1; }

/* Tabellen als Karten */
.rows { display: grid; gap: 10px; }
.trow { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; grid-template-columns: 170px 1fr 1fr; align-items: start; }
.trow.c2 { grid-template-columns: 1fr 1fr; }
.trow .cl { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.trow .c0 { font-weight: 650; color: var(--navy2); }
.cell-good { background: var(--ok-l); border-radius: 10px; padding: 8px 10px; display: flex; gap: 10px; align-items: center; }
.cell-bad { background: var(--no-l); border-radius: 10px; padding: 8px 10px; color: #8A2A20; }
.cell-hidden { border: 2px dashed #B9C6D3; border-radius: 10px; padding: 8px 10px; display: flex; align-items: center; justify-content: center; min-height: 48px; }

/* Auswahl */
.opts { display: grid; gap: 10px; }
.opt { text-align: left; border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 14px 16px; cursor: pointer; display: flex; gap: 12px; align-items: flex-start; font-size: 17px; }
.opt:hover { border-color: var(--turq); }
.opt .k { flex: none; width: 30px; height: 30px; border-radius: 8px; background: #EEF2F6; display: grid; place-items: center; font-weight: 700; color: var(--navy2); }
.opt.ok { border-color: var(--ok); background: var(--ok-l); }
.opt.mid { border-color: var(--mid); background: var(--mid-l); }
.opt.no { border-color: var(--no); background: var(--no-l); }
.opt .fb { margin-top: 6px; font-size: 15px; }
.opt.ok .fb { color: var(--ok); } .opt.mid .fb { color: var(--mid); } .opt.no .fb { color: var(--no); }

/* Hören */
.dialog { display: grid; gap: 8px; }
.line { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.line .who { font-weight: 650; color: var(--navy2); font-size: 15px; }
.qa { display: grid; gap: 10px; }
.qa .item { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.qa .item .a { margin-top: 8px; padding: 8px 12px; border-radius: 8px; background: var(--ok-l); }

/* Redemittel */
.phr { border-top: 4px solid var(--turq); }
.phr:nth-child(3n+2) { border-top-color: var(--navy2); }
.phr:nth-child(3n) { border-top-color: var(--orange); }
.phr ul { margin: 8px 0 0; padding-left: 20px; }
.phr li { margin: 4px 0; }

/* Grammatik */
.ex { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.ex .lab { width: 90px; font-size: 13px; font-weight: 650; color: var(--muted); }
.toks { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; align-items: center; }
.tok { padding: 5px 10px; border-radius: 8px; font-weight: 600; border: 2px solid; }
.tok.s { color: var(--s); border-color: var(--s); background: #EEF4FF; }
.tok.v { color: #fff; border-color: var(--v); background: var(--v); }
.tok.x { color: #334155; border-color: #CBD5E1; background: #F8FAFC; }
.tok.e { color: #fff; border-color: var(--e); background: var(--e); }
.tok.p { border: 0; padding: 0 2px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; }

/* Satzbau */
.build { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.answer-line { min-height: 54px; border: 2px dashed #B9C6D3; border-radius: 10px; padding: 8px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.answer-line.ok { border-style: solid; border-color: var(--ok); background: var(--ok-l); }
.answer-line.no { border-style: solid; border-color: var(--no); background: var(--no-l); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid #C9D2DD; background: #F7F9FB; border-radius: 9px; padding: 7px 12px; cursor: pointer; font-weight: 600; font-size: 16px; }
.chip:hover { border-color: var(--turq); }
.chip.used { visibility: hidden; }

/* Sprechen */
.help-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.help-chips span { background: #EEF2F6; border-radius: 8px; padding: 5px 10px; font-size: 15px; }
.rec { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rec .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--no); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.models { display: grid; gap: 10px; }
.model { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--turq); border-radius: 12px; padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; }
.model.B1 { border-left-color: var(--navy2); } .model.B2 { border-left-color: var(--orange); }
.model .lv { font-weight: 700; font-size: 13px; color: var(--muted); width: 30px; flex: none; padding-top: 2px; }

/* Merke */
.merke { display: grid; gap: 12px; counter-reset: m; }
.merke > div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 16px 62px; position: relative; font-size: 18px; }
.merke > div::before { counter-increment: m; content: counter(m); position: absolute; left: 16px; top: 14px; width: 32px; height: 32px; border-radius: 50%; background: var(--orange); color: #fff; font-weight: 700; display: grid; place-items: center; }

/* Abschluss */
.done-hero { text-align: center; padding: 34px 20px; }
.done-hero .big { font-size: 54px; line-height: 1; }

/* ---------- Karteikarten ---------- */
.flash-wrap { max-width: 640px; margin: 0 auto; }
.flash { perspective: 1200px; cursor: pointer; }
.flash-in { display: grid; min-height: 300px; transition: transform .45s; transform-style: preserve-3d; }
.flash.flipped .flash-in { transform: rotateY(180deg); }
.face { grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 26px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 10px; border-top: 6px solid var(--turq); }
.face.back { transform: rotateY(180deg); border-top-color: var(--orange); align-items: stretch; text-align: left; justify-content: flex-start; }
.term { font-size: 34px; font-weight: 700; }
.art { font-weight: 700; }
.art.der { color: var(--der); } .art.die { color: var(--die); } .art.das { color: var(--das); } .art.other { color: var(--verb); font-size: 15px; display: block; }
.boxes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.boxes div { background: #fff; border: 1px solid var(--line); border-radius: 10px; text-align: center; padding: 8px 4px; font-size: 13px; color: var(--muted); }
.boxes b { display: block; font-size: 20px; color: var(--navy2); }
.judge { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.judge .no { background: var(--no); } .judge .no:hover { background: #A33024; }
.judge .yes { background: var(--ok); } .judge .yes:hover { background: #17744A; }

/* Druckansicht Karteikarten */
.print-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px dashed #999; }
.print-cards > div { border: 1px dashed #999; padding: 14px; min-height: 120px; }
.print-cards .pf { display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; text-align: center; }
/* ---------- Begleitbuch ---------- */
.book-bar { position: sticky; top: 62px; z-index: 5; background: var(--bg); padding: 6px 0; }
.book-cover { background: linear-gradient(135deg, var(--navy), var(--navy3)); color: #fff; border-radius: var(--radius); padding: 28px 26px; }
.book-cover h1 { margin: 6px 0 4px; font-size: 34px; }
.book-cover p.de { margin: 0 0 12px; font-weight: 600; color: #fff; }
.book-toc { display: grid; gap: 10px; }
.book-toc-item { display: flex; gap: 14px; align-items: flex-start; text-decoration: none; color: var(--ink); }
.book-toc-item:hover { outline: 2px solid var(--turq); }
.book-toc-item .num { flex: none; min-width: 42px; height: 42px; padding: 0 6px; border-radius: 11px; background: var(--navy2); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.book { display: flex; flex-direction: column; gap: 22px; }
.book-part { display: flex; flex-direction: column; gap: 18px; }
.book-part-head { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 24px 22px; }
.book-part-head h1 { margin: 4px 0 6px; font-size: 30px; }
.book-part-head p.de { color: #fff; margin: 0; }
.book-part-head .tr { background: rgba(255,255,255,.08); color: #CFF3F4; }
.book-ch { display: flex; flex-direction: column; gap: 14px; }
.book-ch-title { margin: 14px 0 0; padding-bottom: 8px; border-bottom: 3px solid var(--orange); font-size: 24px; line-height: 1.25; }
.bk { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.bk-head h3 { margin: 2px 0 0; font-size: 19px; }
.bk-section { background: var(--turq-l); border-color: transparent; }
.bk-lead { font-size: 18px; margin: 0; font-weight: 600; color: var(--navy2); }
.bk-ul { margin: 0; padding-left: 22px; } .bk-ul li { margin: 3px 0; }
.bk-sol { border-left: 4px solid var(--ok); background: var(--ok-l); }
.bk-tip { font-size: 15px; }
.bk-table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.bk-table th { text-align: left; background: #EEF2F7; color: var(--navy2); font-size: 13px; padding: 7px 9px; }
.bk-table td { border-top: 1px solid var(--line); padding: 7px 9px; vertical-align: top; }
.bk-opts { display: flex; flex-direction: column; gap: 8px; }
.bk-opt { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
.bk-opt.ok { border-color: var(--ok); background: var(--ok-l); }
.bk-words { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.bk-word { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.bk h4 { margin: 0 0 6px; }
.bk .qa .a { margin-top: 6px; padding-left: 10px; border-left: 3px solid var(--ok); }
.glossary { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 18px 14px; }
.gl-letter { font-size: 22px; font-weight: 800; color: var(--orange-d); margin: 14px 0 4px; }
.gl-row { display: grid; grid-template-columns: minmax(170px, 34%) 1fr; gap: 14px; padding: 8px 0; border-top: 1px solid var(--line); }
.gl-term .art { margin-right: 4px; }
.gl-ex { color: var(--navy2); margin-top: 4px; font-style: italic; }
@media (max-width: 640px) { .gl-row { grid-template-columns: 1fr; gap: 4px; } .book-bar { top: 56px; } .bk-table { font-size: 14px; } }

@media print {
  .topbar, .lesson-nav, .demo-banner, .no-print { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .app { max-width: none; padding: 0; }
  .print-cards > div { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .book-part { break-before: page; }
  .book-part:first-child { break-before: auto; }
  .book-ch-title { break-after: avoid; }
  .bk, .gl-row, .bk-word, .bk-opt { break-inside: avoid; box-shadow: none; }
  .bk { padding: 10px 12px; }
}

/* ---------- Prüfung ---------- */
.exq { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.exq .head { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.exq .text { font-size: 17px; margin-bottom: 12px; }
.ans { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; cursor: pointer; background: #fff; }
.ans input { width: 20px; height: 20px; margin-top: 3px; flex: none; accent-color: var(--turq); }
.ans:hover { border-color: var(--turq); }
.ans.r-ok { border-color: var(--ok); background: var(--ok-l); }
.ans.r-no { border-color: var(--no); background: var(--no-l); }
.ans.r-miss { border-color: var(--ok); border-style: dashed; }
/* Sachkunde-App: persönlicher Code auf der Startseite */
.app-card { border-left: 4px solid var(--orange); }
.app-code { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; background: #F0F3F7; border-radius: 12px; padding: 12px 14px; }
.app-code b { font: 700 22px/1.2 Consolas, "Courier New", monospace; letter-spacing: .06em; color: var(--navy); }
/* Prüfungssimulation: Leiste mit Fortschritt und Restzeit, Punkte je Sachgebiet */
.sim-bar { position: sticky; top: calc(var(--topbar-h, 64px) + 8px); z-index: 5; display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: center; padding: 12px 16px; font-weight: 650; }
.sgrows { display: grid; gap: 10px; margin-top: 12px; }
.sgrow { display: grid; grid-template-columns: minmax(0, 1fr) 120px 64px; gap: 12px; align-items: center; }
.sgrow b { text-align: right; font-variant-numeric: tabular-nums; }
.sgbar { height: 10px; border-radius: 6px; background: var(--line); overflow: hidden; }
.sgbar i { display: block; height: 100%; }
@media (max-width: 560px) { .sgrow { grid-template-columns: minmax(0, 1fr) 64px; } .sgbar { grid-column: 1 / -1; grid-row: 2; } }
.score { text-align: center; padding: 26px; }
.score .pct { font-size: 52px; font-weight: 800; color: var(--navy2); line-height: 1.1; }
.score.pass .pct { color: var(--ok); } .score.fail .pct { color: var(--no); }

/* Hinweis Testversion */
.demo-banner { position: fixed; right: 12px; bottom: 76px; background: var(--navy); color: #fff; font-size: 12.5px; padding: 6px 12px; border-radius: 99px; opacity: .88; z-index: 30; pointer-events: none; }
.demo-banner:empty { display: none; }

/* ---------- Rechts-nach-links (Arabisch als Oberfläche) ---------- */
html[dir=rtl] body { font-family: var(--font-ar); }
html[dir=rtl] .opt, html[dir=rtl] .face.back { text-align: right; }
html[dir=rtl] .chapters { margin: 8px 54px 0 0; }
html[dir=rtl] .merke > div { padding: 16px 62px 16px 18px; }
html[dir=rtl] .merke > div::before { left: auto; right: 16px; }
html[dir=rtl] .sub { border-left: 0; border-right: 4px solid var(--turq); }
html[dir=rtl] .goals li::before { transform: scaleX(-1); }
/* Deutsche Lerninhalte bleiben immer links-nach-rechts */
.de { direction: ltr; text-align: left; unicode-bidi: isolate; }

/* ---------- Handy ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .app { padding: 14px 12px 120px; }
  h1 { font-size: 24px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { min-height: 220px; }
  .continue { grid-template-columns: 1fr; }
  .continue img { height: 140px; order: -1; }
  .trow, .trow.c2 { grid-template-columns: 1fr; }
  .line { grid-template-columns: 1fr; gap: 2px; }
  .brand-txt span { display: none; }
  .brand img { width: 34px; height: 34px; }
  .lang-sel { max-width: 110px; }
  .section-hero h1 { font-size: 26px; }
  .chapters { margin-left: 0; }
  .ex .lab { width: 100%; }
  .term { font-size: 28px; }
  .demo-banner { bottom: 70px; right: 8px; font-size: 11.5px; }
}
.brand-txt .short { display: none; }
@media (max-width: 760px) {
  .brand-txt .long { display: none; }
  .brand-txt .short { display: block; }
  .demo-banner { display: none; }
}

/* ---------- weitere Folientypen ---------- */
.part-wrap > summary { list-style: none; cursor: pointer; }
.part-wrap > summary::-webkit-details-marker { display: none; }
.part-wrap .chapters { margin-bottom: 8px; }
.title-hero { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--navy); color: #fff; min-height: 340px; display: flex; align-items: flex-end; }
.title-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .45; }
.title-hero .in { position: relative; padding: 28px; }
.title-hero h1 { font-size: 36px; margin: 6px 0; }
.title-hero p { color: #DCE6F2; max-width: 640px; }
.wcard { padding: 14px 16px; }
.wterm { font-size: 20px; font-weight: 650; }
.word-big .term { font-size: 30px; font-weight: 700; }
.stress { text-decoration: none; color: var(--orange); border-bottom: 3px solid var(--orange); }
.hs-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 16px; align-items: start; }
.hs { position: relative; border-radius: var(--radius); overflow: hidden; justify-self: center; max-width: 100%; }
.hs img { max-height: 640px; width: auto; max-width: 100%; }
.spot { position: absolute; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; background: var(--orange); color: #fff; font-weight: 700; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.spot.on { background: var(--turq); transform: translate(-50%, -50%) scale(1.15); }
.spot.static { position: static; transform: none; display: inline-grid; place-items: center; flex: none; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.steps .n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--navy2); color: #fff; font-weight: 700; display: grid; place-items: center; }
.pill.stage { background: #B8322A; color: #fff; }
.err-line { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.err-line .err-fix { width: 100%; margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--ok-l); }
.chk { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.chk input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--turq); flex: none; }
.tr-inline { font-family: var(--font-ar); color: #0B5D60; }
.model-doc { border-left: 5px solid var(--navy2); line-height: 1.75; }
.hl-v { background: #FDE2C4; color: #8A4B0B; padding: 0 3px; border-radius: 4px; }
.hl-p { border-bottom: 3px solid var(--turq); }
.quick { border-top: 5px solid var(--orange); }
textarea.write { width: 100%; padding: 12px; border: 1px solid #C9D2DD; border-radius: 10px; font: inherit; resize: vertical; background: #fff; }
.model.hidden, .box.hidden { display: none; }
@media (max-width: 760px) {
  .hs-wrap { grid-template-columns: 1fr; }
  .hs img { max-height: 70vh; }
  .title-hero h1 { font-size: 28px; }
  .err-line .who { width: 100% !important; }
}

/* ---------- Fußzeile und Rechtstexte ---------- */
.site-foot { max-width: 1040px; margin: 0 auto; padding: 18px 16px 90px; display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; font-size: 13.5px; color: var(--muted); border-top: 1px solid var(--line); }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--turq-d); text-decoration: underline; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 12px; font-size: 14px; line-height: 1.45; cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--turq-d); }
.legal { max-width: 820px; margin: 0 auto; }
.legal h1 { font-size: 28px; line-height: 1.2; margin: 4px 0 6px; color: var(--navy); }
.legal h2 { font-size: 19px; margin: 26px 0 6px; color: var(--navy); }
.legal h3 { font-size: 16.5px; margin: 18px 0 4px; }
.legal p, .legal li { font-size: 16px; }
.legal ul { padding-left: 22px; }
.legal .stand { color: var(--muted); font-size: 14px; }
.legal .box { background: var(--turq-l); border-radius: 10px; padding: 12px 16px; }
.legal .form { border: 1px dashed #9AA8B8; border-radius: 10px; padding: 14px 18px; background: #fff; }
.legal nav.toc { font-size: 15px; }
/* ---------------------------------------------------------------- Sachkunde § 34a */
.course-tabs { max-width: 480px; margin-bottom: 4px; }
.course-tabs a { flex: 1; text-align: center; padding: 9px; border-radius: 9px; font-weight: 600; color: var(--muted); text-decoration: none; }
.course-tabs a.on { background: #fff; color: var(--navy); box-shadow: var(--shadow); }
.lesson-head .read-btn { margin-left: auto; }
.trow.cn { grid-template-columns: repeat(var(--n), 1fr); }
/* Farbcode des Lernsystems: Blau = Recht, Grün = zulässig, Rot = verboten, Orange = Prüfungsfalle, Türkis = Merksatz, Violett = Fachsprache */
.box.tone-recht { background: #F0F7FF; border-color: #CFE0F5; border-left: 4px solid #2563EB; }
.box.tone-ok { background: var(--ok-l); border-color: #BFE3CF; border-left: 4px solid var(--ok); }
.box.tone-no { background: var(--no-l); border-color: #F2C4BE; border-left: 4px solid var(--no); }
.box.tone-falle { background: var(--orange-l); border-color: #F6D8B5; border-left: 4px solid var(--orange); }
.box.tone-merke { background: var(--turq-l); border-color: #BFE6E7; border-left: 4px solid var(--turq); }
.box.tone-sprache { background: #F3EEFF; border-color: #DDD0FA; border-left: 4px solid #8B5CF6; }
.box.tone-praxis { background: #F4F6F9; border-color: var(--line); border-left: 4px solid var(--navy3); }
.card.tone-recht { border-top: 4px solid #2563EB; } .card.tone-ok { border-top: 4px solid var(--ok); } .card.tone-no { border-top: 4px solid var(--no); }
.card.tone-falle { border-top: 4px solid var(--orange); } .card.tone-merke { border-top: 4px solid var(--turq); } .card.tone-sprache { border-top: 4px solid #8B5CF6; }
.card.tone-navy { border-top: 4px solid var(--navy); }
.pill.law-pill { background: #E8F0FB; color: #1D4ED8; font-size: 13px; }
.opt.sel { border-color: var(--navy2); background: #EEF3FA; }
.res-opt { display: flex; gap: 12px; align-items: flex-start; border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.res-opt .k { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; background: #EEF2F6; color: var(--navy2); }
.res-opt.ok { border-color: var(--ok); background: var(--ok-l); }
.res-opt.no { border-color: #E8C8C3; }
.res-opt.ok b:first-child { color: var(--ok); } .res-opt.no > div > b:first-child { color: var(--no); }
.res-opt.mine { box-shadow: 0 0 0 3px rgba(19, 49, 92, .25); }
.pyr { display: grid; gap: 6px; }
.pyr-l { background: var(--navy2); color: #fff; border-radius: 10px; padding: 10px 14px; text-align: center; }
.pyr-l .small, .pyr-l .tr { color: #D5E0EE; }
.pyr-l:first-child { background: var(--orange-d); }
.pil-roof { background: var(--navy); color: #fff; border-radius: 12px 12px 4px 4px; padding: 12px 16px; text-align: center; font-weight: 650; }
.pil-roof .tr { color: #D5E0EE; }
.pil { border-top: 4px solid var(--turq); }
.pil-base { background: #E6EBF1; border-radius: 4px 4px 12px 12px; padding: 10px 16px; text-align: center; font-size: 15px; }
.qf { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.qf.right { border-color: var(--ok); background: var(--ok-l); }
.qf.wrong { border-color: var(--no); background: var(--no-l); }
.qf .btn.picked { background: var(--navy2); color: #fff; }
.qf-fb { margin-top: 8px; }
.c-ok { color: var(--ok); } .c-no { color: var(--no); }
.mc { display: grid; }
.ans .fb { display: block; margin-top: 4px; }
.ans.r-ok .fb { color: var(--ok); } .ans.r-no .fb { color: var(--no); } .ans.r-miss .fb { color: var(--ok); } .ans.r-none .fb { color: var(--muted); }
.vq { margin: 6px 4px 0; }
.merke-big { border-left: 6px solid var(--turq); font-size: 22px; font-weight: 650; color: var(--navy); }
.merke-big .muted { font-size: 16px; font-weight: 400; margin-top: 8px; }
.stmt { font-size: 24px; font-weight: 650; color: var(--navy); border-left: 6px solid var(--orange); }
.qa-card .qa-q { font-size: 21px; font-weight: 650; color: var(--navy); }
.face.back.qa-card { font-size: 17px; }
@media (max-width: 760px) { .trow.cn { grid-template-columns: 1fr; } .stmt { font-size: 20px; } .merke-big { font-size: 19px; } }
.sign-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.card.sign { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 14px; }
.card.sign img { width: 110px; height: 110px; object-fit: contain; }
.card.sign .hidden { display: none; }
