:root { --bg: #f1f5f9; --text: #0f172a; --leise: #64748b; --linie: #e2e8f0; --dunkel: #0f172a; --f: #0f172a; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--dunkel); }
.awrap { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; }
main.awrap { padding-top: 1.5rem; padding-bottom: 3rem; }

.akopf { background: #0f172a; color: #fff; }
.akopf .awrap { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; min-height: 60px; }
.alogo { color: #fff; text-decoration: none; font-weight: 800; font-size: 1.2rem; margin-right: auto; }
.alogo span { opacity: .55; }
.alogo em { font-style: normal; font-size: .75rem; font-weight: 700; background: #f0b429; color: #1f2a2e; padding: .1rem .45rem; border-radius: 5px; vertical-align: middle; margin-left: .3rem; }
.akopf nav { display: flex; gap: .2rem; flex-wrap: wrap; align-items: center; }
.akopf nav a { color: #fff; text-decoration: none; padding: .4rem .7rem; border-radius: 7px; opacity: .85; }
.akopf nav a:hover, .akopf nav a[aria-current] { background: rgba(255,255,255,.14); opacity: 1; }
.akopf form { margin: 0; }
.abmelden { font: inherit; background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.5); padding: .3rem .8rem; border-radius: 7px; cursor: pointer; margin-left: .4rem; }
.abmelden:hover { background: rgba(255,255,255,.14); }

.box { background: #fff; border: 1px solid var(--linie); border-radius: 14px; padding: 1.4rem 1.5rem; border-top: 5px solid var(--f); }
.box.schmal { max-width: 460px; margin: 2.5rem auto; }
.box h1 { margin: 0 0 .8rem; font-size: 1.5rem; }
.box-kopf { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.box-kopf h1 { margin: 0; }

.reiter { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: -1px; }
.reiter a { --f: #333; text-decoration: none; color: var(--text); background: #e2e8f0; padding: .55rem 1rem; border-radius: 10px 10px 0 0; font-weight: 500; border-top: 4px solid transparent; }
.reiter a { display: inline-flex; align-items: center; gap: .4rem; }
.reiter a .symbol { color: var(--f); }
.reiter a[aria-current] { background: #fff; border-top-color: var(--f); font-weight: 700; }
.reiter + .box { border-top-left-radius: 0; }
.zahl { display: inline-block; min-width: 1.5em; text-align: center; font-size: .78rem; background: rgba(0,0,0,.08); border-radius: 999px; padding: 0 .4rem; font-weight: 600; }

.stufe { margin-top: 1.4rem; }
.stufe-kopf { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-bottom: 2px solid var(--f); padding-bottom: .4rem; margin-bottom: .6rem; }
.stufe-kopf h2 { margin: 0; font-size: 1.15rem; }
.leer { color: var(--leise); font-style: italic; padding: .8rem 1rem; border: 1.5px dashed var(--linie); border-radius: 10px; margin: .4rem 0; }

.tabelle { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tabelle th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--leise); padding: .4rem .5rem; }
.tabelle td { padding: .6rem .5rem; border-top: 1px solid var(--linie); vertical-align: top; }
.tabelle small { color: var(--leise); }
.pfad { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aktionen { white-space: nowrap; text-align: right; }
.box .aktionen form { display: inline; margin-left: .8rem; }
.loeschen { font: inherit; background: none; border: 0; color: #b4442e; cursor: pointer; text-decoration: underline; padding: 0; }
@media (max-width: 700px) {
  .tabelle thead { display: none; }
  .tabelle tr { display: block; border-top: 1px solid var(--linie); padding: .5rem 0; }
  .tabelle td { display: block; border: 0; padding: .15rem 0; text-align: left; }
  .pfad { max-width: none; }
}

form.formular, .box form { display: grid; gap: 1rem; }
label { display: grid; gap: .3rem; font-weight: 600; font-size: .95rem; }
label small, .klein { font-weight: 400; color: var(--leise); font-size: .88rem; }
input:not([type=hidden]):not([type=file]), textarea, select { font: inherit; padding: .6rem .8rem; border: 2px solid var(--linie); border-radius: 9px; background: #fff; width: 100%; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--dunkel); }
input[type=file] { font: inherit; padding: .6rem; border: 2px dashed var(--linie); border-radius: 9px; background: #f8fafc; width: 100%; }
textarea { resize: vertical; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .zwei { grid-template-columns: 1fr; } }
fieldset.dateiwahl { border: 1.5px solid var(--linie); border-radius: 12px; padding: .9rem 1rem 1rem; display: grid; gap: .6rem; margin: 0; }
fieldset.dateiwahl legend { font-weight: 700; padding: 0 .3rem; }
.oder { text-align: center; color: var(--leise); margin: 0; font-size: .9rem; }
.aktuell { margin: 0; background: #ecfdf5; padding: .6rem .8rem; border-radius: 8px; }
.leiste { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }

button:not(.loeschen):not(.abmelden), .knopf { font: inherit; font-weight: 600; background: var(--f); color: #fff; border: 0; padding: .65rem 1.2rem; border-radius: 9px; cursor: pointer; text-decoration: none; display: inline-block; }
button:not(.loeschen):not(.abmelden):hover, .knopf:hover { filter: brightness(1.12); }
.knopf2 { color: var(--dunkel); font-weight: 500; }

.meldung { padding: .75rem 1rem; border-radius: 10px; margin: 0 0 1rem; font-weight: 500; }
.meldung.ok { background: #e2f2e8; color: #1d5e37; border: 1px solid #b9dfc6; }
.meldung.fehler { background: #fbe6e2; color: #8a2c1c; border: 1px solid #f0c0b6; }
.hilfe { background: #f8fafc; border-radius: 9px; padding: .6rem .9rem; font-size: .92rem; }
.hilfe summary { cursor: pointer; font-weight: 600; }
code { background: #f1f5f9; padding: .05rem .35rem; border-radius: 4px; font-size: .9em; }

/* ---------- Allgemein ergänzt ---------- */
.box.mittel { max-width: 720px; margin: 2rem auto; }
.schritt { margin: 0 0 .2rem; font-size: .85rem; font-weight: 700; color: var(--leise); text-transform: uppercase; letter-spacing: .05em; }
.link-knopf { background: none !important; color: var(--leise) !important; padding: 0 !important; font-weight: 500 !important; text-decoration: underline; }
.klein-form { margin-top: .8rem; display: block !important; }
.status { font-size: .9rem; font-weight: 600; color: var(--leise); }
.status.ok { color: #1d5e37; } .status.fehler { color: #8a2c1c; } .status.offen { color: #8a5a00; }
.warnung { color: #8a2c1c; font-weight: 600; }

/* Griff zum Ziehen (sechs Punkte) */
.griff, .griff-beispiel { display: inline-block; width: 14px; height: 20px; cursor: grab; vertical-align: middle; border: 0; padding: 0;
  background: radial-gradient(circle, #94a3b8 1.6px, transparent 1.8px) 0 0 / 7px 6.6px; background-color: transparent; }
.griff:active { cursor: grabbing; }

/* ---------- Einträge sortieren ---------- */
.griff-spalte { width: 64px; white-space: nowrap; }
.pfeile { display: inline-flex; gap: 2px; margin-left: 4px; vertical-align: middle; }
.pfeile button { font: inherit; font-size: .8rem; line-height: 1; padding: .15rem .3rem !important; background: #f1f5f9 !important; color: var(--text) !important; border-radius: 5px !important; font-weight: 600 !important; }
.pfeile button:hover { background: #e0dcd2 !important; }
tr.zieht { opacity: .45; background: #f8fafc; }
tr.leer-zeile td { color: var(--leise); font-style: italic; text-align: center; padding: 1rem; border: 1.5px dashed var(--linie); }

/* ---------- Seiten-Baukasten ---------- */
.neu-leiste { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 1rem 0; padding: .8rem; background: #f8fafc; border-radius: 10px; }
.neu-label { font-weight: 600; font-size: .9rem; margin-right: .3rem; }
.neu-knopf { background: #fff !important; color: var(--dunkel) !important; border: 1.5px solid var(--dunkel) !important; padding: .4rem .8rem !important; font-size: .9rem; }
.neu-knopf:disabled { opacity: .4; cursor: not-allowed; }
.ebloecke { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.eblock { background: #fff; border: 1.5px solid var(--linie); border-radius: 12px; overflow: hidden; }
.eblock:focus-within { border-color: var(--dunkel); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.eblock.zieht { opacity: .4; border-style: dashed; }
.eblock.b-voll { grid-column: span 6; } .eblock.b-zweidrittel { grid-column: span 4; } .eblock.b-haelfte { grid-column: span 3; } .eblock.b-drittel { grid-column: span 2; }
@media (max-width: 900px) { .ebloecke > .eblock { grid-column: span 6; } }
.eblock-kopf { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; padding: .45rem .6rem; background: #f1f5f9; border-bottom: 1px solid var(--linie); }
.eblock-typ { font-weight: 700; font-size: .85rem; margin-right: auto; }
.eblock-kopf select.breite { width: auto; padding: .2rem .4rem; font-size: .82rem; border-width: 1.5px; border-radius: 6px; }
.klein-knopf { font-size: .82rem !important; padding: .2rem .5rem !important; background: #fff !important; color: var(--text) !important; border: 1.5px solid var(--linie) !important; border-radius: 6px !important; font-weight: 600 !important; }
.klein-knopf:hover { border-color: var(--dunkel) !important; }
.klein-knopf.weg { color: #8a2c1c !important; }
.eblock-inhalt { padding: .7rem .8rem .8rem; }
.werkzeuge { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: .5rem; align-items: center; }
.wz { font-size: .8rem !important; padding: .25rem .5rem !important; background: #f1f5f9 !important; color: var(--text) !important; border-radius: 6px !important; font-weight: 600 !important; }
.wz:hover { background: #e2e8f0 !important; }
.wz-bold { font-weight: 800 !important; } .wz-italic { font-style: italic; } .wz-underline { text-decoration: underline; }
.trenner { width: 1px; height: 18px; background: var(--linie); margin: 0 4px; }
.textfeld { min-height: 90px; padding: .7rem .9rem; border: 1.5px dashed var(--linie); border-radius: 9px; outline: none; font-size: 1rem; line-height: 1.55; }
.textfeld:focus { border-style: solid; border-color: var(--dunkel); }
.textfeld h2 { font-size: 1.35rem; margin: 1rem 0 .4rem; } .textfeld h3 { font-size: 1.1rem; margin: .9rem 0 .3rem; }
.textfeld > :first-child { margin-top: 0; } .textfeld > :last-child { margin-bottom: 0; }
.textfeld p { margin: .5rem 0; } .textfeld ul, .textfeld ol { padding-left: 1.3rem; }
.textfeld blockquote { margin: .8rem 0; padding: .1rem .9rem; border-left: 4px solid var(--linie); color: var(--leise); }
.textfeld.hinweis-vorschau { background: #fffbeb; border-color: #fde68a; color: #422006; }
.ueberschrift-feld { font-size: 1.3rem !important; font-weight: 700; }
.platzhalter { margin: 0; color: var(--leise); font-style: italic; padding: .6rem .8rem; background: #f8fafc; border-radius: 8px; }
.speicherleiste { position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: 1rem; margin: 1.2rem -1.5rem -1.4rem;
  padding: .9rem 1.5rem; background: rgba(255,255,255,.96); border-top: 1px solid var(--linie); border-radius: 0 0 14px 14px; }

/* ---------- 2-Faktor ---------- */
.anleitung-2fa { padding-left: 1.3rem; display: grid; gap: 1.1rem; }
.anleitung-2fa li::marker { font-weight: 700; }
.qr-bereich { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; margin-top: .7rem; }
.qr { width: 200px; height: 200px; border: 1px solid var(--linie); border-radius: 10px; overflow: hidden; background: #fff; flex: none; }
.qr svg { display: block; }
.schluessel code { font-size: 1.05rem; letter-spacing: .05em; word-break: break-all; display: inline-block; padding: .4rem .6rem; }
.code-form { display: flex !important; gap: .6rem; margin-top: .6rem; flex-wrap: wrap; }
.code-feld { font-size: 1.4rem !important; letter-spacing: .2em; text-align: center; max-width: 220px; font-variant-numeric: tabular-nums; }
.codes { columns: 2; font-size: 1.15rem; padding-left: 1.6rem; margin: 1rem 0 1.4rem; }
.codes li { margin: .3rem 0; }
.sicherheit-raster { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.sicherheit-raster h2 { font-size: 1.15rem; margin: 0 0 .7rem; }
.sicherheit-raster section form + form { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--linie); }
@media (max-width: 760px) { .sicherheit-raster { grid-template-columns: 1fr; } }
.status-zeile.aktiv { display: inline-block; margin: 0 0 .6rem; background: #e2f2e8; color: #1d5e37; font-weight: 700; padding: .2rem .7rem; border-radius: 999px; font-size: .88rem; }

@media print {
  .akopf, .leiste, .meldung { display: none !important; }
  .box { border: 0; }
}
.eblock-kopf .griff { background: radial-gradient(circle, #94a3b8 1.6px, transparent 1.8px) 0 0 / 7px 6.6px !important;
  padding: 0 !important; width: 14px; height: 20px; border-radius: 3px !important; margin-right: .2rem; }
.eblock-kopf .griff:hover, .eblock-kopf .griff:focus-visible { background-color: #e2e8f0 !important; outline: none; }

/* Vorschaubilder */
.bild-aktuell { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.bild-aktuell img { width: 160px; height: 100px; object-fit: cover; border-radius: 6px; border: 1px solid var(--linie); }
label.haken { display: flex; align-items: center; gap: .45rem; font-weight: 500; }
label.haken input { width: auto; }
.titel-zelle { display: flex; gap: .7rem; align-items: center; }
.mini-bild { width: 56px; height: 38px; object-fit: cover; border-radius: 4px; border: 1px solid var(--linie); flex: none; }

/* ---------- Drag & Drop: Ablageflächen ---------- */
.feld { display: grid; gap: .3rem; }
.feld-titel { font-weight: 600; font-size: .95rem; display: grid; gap: .3rem; }
.feld-titel small { font-weight: 400; color: var(--leise); font-size: .88rem; }
.ablage { position: relative; display: flex !important; align-items: center; justify-content: center; gap: 1rem; min-height: 92px;
  padding: 1rem 1.2rem; border: 2px dashed #cbd5e1; border-radius: 12px; background: #f8fafc; cursor: pointer; text-align: center;
  font-weight: 400 !important; color: var(--leise); transition: border-color .15s, background .15s; }
.ablage:hover { border-color: #94a3b8; }
.ablage:focus-within { border-color: var(--dunkel); }
.ablage input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; border: 0; padding: 0; }
.ablage b { color: var(--text); }
.ablage.drueber { border-color: var(--f, #0f172a); border-style: solid; background: color-mix(in srgb, var(--f, #0f172a) 7%, white); }
.ablage.gefuellt { border-style: solid; border-color: #86efac; background: #f0fdf4; color: #166534; }
.ablage-name { font-weight: 600; word-break: break-word; }
.ablage-vorschau { width: 120px; height: 75px; object-fit: cover; border-radius: 6px; border: 1px solid var(--linie); flex: none; }

/* Stufen in der Übersicht als Ablagefläche */
.stufe { position: relative; border-radius: 12px; transition: background .15s, box-shadow .15s; }
.stufe .ablage-hinweis { display: none; }
.stufe.drueber { background: color-mix(in srgb, var(--f) 6%, white); box-shadow: 0 0 0 3px var(--f); }
.stufe.drueber .ablage-hinweis { display: grid; place-items: center; position: absolute; inset: 0; z-index: 2; border-radius: 12px;
  background: color-mix(in srgb, var(--f) 10%, rgba(255,255,255,.85)); color: var(--f); font-weight: 700; font-size: 1.1rem; pointer-events: none; padding: 1rem; text-align: center; }
.upload-liste { margin: 0 0 1rem; padding: .8rem 1rem; border: 1px solid var(--linie); border-radius: 10px; background: #f8fafc; display: grid; gap: .35rem; }
.upload-kopf { margin: 0 0 .2rem; font-weight: 700; }
.upload-zeile { display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; }
.upload-status { color: var(--leise); text-align: right; }
.upload-zeile.ok .upload-status { color: #166534; font-weight: 600; }
.upload-zeile.fehler .upload-status { color: #8a2c1c; font-weight: 600; }
.upload-liste button { justify-self: start; margin-top: .4rem; }

/* Automatische Vorschauen */
.hinweis-auto { margin: 0 0 .2rem; }
.auto-status { margin: .2rem 0; font-weight: 600; color: var(--leise); }
.auto-status.ok { color: #166534; } .auto-status.fehler { color: #8a2c1c; }
.nachholen { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0 0 1rem;
  padding: .7rem 1rem; border-radius: 10px; background: #fffbeb; border: 1px solid #fde68a; color: #713f12; font-weight: 500; }

/* ---------- Tafel: alle Fächer nebeneinander ---------- */
main.awrap:has(#tafel) { max-width: 1560px; }
.tafel-kopf h1 { margin: 0 0 .3rem; font-size: 1.6rem; }
.tafel-kopf p { margin: 0 0 1rem; max-width: 90ch; }
.tafel { display: grid; grid-template-columns: repeat(4, minmax(270px, 1fr)); gap: 1rem; align-items: start; overflow-x: auto; padding-bottom: .5rem; }
.spalte { background: #fff; border: 1px solid var(--linie); border-top: 5px solid var(--f); border-radius: 12px; padding: .8rem .8rem 1rem; display: grid; gap: .8rem; }
.spalte-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.spalte-kopf h2 { margin: 0; font-size: 1.15rem; }
.spalte-kopf a { color: var(--leise); }
.ablagefach { position: relative; background: color-mix(in srgb, var(--k) 35%, white); border-radius: 10px; padding: .55rem .55rem .65rem; min-height: 4.2rem;
  transition: box-shadow .12s, background .12s; }
.ablagefach-kopf { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.ablagefach-kopf h3 { margin: 0; font-size: .95rem; }
.neu-link { font-size: .85rem; font-weight: 600; color: var(--f); text-decoration: none; }
.neu-link:hover { text-decoration: underline; }
.bkarten { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; min-height: .5rem; }
.bkarte { display: grid; grid-template-columns: auto auto 1fr; grid-template-areas: "griff bild text" "aktionen aktionen aktionen"; align-items: center; gap: .25rem .5rem;
  background: #fff; border: 1px solid var(--linie); border-radius: 8px; padding: .45rem .55rem; }
.bkarte:not(:has(.mini-bild)) { grid-template-columns: auto 1fr; grid-template-areas: "griff text" "aktionen aktionen"; }
.bkarte .griff { grid-area: griff; }
.bkarte .mini-bild { grid-area: bild; width: 44px; height: 30px; }
.bkarte-text { grid-area: text; display: grid; min-width: 0; }
.bkarte-text b { font-size: .92rem; line-height: 1.25; overflow-wrap: anywhere; }
.bkarte-text small { color: var(--leise); font-size: .78rem; }
.bkarte-aktionen { grid-area: aktionen; display: flex; align-items: center; gap: .55rem; font-size: .82rem; padding-left: 1.4rem; }
.bkarte-aktionen form { display: inline !important; margin: 0; }
.bkarte-aktionen .hoch, .bkarte-aktionen .runter { font: inherit; font-size: .78rem !important; line-height: 1; padding: .15rem .35rem !important;
  background: #f1f5f9 !important; color: var(--text) !important; border-radius: 5px !important; font-weight: 600 !important; }
.bkarte.zieht { opacity: .4; border-style: dashed; }
.bleer { margin: 0; font-size: .82rem; color: var(--leise); font-style: italic; padding: .5rem; border: 1.5px dashed #cbd5e1; border-radius: 8px; text-align: center; }
.tafel.zieht-gerade .ablagefach, #tafel.zieht-gerade .ablagefach { outline: 1.5px dashed #cbd5e1; outline-offset: -1px; }
.ablagefach.ziel { box-shadow: 0 0 0 3px var(--f); background: color-mix(in srgb, var(--k) 60%, white); }
.ablagefach .ablage-hinweis { display: none; }
.ablagefach.drueber { box-shadow: 0 0 0 3px var(--f); }
.ablagefach.drueber .ablage-hinweis { display: grid; place-items: center; position: absolute; inset: 0; z-index: 2; border-radius: 10px;
  background: color-mix(in srgb, var(--k) 70%, rgba(255,255,255,.85)); color: var(--f); font-weight: 700; padding: .8rem; text-align: center; pointer-events: none; }
@media (max-width: 1200px) { .tafel { grid-template-columns: repeat(4, minmax(260px, 300px)); } }

/* Bilder im Seiten-Baukasten */
.textfeld img { display: block; max-width: 100%; height: auto; margin: .6rem 0; border-radius: 4px; outline: 1px solid var(--linie); }
.textfeld.drueber { border-color: var(--f, #0f172a); border-style: solid; background: #f8fafc; }
.bildzone { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; min-height: 110px; padding: .8rem;
  border: 2px dashed #cbd5e1; border-radius: 10px; background: #f8fafc; cursor: pointer; text-align: center; color: var(--leise); }
.bildzone:hover, .bildzone:focus-visible { border-color: #94a3b8; outline: none; }
.bildzone.drueber { border-color: var(--f, #0f172a); border-style: solid; }
.bildzone.laedt { opacity: .55; cursor: progress; }
.bildzone-bild { max-width: 100%; max-height: 220px; border-radius: 6px; border: 1px solid var(--linie); }
.bildzone-text { margin: 0; }
.bildzone-text b { color: var(--text); }
.eblock-inhalt .bild-alt, .eblock-inhalt .bild-unterschrift { margin-top: .5rem; font-size: .92rem; }
.bild-hilfe { margin: .25rem 0 0; }
