:root{--flaeche:#fbfaf6;--tinte:#1e2622;--akzent:#1F5D4C;--linie:#d8ddd8;--weich:#55605a;--karte:#ffffff;--warn:#8a4b00;--fehler:#9b2c2c;--ok:#1F5D4C}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--flaeche);color:var(--tinte);font:1rem/1.55 system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;overflow-wrap:anywhere}
.kopf,main,.fuss{max-width:50rem;margin:0 auto;padding:0 16px}
.kopf{padding-top:20px}
.ober{margin:0 0 .5rem;font-size:.9rem}
h1{font-size:1.6rem;line-height:1.25;margin:.2rem 0 .3rem}
h2{font-size:1.3rem;margin:1.4rem 0 .5rem}
h3{font-size:1.1rem;margin:1.2rem 0 .5rem}
h4{font-size:1rem;margin:1rem 0 .4rem}
p{margin:.4rem 0 .8rem}
a{color:var(--akzent)}
.unter{color:var(--weich);margin-top:0}
.weich,.hilfe{color:var(--weich)}
.hilfe{font-size:.9rem;margin:.2rem 0 .6rem}
.gross{font-size:1.15rem;font-weight:600}
.leer{color:var(--weich);font-style:italic}
:focus-visible{outline:3px solid var(--akzent);outline-offset:2px}
.meldung{min-height:1.5rem;margin:.6rem 0;padding:0;color:var(--akzent);font-weight:600}
.meldung.fehler{color:var(--fehler)}
.warnung{border-left:4px solid var(--warn);background:#fff6e8;padding:.5rem .75rem;margin:.6rem 0;color:#4d2c00}
.box{background:var(--karte);border:1px solid var(--linie);border-radius:10px;padding:14px 16px;margin:1rem 0}
.box h3:first-child{margin-top:0}
.vorschau{border-color:var(--akzent);border-width:2px}
.vorschau-karten{padding-left:1.2rem;margin:.3rem 0 .8rem}
.zeile{display:flex;flex-wrap:wrap;gap:8px;margin:.5rem 0}
.zeile.mitte{justify-content:center}
button,input,textarea,select{font:inherit;color:inherit}
button{min-height:44px;padding:.45rem .95rem;border:1px solid var(--akzent);border-radius:8px;background:var(--karte);color:var(--akzent);cursor:pointer;font-weight:600}
button:hover:not(:disabled){background:#eef4f1}
button:disabled{opacity:.45;cursor:not-allowed}
button.primaer{background:var(--akzent);color:#fff}
button.primaer:hover:not(:disabled){background:#174a3d}
button.gefahr{border-color:var(--fehler);color:var(--fehler)}
button.zurueck{border-color:var(--linie);color:var(--weich);margin-top:1rem}
.feld{margin:.6rem 0}
.feld label,label{display:block;font-weight:600;margin-bottom:.25rem}
input[type=text],input[type=search],textarea,select,input[type=file]{width:100%;max-width:100%;padding:.55rem .7rem;border:1px solid #9aa59f;border-radius:8px;background:#fff;min-height:44px}
textarea{resize:vertical}
.liste{list-style:none;margin:0;padding:0}
.deckzeile,.kartenzeile{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px;border:1px solid var(--linie);background:var(--karte);border-radius:10px;padding:10px 14px;margin:8px 0}
.deckinfo{display:flex;flex-direction:column;min-width:0;flex:1 1 12rem}
.kartentext{flex:1 1 14rem;min-width:0}
.kartentext p{margin:.15rem 0;white-space:pre-wrap}
.kv{font-weight:600}.khi{color:var(--weich);font-size:.9rem}
.kartenliste .kv,.kartenliste .kh{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.tabs{list-style:none;display:flex;flex-wrap:wrap;gap:6px;margin:1rem 0;padding:0 0 .6rem;border-bottom:1px solid var(--linie)}
button.tab{border-color:var(--linie);color:var(--tinte)}
button.tab[aria-current=page]{background:var(--akzent);color:#fff;border-color:var(--akzent)}
.panel{min-height:8rem}
.faecher{list-style:none;margin:.6rem 0 1rem;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(9.5rem,1fr));gap:8px}
.faecher li{display:flex;justify-content:space-between;gap:6px;border:1px solid var(--linie);border-radius:8px;padding:6px 10px;background:var(--karte);font-size:.9rem}
.zus li{display:flex;justify-content:space-between;max-width:20rem;padding:.2rem 0;border-bottom:1px solid var(--linie)}
progress{width:100%;height:12px;accent-color:var(--akzent);margin:.2rem 0 1rem}
/* Karte mit Wendeanimation */
.karte-rahmen{perspective:1200px;margin:.5rem 0 1rem}
.karte{display:grid;transform-style:preserve-3d;transition:transform .5s ease;cursor:pointer}
.karte.gedreht{transform:rotateY(180deg)}
.seite{grid-area:1/1;backface-visibility:hidden;-webkit-backface-visibility:hidden;min-height:13rem;background:var(--karte);border:1px solid var(--linie);border-radius:14px;box-shadow:0 2px 10px rgba(30,38,34,.08);padding:16px 18px;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center}
.seite.hinten{transform:rotateY(180deg);border-color:var(--akzent)}
.seitenname{font-size:.78rem;letter-spacing:.06em;text-transform:uppercase;color:var(--weich);margin-bottom:.5rem}
.seitentext{font-size:1.3rem;margin:0;white-space:pre-wrap;max-width:100%}
.hinweistext{background:#eef4f1;border-radius:8px;padding:.5rem .8rem;margin:.5rem 0;white-space:pre-wrap}
.hinweistext[hidden]{display:none}
.bewertung{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:.8rem 0}
.bw{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:.4rem .3rem;font-size:.9rem;min-height:56px}
.taste{display:inline-block;min-width:1.6rem;border:1px solid currentColor;border-radius:5px;font-size:.8rem;line-height:1.4}
.bw1{border-color:var(--fehler);color:var(--fehler)}
.frage{font-size:1.25rem;font-weight:600;white-space:pre-wrap}
.ergebnis{border-left:4px solid var(--ok);padding:.4rem .8rem;margin:.6rem 0;background:#eef4f1}
.ergebnis.falsch{border-color:var(--fehler);background:#fbeeee}
.ergebnis .seitentext{font-size:1.05rem;font-weight:600}
#druckraster{display:none}
.fuss{padding-bottom:28px;padding-top:12px;color:var(--weich);font-size:.88rem;border-top:1px solid var(--linie);margin-top:2rem}
@media (max-width:480px){.bewertung{grid-template-columns:repeat(2,1fr)}h1{font-size:1.35rem}.seitentext{font-size:1.15rem}}
@media (prefers-reduced-motion:reduce){.karte{transition:none}*{scroll-behavior:auto!important}}
@media print{
  body{background:#fff;color:#000;overflow-wrap:normal}
  body>*:not(#druckraster){display:none!important}
  #druckraster{display:block}
  #druckraster h2{font-size:14pt;margin:0 0 6mm}
  .druck-zeile{display:grid;grid-template-columns:1fr 1fr;break-inside:avoid;page-break-inside:avoid}
  .druck-zelle{border:1px dashed #000;padding:5mm;min-height:32mm;margin:-.5px}
  .druck-zelle p{margin:0;font-size:12pt;white-space:pre-wrap}
  .druck-name{display:block;font-size:7pt;text-transform:uppercase;color:#444;margin-bottom:2mm}
  @page{margin:12mm}
}
