:root{
  --bg:#f5f6f8;
  --card:#fff;
  --text:#20242a;
  --muted:#66717d;
  --line:#d9dee6;
  --accent:#f58220;
  --accent-dark:#b55309;
  --ok:#157f3b;
  --bad:#b42318;
  --soft:#fff4e8;
  --header:#ffffff;
}
*{box-sizing:border-box}
body{margin:0;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--text)}
.topbar{display:flex;justify-content:space-between;gap:1rem;align-items:center;padding:.85rem 1.25rem;background:var(--header);color:var(--text);border-top:5px solid var(--accent);border-bottom:1px solid var(--line);box-shadow:0 1px 3px rgba(0,0,0,.04)}
.brand{display:flex;align-items:center;gap:.8rem}.brand-mark{width:42px;height:42px;border-radius:10px;background:var(--accent);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:800;letter-spacing:.02em}.topbar h1{margin:0;font-size:1.35rem}.topbar h1 span{font-size:.9rem;color:var(--accent-dark)}.topbar p{margin:.2rem 0 0;color:var(--muted)}
main{max-width:1180px;margin:1rem auto;padding:0 1rem}.card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:1rem;margin-bottom:1rem;box-shadow:0 1px 3px rgba(0,0,0,.04)}h2{font-size:1.05rem;margin:.1rem 0 .7rem}.intro p,.compact{margin:.25rem 0 .75rem;color:var(--muted)}.layout{display:grid;grid-template-columns:260px 1fr;gap:1rem}.task-list{height:max-content;position:sticky;top:1rem}.task-button{display:block;width:100%;text-align:left;margin:.4rem 0;padding:.7rem;border:1px solid var(--line);border-radius:9px;background:white;color:var(--text);cursor:pointer}.task-button strong{display:block;color:var(--text);font-size:.95rem}.task-button small{display:block;color:#4b5563;font-weight:650;margin-top:.15rem}.task-button.active{border-color:var(--accent);background:var(--soft);box-shadow:inset 4px 0 0 var(--accent)}.task-button.active strong{color:#7a3400}.task-button.active small{color:#334155}.task-button.custom-active{border-color:#8793a1;background:#f7f9fc;box-shadow:inset 4px 0 0 #8793a1}button{border:0;border-radius:9px;background:var(--accent);color:white;padding:.65rem .85rem;cursor:pointer;font-weight:600}button.secondary{background:#eef1f5;color:#1f2933;border:1px solid var(--line)}button:hover,.task-button:hover{filter:brightness(.98)}.button-row{display:flex;gap:.5rem;flex-wrap:wrap;margin:.75rem 0}.meta{float:right;color:var(--muted);font-size:.85rem}.mode-note{display:none;margin:.6rem 0 0;padding:.55rem .7rem;border:1px solid var(--line);border-left:4px solid var(--accent);border-radius:8px;background:#fffaf3;color:#5f421f;font-size:.92rem}.mode-note.show{display:block}.formula-box{display:grid;grid-template-columns:1fr 1fr;gap:.75rem;margin:.8rem 0}.formula-box div,.normalform-grid>div{border:1px solid var(--line);border-radius:9px;padding:.7rem;background:#fafbfc}small{display:block;color:var(--muted);margin-bottom:.35rem}code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;background:#f1f3f6;padding:.1rem .25rem;border-radius:4px}.table-wrap{overflow:auto}table.truth{border-collapse:collapse;width:100%;min-width:420px}table.truth th,table.truth td{border:1px solid var(--line);padding:.45rem;text-align:center}table.truth th{background:#f1f3f6}table.truth input{width:3rem;text-align:center;padding:.3rem;border:1px solid var(--line);border-radius:6px}.cell-ok{background:#e8f7ee}.cell-bad{background:#fdecec}.feedback{min-height:1.4rem;font-weight:600;margin:.5rem 0 0}.feedback.ok{color:var(--ok)}.feedback.bad{color:var(--bad)}.normalform-grid{display:grid;grid-template-columns:1fr 1fr;gap:.75rem}.normalform-grid input,.custom-card input,textarea{display:block;width:100%;padding:.7rem;border:1px solid var(--line);border-radius:9px;margin:.3rem 0 .75rem;font:inherit}textarea{resize:vertical}.note{color:var(--muted);font-size:.92rem;margin:.5rem 0 0}.custom-card summary{cursor:pointer;font-weight:700}footer{max-width:1180px;margin:1rem auto 2rem;padding:0 1rem;color:var(--muted);font-size:.9rem}@media(max-width:850px){.layout{grid-template-columns:1fr}.task-list{position:static}.formula-box,.normalform-grid{grid-template-columns:1fr}.topbar{align-items:flex-start;flex-direction:column}.brand{align-items:flex-start}}
.syntax-help{border:1px solid var(--line);border-left:4px solid var(--accent);background:#fffaf3;border-radius:9px;padding:.6rem .7rem;margin:.5rem 0 .8rem;color:#4f5560;font-size:.93rem}.form-hint{min-height:1.2rem;margin:.25rem 0 0;color:var(--muted);font-size:.9rem;line-height:1.35}.form-hint.ok{color:var(--ok)}.form-hint.warn{color:#9a5a00}.normalform-grid input{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
.circuit-wrap{margin-top:.75rem;overflow:auto;border:1px dashed var(--line);border-radius:10px;background:#fbfcfe;min-height:2.2rem;padding:.75rem}.circuit-wrap:empty{display:none}.circuit-heading{margin:0 0 .6rem 0;font-size:1rem;font-weight:700;color:#20242a}.circuit-svg{display:block;min-width:760px;width:100%;height:auto}.circuit-svg .wire{stroke:#3c4652;stroke-width:2;fill:none}.circuit-svg .wire.thin{stroke-width:1.2;opacity:.65}.circuit-svg .wire.arrow{marker-end:url(#arrow)}.circuit-svg marker path{fill:#3c4652}.circuit-svg .gate{fill:#fff;stroke:#9aa6b2;stroke-width:1.5}.circuit-svg .gate.not{fill:#fff7ed}.circuit-svg .gate.and{fill:#eef7ff}.circuit-svg .gate.or{fill:#f1fff4}.circuit-svg .gate.out{fill:#f7f7fb}.circuit-svg text{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;fill:#20242a}.circuit-svg .gate-label{font-weight:800;text-anchor:middle;font-size:15px}.circuit-svg .input-label{font-size:14px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.circuit-svg .small-label{font-size:12px;text-anchor:middle;fill:#66717d}

.logisim-task{margin-top:.85rem;border:1px solid var(--line);border-left:4px solid var(--accent);background:#fffaf3;border-radius:9px;padding:.75rem .85rem;color:#3f4650}.logisim-task h3{font-size:1rem;margin:0 0 .35rem}.logisim-task p{margin:0;color:#4f5560;line-height:1.4}
.normalform-grid.single{grid-template-columns:1fr}
.equiv{cursor:help;border-bottom:1px dotted currentColor}

/* Anonymes Feedback */
.survey-section{margin-top:1rem}
.survey-section details>summary{cursor:pointer;font-weight:750;color:var(--text)}
.survey-small{font-size:.9rem;color:var(--muted)}
.survey-small-inline{font-size:.9rem;color:var(--muted);font-weight:400}
.survey-rating{margin:12px 0 18px}
.survey-rating-label{display:block;font-weight:700;margin-bottom:6px}
.survey-stars{display:flex;gap:4px;flex-wrap:wrap;margin:0}
.survey-stars button{width:38px;height:36px;padding:0;font-size:1.35rem;line-height:1;background:#fff;color:#a56b00;border:1px solid #d7b36d}
.survey-stars button.active{background:#fff3cf;border-color:#c98b16}
.survey-stars button:focus-visible{outline:3px solid rgba(245,130,32,.28);outline-offset:2px}
.survey-textarea{min-height:72px;resize:vertical;margin-bottom:.75rem}
.survey-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:.4rem}
.privacy-note{border-left:3px solid #94a8b8;padding-left:10px}
.hp-field{position:absolute!important;left:-10000px!important;width:1px!important;height:1px!important;overflow:hidden!important}
@media(max-width:680px){.survey-stars{gap:3px}}
@media print{#surveySection{display:none!important}}

/* Nachvollziehbare Wahrheitstabelle */
.task-button.trace-active{border-color:#4f7a65;background:#f1f8f4;box-shadow:inset 4px 0 0 #4f7a65}
.task-button.trace-active strong{color:#244f3a}
.trace-card h3{font-size:1rem;margin:.2rem 0 .45rem}
.trace-heading-row{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem}
.trace-heading-row>div{min-width:0;flex:1}
.trace-heading-row>button{flex:0 0 auto}
.trace-rule{border:1px solid var(--line);border-left:4px solid var(--accent);background:#fffaf3;border-radius:9px;padding:.7rem .8rem;margin:.8rem 0;color:#4f5560;line-height:1.4}
.trace-expression-box{border:1px solid var(--line);border-radius:9px;background:#fafbfc;padding:.8rem;margin:.8rem 0 1rem}
.trace-expression-box>code{display:inline-block;font-size:1rem;padding:.25rem .4rem}
.trace-symbolic{margin-top:.6rem}
.trace-symbolic small{display:inline;margin-right:.4rem}
.trace-step{border-top:1px solid var(--line);padding-top:.85rem;margin-top:.85rem}
.trace-label{font-size:.9rem;color:var(--muted);font-weight:700;margin:.75rem 0 .4rem}
.trace-sequence,.trace-choices{display:flex;flex-wrap:wrap;gap:.45rem;align-items:center;min-height:44px}
.trace-sequence{border:1px dashed #b8c2cc;border-radius:9px;background:#fbfcfe;padding:.55rem}
.trace-column{display:inline-flex;align-items:center;min-height:34px;border-radius:8px;padding:.38rem .58rem;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.88rem;border:1px solid var(--line);background:#fff;white-space:nowrap}
.trace-column.fixed{font-weight:800;background:#eef1f5;color:#334155}
.trace-column.selected{border-color:#d6a56e;background:#fff7ed}
.trace-choice{background:#fff;color:#28323c;border:1px solid #d6a56e;padding:.45rem .65rem;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.88rem}
.trace-choice:hover{background:#fff7ed}
.trace-table-section{margin-top:1rem}
table.truth.trace-truth{width:max-content;min-width:100%}
table.truth.trace-truth th{min-width:105px;max-width:220px;white-space:normal;line-height:1.25}
table.truth.trace-truth th:first-child{min-width:55px}
table.truth.trace-truth td.trace-input-value{background:#f7f9fb;font-weight:650}
table.truth.trace-truth input{width:3rem}
.trace-next{margin-top:.55rem}
@media(max-width:850px){.trace-heading-row{flex-direction:column}.trace-heading-row>button{align-self:flex-start}}


/* v0.4.1: Tastaturnavigation, Papier-zuerst-Ablauf und Update-Hinweis */
.keyboard-tip{border:1px solid #e4bd8e;border-left:4px solid var(--accent);background:#fff8ef;border-radius:9px;padding:.65rem .75rem;margin:.7rem 0;color:#4f5560;font-size:.92rem;line-height:1.4}
kbd{display:inline-block;min-width:1.5em;padding:.08rem .32rem;border:1px solid #b9c1ca;border-bottom-width:2px;border-radius:4px;background:#fff;color:#28323c;font:inherit;font-size:.82em;text-align:center;box-shadow:0 1px 0 rgba(0,0,0,.04)}
table.truth input:focus{outline:3px solid rgba(245,130,32,.28);outline-offset:1px;border-color:var(--accent)}
.trace-paper-step{border:1px solid var(--line);border-left:4px solid #4f7a65;background:#f5faf7;border-radius:9px;padding:.8rem .9rem;margin:1rem 0}
.trace-paper-step h3{margin:0 0 .4rem}
.trace-check-details{border:1px solid var(--line);border-radius:10px;background:#fbfcfe;margin-top:1rem;padding:.15rem .85rem .85rem}
.trace-check-details>summary{cursor:pointer;font-weight:800;padding:.75rem 0;color:#20242a}
.trace-check-details[open]>summary{border-bottom:1px solid var(--line);margin-bottom:.75rem}
.trace-solution-warning{border:1px solid #e4bd8e;border-left:4px solid var(--accent);background:#fff8ef;border-radius:9px;padding:.7rem .8rem;margin:.75rem 0;color:#5b4632;line-height:1.4}
.update-banner{max-width:1180px;margin:.8rem auto 0;padding:.75rem 1rem;border:1px solid #e4bd8e;border-left:5px solid var(--accent);border-radius:10px;background:#fff8ef;display:flex;align-items:center;justify-content:space-between;gap:1rem;box-shadow:0 1px 3px rgba(0,0,0,.04)}
.update-banner[hidden]{display:none!important}
.update-banner strong{display:block;margin-bottom:.15rem}
.update-banner span{color:#5f6470;font-size:.93rem;line-height:1.35}
.update-banner button{flex:0 0 auto}
@media(max-width:700px){.update-banner{margin:.8rem 1rem 0;align-items:flex-start;flex-direction:column}.update-banner button{width:100%}}

.trace-summary-note{display:block;margin:.25rem 1.4rem 0 0;color:var(--accent-dark);font-size:.88rem;font-weight:650;line-height:1.35}
