:root {
  --hg: #fbf8f4; --text: #161616; --grau: #6f6a64; --leer: #ebe5dc; --leer-hover: #ddd4c7;
  --karte: #fff; --linie: #e6dfd5; --akzent: #ff3d71; --akzent-dunkel: #e42a5c; --ok: #1a9c5b; --warn: #c0392b;
}
@media (prefers-color-scheme: dark) {
  :root { --hg: #131211; --text: #f2eee8; --grau: #a39d95; --leer: #262320; --leer-hover: #36322e; --karte: #1d1b19; --linie: #34302c; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--hg); color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.5; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.kopf { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; max-width: 1200px; margin: 0 auto; }
.marke { font-size: 1.15rem; letter-spacing: .01em; text-decoration: none; white-space: nowrap; }
.marke b { color: var(--akzent); }
.kopf nav { display: flex; gap: 8px; align-items: center; }
.sprachen { position: relative; }
.sprachen summary { list-style: none; cursor: pointer; font-weight: 700; font-size: .85rem; border: 1px solid var(--linie); border-radius: 20px; padding: 5px 10px; }
.sprachen summary::-webkit-details-marker { display: none; }
.sprachen div { position: absolute; right: 0; top: 36px; background: var(--karte); border: 1px solid var(--linie); border-radius: 12px; padding: 6px; z-index: 5; box-shadow: 0 8px 24px rgba(0,0,0,.15); min-width: 140px; }
.sprachen a { display: block; padding: 8px 10px; text-decoration: none; border-radius: 8px; }
.sprachen a:hover, .sprachen a[aria-current] { background: var(--leer); }
.knopf-rand { border: 2px solid var(--text); text-decoration: none; border-radius: 30px; padding: 6px 13px; font-weight: 700; font-size: .9rem; white-space: nowrap; }
.held { max-width: 1200px; margin: 0 auto; padding: 24px 16px 18px; }
.held h1 { font-size: clamp(2rem, 7vw, 3.8rem); line-height: 1.03; margin: 0 0 14px; max-width: 15ch; }
.held p { color: var(--grau); max-width: 62ch; font-size: 1.05rem; margin: 0 0 8px; }
.fakten { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 6px; padding: 0; list-style: none; }
.fakten li { background: var(--karte); border: 1px solid var(--linie); border-radius: 20px; padding: 5px 12px; font-size: .9rem; font-weight: 600; }
.zaehler { font-weight: 700; margin-top: 16px; }
.fortschritt { height: 6px; background: var(--leer); border-radius: 3px; margin-top: 8px; overflow: hidden; max-width: 420px; }
#balken { height: 100%; background: var(--akzent); width: 0; }
main, .inhalt { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.knopf { display: block; width: 100%; border: 0; border-radius: 14px; padding: 16px; background: var(--akzent); color: #fff; font-size: 1.08rem; font-weight: 700; cursor: pointer; text-align: center; text-decoration: none; }
.knopf:active { background: var(--akzent-dunkel); }
.knopf:disabled { opacity: .45; cursor: default; }
.knopf.zweit { background: transparent; color: var(--text); border: 2px solid var(--linie); }
.knopf-klein { display: inline-block; border: 0; border-radius: 12px; padding: 8px 14px; background: var(--akzent); color: #fff; font-weight: 700; cursor: pointer; font-size: .9rem; }
.cta { max-width: 420px; margin: 18px 0 8px; }

/* Kachelwand */
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 3px; margin-top: 18px; }
.kachel { aspect-ratio: 1; border: 0; padding: 0; border-radius: 3px; background: var(--leer); cursor: pointer; position: relative; overflow: hidden; display: block; }
.kachel.frei:hover, .kachel.frei:focus-visible { background: var(--leer-hover); }
.kachel.frei:hover::after { content: '+'; position: absolute; inset: 0; display: grid; place-items: center; color: var(--grau); }
.kachel.belegt { grid-column: span 2; grid-row: span 2; border-radius: 4px; transition: transform .15s; background: #222; }
.kachel.belegt:hover { transform: scale(1.05); z-index: 1; box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.kachel.belegt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kachel .nr { position: absolute; top: 3px; right: 4px; font-size: .55rem; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.7); }

.abschnitt { max-width: 760px; margin: 48px auto 0; padding: 0 16px; }
.abschnitt h2 { font-size: 1.5rem; line-height: 1.2; }
.abschnitt li { margin: 8px 0; }
.schritte { counter-reset: s; list-style: none; padding: 0; }
.schritte li { counter-increment: s; position: relative; padding-left: 44px; margin: 14px 0; }
.schritte li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--akzent); color: #fff; font-weight: 800; display: grid; place-items: center; }
table.preise { border-collapse: collapse; width: 100%; font-size: .95rem; }
table.preise td, table.preise th { padding: 7px 6px; border-bottom: 1px solid var(--linie); text-align: left; }
table.preise td:last-child, table.preise th:last-child { text-align: right; white-space: nowrap; }
details { border-bottom: 1px solid var(--linie); padding: 10px 0; }
summary { font-weight: 700; cursor: pointer; }
.klein { color: var(--grau); font-size: .88rem; }
.fuss { text-align: center; color: var(--grau); padding: 50px 16px 40px; font-size: .85rem; }
.fuss a { color: var(--grau); margin: 0 6px; }

dialog { border: 0; border-radius: 18px; padding: 0; max-width: 480px; width: calc(100% - 32px); background: var(--karte); color: var(--text); }
dialog::backdrop { background: rgba(0,0,0,.55); }
.zu { position: absolute; top: 10px; right: 10px; border: 0; background: rgba(0,0,0,.35); color: #fff; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; z-index: 2; }
.d-frei { padding: 26px 22px 22px; }
.d-frei .gross { font-size: 3.2rem; font-weight: 800; margin: 0; }

/* Editor */
.editor { max-width: 640px; margin: 0 auto; padding: 0 16px 120px; }
.start { text-align: center; padding: 30px 0; }
.start h1 { font-size: 1.9rem; line-height: 1.15; margin: 0 0 10px; }
.start p { color: var(--grau); }
.feld { margin: 14px 0; }
.feld label, .feld > span { display: block; font-weight: 600; margin-bottom: 5px; }
.feld input, .feld select { width: 100%; font-size: 1.05rem; padding: 12px; border-radius: 10px; border: 1px solid var(--linie); background: var(--karte); color: var(--text); }
.reihe2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.leiste { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; }
.leiste h2 { margin: 0; font-size: 1.2rem; }
h2 { font-size: 1.2rem; margin: 24px 0 8px; }
.fotos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.foto { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--leer); touch-action: manipulation; }
.foto img { width: 100%; height: 100%; object-fit: contain; background: #fff; display: block; pointer-events: none; }
.foto.fill img { object-fit: cover; }
.foto .nr { position: absolute; left: 3px; top: 3px; background: rgba(0,0,0,.55); color: #fff; font-size: .65rem; border-radius: 5px; padding: 0 4px; }
.foto .aktionen { position: absolute; right: 2px; bottom: 2px; display: flex; gap: 2px; }
.foto button { border: 0; background: rgba(0,0,0,.55); color: #fff; width: 26px; height: 26px; border-radius: 7px; font-size: .8rem; padding: 0; }
.foto button.an { background: var(--akzent); }
.foto.geist { opacity: .4; }
.status { font-size: .92rem; margin: 10px 0; }
.status.ok { color: var(--ok); font-weight: 600; }
.status.warn { color: var(--warn); font-weight: 600; }
.vorschau { display: flex; flex-direction: column; gap: 12px; }
.doppel { display: flex; box-shadow: 0 4px 14px rgba(0,0,0,.15); border-radius: 3px; overflow: hidden; background: #fff; }
.doppel canvas { width: 50%; height: auto; display: block; }
.doppel.cover canvas { width: 100%; }
.doppel.rechts { width: 50%; margin-left: auto; }
.doppel.links { width: 50%; }
.doppel.rechts canvas, .doppel.links canvas { width: 100%; }
.seitenzahl { font-size: .75rem; color: var(--grau); text-align: center; margin-top: -6px; }
.box { margin-top: 24px; padding: 16px; border-radius: 14px; background: var(--karte); border: 1px solid var(--linie); }
.haken { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-weight: 500; }
.haken input { width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: var(--akzent); }
.laden { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; z-index: 10; padding: 20px; text-align: center; }
.laden[hidden] { display: none; }
.spinner { width: 46px; height: 46px; border: 5px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: dreh 1s linear infinite; }
@keyframes dreh { to { transform: rotate(360deg); } }

/* Buchseite */
.buch { max-width: 640px; margin: 0 auto; padding: 0 16px 80px; }
.buch-cover { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.25); display: block; background: var(--leer); }
.buch h1 { font-size: 2rem; line-height: 1.1; margin: 20px 0 4px; }
.buch .autor { color: var(--grau); margin: 0 0 10px; font-size: 1.1rem; }
.hinweis { background: #fff4d6; color: #5a4300; border-radius: 12px; padding: 12px 14px; margin: 14px 0; font-weight: 600; }
@media (prefers-color-scheme: dark) { .hinweis { background: #3a3014; color: #ffe39a; } }
.preisbox { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0; }
.preisbox b { font-size: 1.8rem; }
.aktionen-zeile { display: flex; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.aktionen-zeile a, .aktionen-zeile button { flex: 1; min-width: 140px; }

/* Rechtliches */
.text { max-width: 760px; margin: 0 auto; padding: 0 16px 60px; }
.text h1 { line-height: 1.15; }
@media (max-width: 400px) {
  .kopf { padding: 12px 12px; }
  .marke { font-size: 1rem; }
  .knopf-rand { padding: 5px 9px; font-size: .8rem; }
  .sprachen summary { padding: 4px 8px; }
}
@media (max-width: 300px) { .knopf-rand { display: none; } }
/* Varianten-Wahl + Text-Modus */
.modi { display: grid; gap: 12px; margin: 18px 0 8px; text-align: left; }
.modus-karte { display: block; background: var(--karte); border: 2px solid var(--linie); border-radius: 16px; padding: 16px; cursor: pointer; }
.modus-karte:hover, .modus-karte:focus-within { border-color: var(--akzent); }
.modus-karte b { display: block; font-size: 1.2rem; }
.modus-karte span { display: block; color: var(--grau); margin: 4px 0 12px; }
.modus-karte em { display: inline-block; font-style: normal; background: var(--akzent); color: #fff; font-weight: 700; border-radius: 10px; padding: 8px 14px; }
body[data-modus="text"] .fotos { grid-template-columns: 1fr; }
.eintrag { position: relative; }
body[data-modus="text"] .eintrag { display: flex; gap: 10px; align-items: stretch; }
body[data-modus="text"] .eintrag .foto { width: 110px; flex: none; }
.eintrag textarea { flex: 1; min-width: 0; font: inherit; font-size: 1rem; padding: 10px; border-radius: 10px; border: 1px solid var(--linie); background: var(--karte); color: var(--text); resize: vertical; }
