/* Feibitur – Stylesheet (keine externen Schriften/Ressourcen, DSGVO-freundlich) */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f0f2f6;
  --ink: #1b1f2a;
  --ink-soft: #4a5263;
  --line: #d9dde5;
  --navy: #14213d;
  --navy-2: #22355e;
  --accent: #b5302a;
  --gold: #d9a400;
  --green: #1e7d45;
  --green-ink: #ffffff;
  --amber-bg: #fff6dc;
  --amber-line: #e6c25a;
  --lk: #6b3fa0;
  --rel: #5b3f8c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 33, 61, .06), 0 4px 16px rgba(20, 33, 61, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11141b; --surface: #1a1e28; --surface-2: #222736; --ink: #e8eaf0; --ink-soft: #aab1c2;
    --line: #333a4c; --navy: #9db4e8; --navy-2: #c3d2f5; --accent: #ef6b62; --amber-bg: #2e2714; --amber-line: #8a6d1d;
    --lk: #b993ea; --rel: #b39be0; --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); overflow-wrap: break-word; }
.topic-panel, .stage, .content-main, .block, .task2, .mat-text, .op-box, .chat { min-width: 0; }
.block, .mat-text, .op-box, .ttext, .face .def, .gl-item, .abi-body { hyphens: auto; -webkit-hyphens: auto; }
a { color: var(--navy-2); }
button { font: inherit; }
img, svg { max-width: 100%; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 2rem; text-align: center; }
[hidden] { display: none !important; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: .6rem 1.1rem; border-radius: 999px; cursor: pointer; text-decoration: none; font-weight: 600; line-height: 1.2; }
.btn:hover { border-color: var(--navy-2); }
.btn:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn-primary { background: #14213d; color: #fff; border-color: #14213d; }
.btn-primary:hover { background: #22355e; }
.btn-green { background: var(--green); color: var(--green-ink); border-color: var(--green); }
.btn-green:hover { background: #17663a; }
.btn-small { padding: .35rem .8rem; font-size: .9rem; }
.btn-ghost { background: transparent; }

/* Gate */
.gate { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(1200px 600px at 50% -10%, #22355e 0%, #14213d 55%, #0c1427 100%); }
.gate-card { background: #fff; color: #1b1f2a; width: 100%; max-width: 380px; padding: 2rem 1.6rem; border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.35);
  display: flex; flex-direction: column; gap: .8rem; text-align: center; }
.gate-card input { padding: .75rem 1rem; border: 1px solid #c8cdd8; border-radius: 10px; font-size: 1rem; }
.gate-lead { margin: 0; color: #4a5263; }
.gate-error { color: #b5302a; margin: 0; font-weight: 600; }
.legal-links { margin-top: 1.2rem; font-size: .85rem; color: #c3cbe0; }
.legal-links a { color: #dfe6f7; }
.brand { font-family: var(--font-head); font-weight: 700; letter-spacing: .02em; }
.brand-lg { font-size: 2.6rem; color: #14213d; }

/* Home */
.home { min-height: 100vh; display: flex; flex-direction: column; }
.home-head { text-align: center; padding: 4rem 16px 2rem; }
.home-head .brand { font-size: clamp(2.6rem, 8vw, 4.2rem); color: var(--navy); }
.home-head p { color: var(--ink-soft); margin: .4rem 0 0; }
.home-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.4rem; max-width: 820px; width: 100%; margin: 0 auto; padding: 1rem 16px 3rem; }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: .6rem; padding: 1.8rem 1.6rem; border-radius: 18px; border: 0; cursor: pointer; text-align: left; color: #fff;
  box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; min-height: 180px; }
.choice:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(20,33,61,.18); }
.choice .choice-title { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; }
.choice .choice-sub { opacity: .85; font-size: .95rem; }
.choice svg { width: 44px; height: 44px; }
.choice-powi { background: linear-gradient(135deg, #14213d, #2c4478); }
.choice-rel { background: linear-gradient(135deg, #4a2f78, #7b5bb0); }
.site-foot { margin-top: auto; text-align: center; padding: 1.4rem 16px; color: var(--ink-soft); font-size: .85rem; }

/* Page header */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .brand { font-size: 1.35rem; color: var(--navy); text-decoration: none; }
.flagline { height: 4px; background: linear-gradient(90deg, #1b1b1b 0 33.3%, #c8102e 33.3% 66.6%, #e4b200 66.6%); }

.powi-hero { background: linear-gradient(160deg, #14213d 0%, #22355e 60%, #2f4a80 100%); color: #fff; padding: 2rem 16px 1.6rem; text-align: center; position: relative; overflow: hidden; }
.powi-hero h1 { font-family: var(--font-head); margin: 0; font-size: clamp(1.7rem, 4.5vw, 2.6rem); }
.powi-hero p { margin: .3rem 0 0; color: #d7def0; }
.powi-hero .dome { position: absolute; right: -20px; bottom: -10px; width: 220px; opacity: .12; }

/* Abitur-Hinweis */
.abi-wrap { max-width: 1100px; margin: -1rem auto 0; padding: 0 16px; position: relative; z-index: 2; }
.abi { background: var(--surface); border: 1px solid var(--amber-line); border-left: 6px solid var(--gold); border-radius: var(--radius); box-shadow: var(--shadow); }
.abi > summary { cursor: pointer; padding: 1rem 1.2rem; font-weight: 700; display: flex; gap: .6rem; align-items: center; list-style: none; text-align: center; justify-content: center; }
.abi > summary::-webkit-details-marker { display: none; }
.abi > summary .chev { transition: transform .2s; }
.abi[open] > summary .chev { transform: rotate(180deg); }
.abi-body { padding: 0 1.2rem 1.2rem; }
.abi-body ul { margin: .3rem 0; padding-left: 1.2rem; }
.abi-body li { margin: .25rem 0; }
.abi-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.abi-col { background: var(--surface-2); border-radius: 10px; padding: .9rem 1rem; }
.abi-col h3 { margin: 0 0 .5rem; font-size: 1.05rem; color: var(--navy); }
.abi-col.lk h3 { color: var(--lk); }
.abi-col h4 { margin: .7rem 0 .2rem; font-size: .92rem; }
.abi-col ul { font-size: .92rem; }
.abi-src { font-size: .8rem; color: var(--ink-soft); margin-top: .8rem; }
.abi-tipps { margin-top: 1rem; background: var(--amber-bg); border-radius: 10px; padding: .8rem 1rem; font-size: .93rem; }

/* Tabs */
.tabs-wrap { max-width: 1400px; margin: 1.4rem auto 0; padding: 0 16px; }
.tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; border-bottom: 3px solid var(--navy); }
.tab { border: 1px solid var(--line); border-bottom: 0; background: var(--surface-2); color: var(--ink); padding: .75rem .6rem; border-radius: 10px 10px 0 0; cursor: pointer;
  font-weight: 600; font-size: .9rem; line-height: 1.3; text-align: center; display: flex; align-items: center; justify-content: center; min-height: 64px; }
.tab:hover { background: var(--surface); }
.tab[aria-selected="true"] { background: #14213d; color: #fff; border-color: #14213d; }
.tab .tab-short { display: none; }

/* Tab layout */
.tabpanel { max-width: 1400px; margin: 0 auto; padding: 1rem 16px 3rem; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.sidebar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; position: sticky; top: .8rem; max-height: calc(100vh - 1.6rem); overflow: auto; }
.sidebar h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); margin: .4rem .5rem .6rem; }
.topic-btn { display: block; width: 100%; text-align: left; border: 1px solid transparent; background: transparent; color: var(--ink); padding: .65rem .7rem; border-radius: 10px; cursor: pointer; margin-bottom: 4px; }
.topic-btn:hover { background: var(--surface-2); }
.topic-btn[aria-expanded="true"] { background: #eef2fb; border-color: #b9c6e4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .topic-btn[aria-expanded="true"] { background: #26304a; border-color: #3d4b70; } }
.topic-nr { font-weight: 700; color: var(--navy); margin-right: .3rem; }
.topic-title { font-size: .92rem; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: .35rem; }
.badge { font-size: .7rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.badge-abi { color: #8a5a00; background: #fff3cc; border-color: #e6c25a; }
.badge-noabi { color: var(--ink-soft); background: transparent; border-color: var(--line); font-weight: 600; }
.badge-content { color: var(--green); border-color: #9fd0b2; background: #ecf8f0; }
.badge-lk { color: #fff; background: var(--lk); border-color: var(--lk); }

.stage { min-width: 0; }
.stage-empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 2.4rem 1.4rem; text-align: center; color: var(--ink-soft); }
.topic-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; animation: open .2s ease; }
@keyframes open { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.topic-head { padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.topic-head h2 { margin: 0; font-family: var(--font-head); font-size: 1.45rem; color: var(--navy); }
.topic-head .row { display: flex; justify-content: space-between; gap: .4rem 1rem; align-items: flex-start; flex-wrap: wrap; }
.kcgo { margin-top: .6rem; font-size: .88rem; }
.kcgo summary { cursor: pointer; color: var(--navy-2); font-weight: 600; }
.kcgo ul { margin: .3rem 0 .4rem; padding-left: 1.2rem; }
.erlass-note { margin-top: .6rem; font-size: .88rem; background: var(--amber-bg); border: 1px solid var(--amber-line); padding: .45rem .7rem; border-radius: 8px; }

.sections { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-bottom: 1px solid var(--line); }
.sec-btn { display: flex; align-items: center; justify-content: center; gap: .55rem; padding: .9rem .6rem; border: 0; border-right: 1px solid var(--line); background: var(--surface);
  color: var(--ink-soft); font-weight: 700; cursor: pointer; font-size: 1rem; }
.sec-btn:last-child { border-right: 0; }
.sec-btn svg { width: 22px; height: 22px; flex: none; }
.sec-btn[aria-selected="true"] { color: var(--navy); background: var(--surface-2); box-shadow: inset 0 -3px 0 var(--accent); }
.sec-body { padding: 1.2rem 1.3rem 1.6rem; }

/* Karteikarten */
.cards-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; align-items: center; margin-bottom: .9rem; }
.progress { display: flex; gap: .5rem; flex-wrap: wrap; font-size: .85rem; }
.pill { padding: .2rem .65rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.pill-good { background: #e8f6ee; border-color: #9fd0b2; color: #17663a; }
.pill-bad { background: #fdecea; border-color: #f0b3ad; color: #9b2b23; }
.flash-wrap { perspective: 1200px; max-width: 620px; margin: 0 auto; }
.flash { position: relative; width: 100%; min-height: 260px; border: 0; padding: 0; background: transparent; cursor: pointer; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.2,.7,.2,1); display: block; }
.flash.flipped { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 16px; padding: 1.4rem 1.5rem; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center; box-shadow: 0 6px 22px rgba(20,33,61,.16);
  background: repeating-linear-gradient(180deg, #fffdf6 0 31px, #e5ecf7 31px 32px); color: #1b1f2a; border-top: 10px solid #b5302a; }
.face-back { transform: rotateY(180deg); border-top-color: #14213d; text-align: left; align-items: stretch; overflow: auto; }
.face .term { font-family: var(--font-head); font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 700; color: #14213d; }
.face .hint { position: absolute; bottom: .7rem; left: 0; right: 0; text-align: center; font-size: .8rem; color: #6b7280; }
.face-back .term-small { font-weight: 700; color: #b5302a; margin-bottom: .4rem; }
.face-back .def { font-size: 1rem; line-height: 1.55; }
.rate { display: flex; justify-content: center; gap: .8rem; margin-top: 1rem; flex-wrap: wrap; }
.rate .btn { min-width: 220px; }
.btn-good { background: #1e7d45; color: #fff; border-color: #1e7d45; }
.btn-bad { background: #fff; color: #9b2b23; border-color: #e0a19b; }
.cards-done { text-align: center; padding: 1.5rem; }
.glossar { margin-top: 2rem; border-top: 1px solid var(--line); padding-top: 1.2rem; }
.glossar h3 { margin: 0 0 .5rem; }
.glossar input { width: 100%; padding: .7rem 1rem; border: 1px solid var(--line); border-radius: 10px; font-size: 1rem; background: var(--surface); color: var(--ink); }
.glossar-results { margin-top: .8rem; display: grid; gap: .5rem; }
.gl-item { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; background: var(--surface-2); }
.gl-item b { color: var(--navy); }
.gl-item .gl-src { font-size: .75rem; color: var(--ink-soft); }
.muted { color: var(--ink-soft); font-size: .9rem; }

/* Inhalte */
.content-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.3rem; align-items: start; }
.content-main > * + * { margin-top: 1.1rem; }
.block { border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.15rem; background: var(--surface); }
.block h3 { margin: 0 0 .4rem; font-size: 1.15rem; color: var(--navy); }
.block p { margin: .45rem 0; }
.block ul, .block ol { padding-left: 1.25rem; margin: .4rem 0; }
.block li { margin: .2rem 0; }
.block-kind { display: inline-block; font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 800; padding: .12rem .5rem; border-radius: 6px; margin-bottom: .45rem; }
.k-erklaerung { background: #e7eefb; color: #22355e; }
.k-fachtext { background: #efe9e1; color: #6a4b1f; }
.k-merke { background: #fff3cc; color: #7a5600; }
.k-beispiel { background: #e8f6ee; color: #17663a; }
.k-gesetz { background: #f1e6f8; color: #5d2f86; }
.k-grafik { background: #e5f2f7; color: #155a73; }
.block.fachtext { background: #fcfaf6; font-family: var(--font-head); font-size: 1.02rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .block.fachtext { background: #1f1d1a; } }
.block.merke { border-color: var(--amber-line); background: var(--amber-bg); }
.block.gesetz { border-left: 5px solid #8a5bb5; }
.block.lk { border-left: 5px solid var(--lk); }
.block .lk-tag { float: right; }
.block table { width: 100%; border-collapse: collapse; font-size: .92rem; margin-top: .4rem; }
.block th, .block td { border: 1px solid var(--line); padding: .45rem .55rem; vertical-align: top; text-align: left; }
.block th { background: var(--surface-2); }
.table-scroll { overflow-x: auto; }
.figure svg { width: 100%; height: auto; display: block; background: #fff; border-radius: 8px; }
.figure figcaption { font-size: .85rem; color: var(--ink-soft); margin-top: .4rem; }
.src { font-size: .8rem; color: var(--ink-soft); }

/* Chat */
.chat { position: sticky; top: .8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); display: flex; flex-direction: column; max-height: calc(100vh - 1.6rem); min-height: 420px; }
.chat-head { padding: .75rem .9rem; border-bottom: 1px solid var(--line); background: #14213d; color: #fff; border-radius: 12px 12px 0 0; }
.chat-head b { display: block; }
.chat-head small { color: #cdd6ea; }
.chat-warn { margin: .7rem .8rem 0; padding: .55rem .7rem; border-radius: 8px; background: #fdecea; color: #7d221c; font-size: .82rem; border: 1px solid #f0b3ad; }
.chat-consent { padding: .8rem; font-size: .86rem; }
.chat-consent label { display: flex; gap: .5rem; align-items: flex-start; margin: .6rem 0; }
.chat-log { flex: 1; overflow: auto; padding: .8rem; display: flex; flex-direction: column; gap: .55rem; min-height: 160px; }
.msg { padding: .55rem .75rem; border-radius: 12px; font-size: .92rem; max-width: 92%; white-space: pre-wrap; word-wrap: break-word; }
.msg-user { align-self: flex-end; background: #14213d; color: #fff; border-bottom-right-radius: 4px; }
.msg-bot { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.msg-err { align-self: stretch; background: #fdecea; color: #7d221c; font-size: .85rem; }
.chat-form { display: flex; gap: .4rem; padding: .6rem; border-top: 1px solid var(--line); }
.chat-form textarea { flex: 1; resize: none; min-height: 44px; max-height: 140px; padding: .55rem .7rem; border-radius: 10px; border: 1px solid var(--line); font: inherit; font-size: .92rem; background: var(--surface); color: var(--ink); }
.chat-foot { padding: 0 .8rem .6rem; font-size: .75rem; color: var(--ink-soft); display: flex; justify-content: space-between; gap: .5rem; }
.linklike { background: none; border: 0; padding: 0; color: var(--navy-2); text-decoration: underline; cursor: pointer; font-size: inherit; }

/* Übungsaufgaben */
.howto { background: #eef2fb; border: 1px solid #b9c6e4; border-radius: 12px; padding: 1rem 1.2rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .howto { background: #1f2740; border-color: #3d4b70; } }
.howto h3 { margin: 0 0 .5rem; color: var(--navy); }
.howto ol { margin: 0; padding-left: 0; list-style: none; counter-reset: step; display: grid; gap: .55rem; }
.howto li { counter-increment: step; display: grid; grid-template-columns: auto 1fr; gap: .7rem; align-items: start; }
.howto li::before { content: counter(step) ". Schritt"; font-weight: 800; color: #fff; background: #14213d; border-radius: 999px; padding: .1rem .65rem; font-size: .8rem; white-space: nowrap; margin-top: .1rem; }
.task { margin-top: 1.3rem; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.task-head { padding: .9rem 1.1rem; background: var(--surface-2); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: .8rem; flex-wrap: wrap; align-items: baseline; }
.task-head h3 { margin: 0; font-size: 1.1rem; color: var(--navy); }
.task-list { list-style: none; margin: 0; padding: .4rem 1.1rem; }
.task-list li { display: grid; grid-template-columns: 2rem 1fr auto; gap: .5rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.task-list li:last-child { border-bottom: 0; }
.task-list .be { font-weight: 700; white-space: nowrap; color: var(--ink-soft); }
.task-actions { padding: .2rem 1.1rem 1rem; }
.material { border-top: 1px solid var(--line); padding: 1rem 1.1rem 1.2rem; background: var(--surface); }
.mat-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: start; }
.op-box { background: #f3f5f9; border: 1px solid #c9d1e0; border-radius: 10px; padding: .7rem .9rem; font-size: .9rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .op-box { background: #222736; border-color: #3d4b70; } }
.op-box h4 { margin: 0 0 .35rem; font-size: .9rem; }
.op-box dl { margin: 0; }
.op-box dt { font-weight: 800; color: var(--navy); margin-top: .35rem; }
.op-box dd { margin: 0 0 0 .1rem; }
.op-box .src { margin-top: .5rem; }
.mat-doc { margin-top: 1.1rem; }
.mat-doc h4 { margin: 1rem 0 .4rem; }
.mat-text { border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; background: #fffefb; color: #1b1f2a; }
.mat-p { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: .4rem; margin: .45rem 0; }
.mat-p .pn { color: #888; font-size: .8rem; padding-top: .15rem; }
.mat-src { font-size: .8rem; color: var(--ink-soft); font-style: italic; margin-top: .4rem; }

.placeholder { padding: 1.4rem; text-align: center; color: var(--ink-soft); border: 1px dashed var(--line); border-radius: 12px; }

/* Religion */
.rel-hero { background: linear-gradient(160deg, #3c2566, #6c4fa3); color: #fff; padding: 2.4rem 16px; text-align: center; }
.rel-hero h1 { font-family: var(--font-head); margin: 0; }
.rel-body { max-width: 680px; margin: 2rem auto; padding: 0 16px; }

/* Responsive */
@media (max-width: 1100px) {
  .content-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .tabpanel { grid-template-columns: 250px minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .tabpanel { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; max-height: none; }
  .abi-cols { grid-template-columns: minmax(0, 1fr); }
  .tab { font-size: .8rem; min-height: 56px; padding: .5rem .3rem; }
  .tab .tab-long { display: none; }
  .tab .tab-short { display: inline; }
  .content-grid { grid-template-columns: minmax(0, 1fr); }
  .chat { position: static; max-height: 560px; }
  .mat-top { grid-template-columns: minmax(0, 1fr); }
  .mat-top .btn-green { justify-self: start; }
}
@media (max-width: 560px) {
  .tabpanel { padding: .8rem 10px 2.5rem; gap: .9rem; }
  .abi-wrap, .tabs-wrap { padding: 0 10px; }
  .abi > summary { padding: .9rem .8rem; }
  .abi-body { padding: 0 .8rem 1rem; }
  .abi-body ul { padding-left: 1.05rem; }
  .abi-col { padding: .75rem .7rem; }
  .topic-head { padding: .9rem .8rem; }
  .topic-head h2 { font-size: 1.2rem; }
  .sec-btn { flex-direction: column; gap: .2rem; font-size: .8rem; padding: .7rem .2rem; }
  .sec-body { padding: .9rem .6rem 1.2rem; }
  .block { padding: .85rem .75rem; }
  .block ul, .block ol { padding-left: 1.05rem; }
  .howto { padding: .85rem .75rem; }
  .howto li { grid-template-columns: minmax(0, 1fr); gap: .25rem; }
  .howto li::before { justify-self: start; }
  .task2-body { padding: .75rem .55rem; }
  .op-box { padding: .65rem .7rem; }
  .mat-text { padding: .55rem .6rem; }
  .mat-p { grid-template-columns: 1.7rem minmax(0, 1fr); gap: .25rem; }
  .op-badge { white-space: normal; overflow-wrap: anywhere; }
  .afb-head { font-size: 1.05rem; flex-wrap: wrap; }
  .face { padding: 1.1rem 1rem; }
  .flash { min-height: 300px; }
  .cards-top { gap: .4rem; }
  .task-list li { grid-template-columns: 1.6rem 1fr; }
  .task-list .be { grid-column: 2; }
  .rate .btn { min-width: 0; flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .flash { transition: none; } .topic-panel { animation: none; } .choice { transition: none; } }
@media print { .chat, .tabs, .sidebar, .topbar { display: none; } }

/* Übungsaufgaben als aufklappbare Einzelaufgaben, gruppiert nach Anforderungsbereich */
.afb-group { margin-top: 1.8rem; }
.afb-head { display: flex; align-items: center; gap: .6rem; margin: 0; color: var(--navy); font-size: 1.15rem; }
.afb-tag { background: #14213d; color: #fff; border-radius: 999px; padding: .15rem .7rem; font-size: .8rem; }
.afb-desc { margin: .3rem 0 .7rem; }
.task2 { border: 1px solid var(--line); border-radius: 12px; margin-top: .6rem; overflow: hidden; background: var(--surface); }
.task2-head { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr) 20px; gap: .6rem; width: 100%; text-align: left; background: var(--surface); border: 0; padding: .85rem 1rem; cursor: pointer; color: var(--ink); align-items: start; font: inherit; }
.task2-head:hover { background: var(--surface-2); }
.task2-head[aria-expanded="true"] { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.task2-head .chev { transition: transform .2s; margin-top: .2rem; width: 18px; height: 18px; flex: none; }
.task2-head[aria-expanded="true"] .chev { transform: rotate(180deg); }
.tnum { font-weight: 800; color: var(--navy); }
.tmain { display: block; min-width: 0; }
.tops { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .3rem; align-items: center; }
.op-badge { font-size: .75rem; font-weight: 700; background: #e7eefb; color: #22355e; border-radius: 6px; padding: .1rem .45rem; }
.mat-refs { font-size: .75rem; color: var(--ink-soft); }
.ttext { display: block; }
.task2-body { padding: 1rem; }
.mat-bild { margin: 0; }
.mat-bild svg { width: 100%; height: auto; display: block; border-radius: 8px; border: 1px solid var(--line); }
.no-mat { margin-top: 1rem; }
@media (max-width: 560px) { .task2-head { grid-template-columns: 2.6rem 1fr auto; padding: .75rem .7rem; } }

@media (max-width: 360px) {
  .sec-btn { font-size: .72rem; }
  .sec-btn svg { width: 18px; height: 18px; }
  .task2-head { grid-template-columns: 2.4rem minmax(0, 1fr) 18px; gap: .4rem; padding: .7rem .55rem; }
  .tnum { font-size: .9rem; }
}
