:root {
  --tinte: #10233f;
  --tinte-2: #3a4a63;
  --papier: #f6f4ef;
  --karte: #ffffff;
  --linie: #dcd8cf;
  --akzent: #0f7b6c;
  --akzent-hell: #e3f2ef;
  --fehler: #b3261e;
  --fehler-hell: #fbe9e7;
  --gedimmt: #6b7686;
  --radius: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --tinte: #e8ecf3; --tinte-2: #b7c1d1; --papier: #0d1626; --karte: #15213a;
    --linie: #2a3a57; --akzent: #3fbfaa; --akzent-hell: #12352f;
    --fehler: #ff8a80; --fehler-hell: #3a1714; --gedimmt: #8d99ab;
  }
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--papier); color: var(--tinte);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
.kopf {
  display: flex; align-items: center; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: #10233f; color: #f6f4ef;
}
.marke { font-weight: 800; letter-spacing: .04em; background: #f6f4ef; color: #10233f; padding: 2px 8px; border-radius: 6px; }
.titel { font-weight: 600; flex: 1; }
main { width: 100%; max-width: 720px; margin: 0 auto; padding: 16px; flex: 1; }
footer { text-align: center; color: var(--gedimmt); font-size: 13px; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
h1 { font-size: 1.4rem; margin: 0 0 8px; }
h2 { font-size: 1rem; margin: 22px 0 10px; display: flex; align-items: baseline; gap: 8px; }
h2:first-of-type { margin-top: 8px; }
.schritt { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--tinte); color: var(--papier); font-size: 13px; }
.optional { color: var(--gedimmt); font-weight: 400; font-size: .85rem; }
.gruss { margin: 0 0 4px; color: var(--tinte-2); }
input[type=text], input[type=password], input[type=month], input:not([type]), textarea, select {
  width: 100%; font: inherit; color: inherit; background: var(--papier);
  border: 1px solid var(--linie); border-radius: 10px; padding: 12px;
}
input:focus, textarea:focus, button:focus-visible, .knopf:focus-within { outline: 3px solid var(--akzent); outline-offset: 1px; }
#pin { font-size: 1.8rem; letter-spacing: .5em; text-align: center; max-width: 260px; display: block; margin: 12px 0; }
button, .knopf {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 10px; padding: 12px 18px;
  border: 1px solid var(--linie); background: var(--karte); color: var(--tinte);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
}
button:disabled { opacity: .45; cursor: not-allowed; }
.primaer { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.gross { width: 100%; margin-top: 20px; font-size: 1.05rem; }
.link { background: none; border: none; color: inherit; text-decoration: underline; padding: 4px; min-height: 0; font-weight: 400; }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.chip { justify-content: flex-start; text-align: left; font-weight: 500; padding: 10px 12px; hyphens: auto; overflow-wrap: anywhere; }
.chips { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.chip[aria-checked=true] { background: var(--akzent-hell); border-color: var(--akzent); box-shadow: inset 0 0 0 1px var(--akzent); }
.aktionen { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ablage {
  border: 2px dashed var(--linie); border-radius: var(--radius); padding: 14px; transition: border-color .15s, background .15s;
}
.ablage.ueber { border-color: var(--akzent); background: var(--akzent-hell); }
.hinweis { color: var(--gedimmt); font-size: .85rem; margin: 10px 0 0; }
.optionen { display: grid; gap: 8px; margin-top: 12px; }
.optionen label { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; }
.optionen input { flex: none; width: 20px; height: 20px; margin-top: 2px; accent-color: var(--akzent); }
.liste { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.liste li { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--linie); border-radius: 10px; background: var(--papier); }
.liste li .info { flex: 1; min-width: 0; }
.liste li .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liste li .meta { color: var(--gedimmt); font-size: .82rem; }
.liste.klein li { padding: 8px 10px; }
.vorschau { width: 44px; height: 56px; border-radius: 6px; object-fit: cover; background: var(--linie); flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--tinte-2); }
.entfernen { min-height: 36px; padding: 4px 10px; }
.ok { border-color: var(--akzent) !important; background: var(--akzent-hell) !important; }
.fehlt { border-color: var(--fehler) !important; background: var(--fehler-hell) !important; }
.fehler { color: var(--fehler); min-height: 1.5em; }
.fortschritt { height: 8px; background: var(--linie); border-radius: 4px; overflow: hidden; margin-top: 12px; }
#fortschritt-balken { height: 100%; width: 0; background: var(--akzent); transition: width .2s; }
.leer { color: var(--gedimmt); font-size: .9rem; }

/* Admin */
.breit main { max-width: 1100px; }
.zeile { display: flex; gap: 8px; flex-wrap: wrap; }
.zeile > * { flex: 1 1 180px; }
.zeile > button { flex: 0 0 auto; }
.tabelle-huelle { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--linie); vertical-align: top; }
th { color: var(--gedimmt); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
td button { min-height: 34px; padding: 4px 10px; font-size: .85rem; }
.inaktiv { opacity: .5; }
.zugang { border: 2px solid var(--akzent); }
.zugang code { display: block; word-break: break-all; background: var(--papier); padding: 10px; border-radius: 8px; margin: 4px 0 10px; font-size: .95rem; }
.zugang .pin { font-size: 1.6rem; letter-spacing: .3em; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs button[aria-selected=true] { background: var(--tinte); color: var(--papier); }

@media (max-width: 420px) {
  .aktionen { grid-template-columns: 1fr; }
  .karte { padding: 16px; }
}

/* Zuschnitt */
.tippbar { cursor: pointer; }
canvas.vorschau { width: 44px; height: 56px; }
.editor { position: fixed; inset: 0; z-index: 50; background: #0b1220; color: #fff; display: flex; flex-direction: column;
  padding: calc(10px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom)); }
.editor-kopf { text-align: center; font-weight: 600; padding: 6px 0 10px; }
.editor-buehne { flex: 1; display: grid; place-items: center; min-height: 0; }
#editor-flaeche { touch-action: none; max-width: 100%; border-radius: 6px; }
.editor-knoepfe { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; padding-top: 12px; }
.editor-knoepfe button { background: #1c2740; color: #fff; border-color: #2a3a57; padding: 10px 8px; }
.editor-knoepfe .primaer { background: #0f7b6c; border-color: #0f7b6c; }
