/* ---------- Schriften (alle lokal, SIL Open Font License) ---------- */
@font-face { font-family: "Montserrat"; src: url("schriften/Montserrat.ttf"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Raleway"; src: url("schriften/Raleway.ttf"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Josefin Sans"; src: url("schriften/JosefinSans.ttf"); font-weight: 100 700; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("schriften/PlayfairDisplay.ttf"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("schriften/CormorantGaramond.ttf"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Cinzel"; src: url("schriften/Cinzel.ttf"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Libre Baskerville"; src: url("schriften/LibreBaskerville.ttf"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Amatic SC"; src: url("schriften/AmaticSC-Bold.ttf"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("schriften/Caveat.ttf"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Dancing Script"; src: url("schriften/DancingScript.ttf"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Great Vibes"; src: url("schriften/GreatVibes.ttf"); font-display: swap; }
@font-face { font-family: "Sacramento"; src: url("schriften/Sacramento.ttf"); font-display: swap; }
@font-face { font-family: "Parisienne"; src: url("schriften/Parisienne.ttf"); font-display: swap; }
@font-face { font-family: "Allura"; src: url("schriften/Allura.ttf"); font-display: swap; }
@font-face { font-family: "Alex Brush"; src: url("schriften/AlexBrush.ttf"); font-display: swap; }
@font-face { font-family: "Pinyon Script"; src: url("schriften/PinyonScript.ttf"); font-display: swap; }
@font-face { font-family: "Reenie Beanie"; src: url("schriften/ReenieBeanie.ttf"); font-display: swap; }
@font-face { font-family: "La Belle Aurore"; src: url("schriften/LaBelleAurore.ttf"); font-display: swap; }

:root {
  --grund: #f5f0e8;
  --karte: #fffdf9;
  --linie: #e4dbcd;
  --tinte: #2b2420;
  --leise: #7a6d62;
  --akzent: #2f5d50;
  --akzent-hell: #e3eeea;
  --rot: #a8412f;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 15px; line-height: 1.45;
  color: var(--tinte); background: var(--grund);
}
[hidden] { display: none !important; }

/* ---------- Kopf ---------- */
.kopf {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 20px; background: var(--karte); border-bottom: 1px solid var(--linie);
}
.marke { font-weight: 700; letter-spacing: .22em; font-size: 17px; }
.marke span { font-weight: 400; letter-spacing: 0; color: var(--leise); margin-left: 12px; font-size: 14px; }
.kopf-knoepfe { display: flex; gap: 8px; }

/* ---------- Knoepfe ---------- */
.k {
  font: inherit; font-weight: 600; color: var(--tinte);
  background: #fff; border: 1.5px solid var(--linie); border-radius: 10px;
  padding: 9px 14px; cursor: pointer; transition: background .12s, border-color .12s;
}
.k:hover:not(:disabled) { border-color: var(--akzent); background: var(--akzent-hell); }
.k:disabled { opacity: .4; cursor: default; }
.k.haupt { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.k.haupt:hover:not(:disabled) { background: #244a40; }
.k.leise { border-color: transparent; background: transparent; }
.k.gross { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; font-size: 14px; }
.k.gross b { font-size: 26px; line-height: 1; color: var(--akzent); font-family: "Playfair Display", serif; }
.k.klein-k { padding: 7px 8px; font-size: 13px; }
.k.rot { color: var(--rot); }
.k.rot:hover { border-color: var(--rot) !important; background: #f8e9e5 !important; }

/* ---------- Raster ---------- */
.haupt-raster {
  display: grid; grid-template-columns: 290px minmax(0, 1fr) 330px; gap: 18px;
  max-width: 1500px; margin: 0 auto; padding: 18px;
  align-items: start;
}
.spalte { display: flex; flex-direction: column; gap: 14px; }
.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px; }
.karte h2 { margin: 0 0 12px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.karte h2 i {
  font-style: normal; width: 24px; height: 24px; border-radius: 50%;
  background: var(--akzent); color: #fff; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
/* Schritte zaehlen sich selbst durch – ausgeblendete Karten (z. B. Ziffernblatt ohne Uhr) zaehlen nicht mit */
.haupt-raster { counter-reset: schritt; }
.karte h2 i { counter-increment: schritt; }
.karte h2 i::before { content: counter(schritt); }
.klein { font-size: 12.5px; color: var(--leise); margin: 8px 0 0; }
.mittig { text-align: center; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.zwei.drei-sp { grid-template-columns: repeat(3, 1fr); gap: 6px; }
.zwei.drei-sp .k.gross { font-size: 12.5px; padding: 12px 4px; }
.k.offen { border-color: var(--akzent); background: var(--akzent-hell); }
.vorlagen-knopf { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; }
.vorlagen-knopf b { font-size: 24px; line-height: 1; color: var(--akzent); }
.vorlagen-knopf small { font-weight: 400; color: var(--leise); }
.vorlagen { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.vorlagen button { position: relative; }
.vorlagen button i { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--rot); color: #fff; font-style: normal; font-size: 13px; line-height: 24px; text-align: center; }
.motiv-kat button.an { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.admin-vorlage { margin-top: 12px; border: 1.5px dashed var(--akzent); border-radius: 10px; padding: 12px; background: var(--akzent-hell); font-size: 13px; }
.vorlagen button { font: inherit; background: #fff; border: 1.5px solid var(--linie); border-radius: 10px; padding: 6px 6px 7px; cursor: pointer; color: var(--tinte); }
.vorlagen button:hover { border-color: var(--akzent); background: var(--akzent-hell); }
.vorlagen canvas { width: 100%; aspect-ratio: 1; display: block; }
.vorlagen span { display: block; font-size: 12px; font-weight: 600; line-height: 1.25; margin-top: 4px; }
.motiv-kat { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.motiv-kat button {
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--leise);
  background: #fff; border: 1.5px solid var(--linie); border-radius: 999px; padding: 5px 10px;
}
.motiv-kat button.an { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.motive { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; max-height: 320px; overflow-y: auto; padding-right: 4px; }
.motive button { background: #fff; border: 1.5px solid var(--linie); border-radius: 9px; padding: 5px; cursor: pointer; aspect-ratio: 1; }
.motive button:hover { border-color: var(--akzent); background: var(--akzent-hell); }
.motive canvas, .motive img { width: 100%; height: 100%; display: block; object-fit: contain; }
.drei-k { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0; }

.produkte { display: flex; flex-direction: column; gap: 8px; }
.produkte button {
  font: inherit; text-align: left; cursor: pointer; color: inherit;
  background: #fff; border: 1.5px solid var(--linie); border-radius: 10px; padding: 10px 12px;
}
.produkte button b { display: block; }
.produkte button span { font-size: 12.5px; color: var(--leise); }
.produkte button.an { border-color: var(--akzent); background: var(--akzent-hell); }

.feld { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 0; }
.feld small { font-weight: 400; color: var(--leise); }
.feld output { float: right; font-weight: 400; color: var(--leise); }
.feld input[type=text], .feld textarea, .feld select {
  display: block; width: 100%; margin-top: 5px; font: inherit; font-weight: 400;
  padding: 9px 10px; border: 1.5px solid var(--linie); border-radius: 10px; background: #fff; color: var(--tinte);
}
.feld textarea { resize: vertical; }
.feld input[type=range] { display: block; width: 100%; margin-top: 6px; accent-color: var(--akzent); }
.feld :focus-visible, .k:focus-visible { outline: 2px solid var(--akzent); outline-offset: 1px; }
.haken { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; font-size: 13.5px; cursor: pointer; }
.haken input { accent-color: var(--akzent); width: 17px; height: 17px; flex: none; margin-top: 1px; }

.schriften {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px;
  max-height: 232px; overflow-y: auto; padding-right: 4px;
}
.schriften button {
  background: #fff; border: 1.5px solid var(--linie); border-radius: 9px; cursor: pointer;
  padding: 6px 4px; font-size: 19px; line-height: 1.25; color: var(--tinte);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.schriften button.an { border-color: var(--akzent); background: var(--akzent-hell); }

.liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.liste li {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1.5px solid var(--linie); border-radius: 9px; padding: 6px 8px 6px 10px; background: #fff; font-size: 13.5px;
}
.liste li.an { border-color: var(--akzent); background: var(--akzent-hell); }
.liste li span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.liste li button { border: 0; background: none; cursor: pointer; color: var(--rot); font-size: 15px; padding: 2px 6px; }

.hilfe { margin: 10px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--leise); }
.hilfe li { margin: 4px 0; }

/* ---------- Buehne ---------- */
.mitte { position: sticky; top: 74px; }
.reiter { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; }
.reiter button {
  font: inherit; font-weight: 600; cursor: pointer; color: var(--leise);
  background: transparent; border: 1.5px solid transparent; border-radius: 999px; padding: 8px 18px;
}
.reiter button.an { background: var(--karte); border-color: var(--linie); color: var(--tinte); }
.buehne {
  position: relative; height: min(68vh, 720px); min-height: 340px;
  border-radius: var(--radius); border: 1px solid var(--linie); overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #fbf8f3 0%, #ebe3d6 100%);
}
.buehne canvas[data-rolle=leinwand] { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
.drei { position: absolute; inset: 0; cursor: grab; }
.drei canvas { display: block; }
.foto-ansicht { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #e9e4da; }
.foto-ansicht canvas { max-width: 100%; max-height: 100%; display: block; }
.leer-hinweis {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  background: rgba(255, 253, 249, .92); border: 1px solid var(--linie); border-radius: 12px;
  padding: 10px 16px; text-align: center; font-size: 13.5px; pointer-events: none; white-space: nowrap;
}
.drei-leiste {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: rgba(255, 253, 249, .92); border: 1px solid var(--linie); border-radius: 12px; padding: 6px 8px 6px 14px;
  font-size: 12.5px; color: var(--leise);
}
.drei-leiste label { display: flex; align-items: center; gap: 6px; color: var(--tinte); cursor: pointer; }
.hinweise { margin-top: 10px; border: 1.5px solid #e2a15f; background: #fdf1e3; border-radius: 10px; padding: 4px 12px; }
.hinweis-zeile { display: flex; align-items: center; gap: 8px; padding: 7px 0; font-size: 13px; }
.hinweis-zeile + .hinweis-zeile { border-top: 1px solid #f0d3b0; }
.hinweis-zeile span { flex: 1; }
.hinweis-zeile .k { flex: none; }
.hinweis-natur {
  margin: 10px 0 0; padding: 9px 12px; font-size: 12.5px; color: var(--tinte);
  background: #fbf3df; border: 1px solid #ead9ad; border-radius: 10px;
}
.buehne.ziel { outline: 3px dashed var(--akzent); outline-offset: -6px; }

/* ---------- Bild-Panel ---------- */
.vorher { display: flex; gap: 10px; align-items: center; }
.vorher canvas { width: 72px; height: 72px; border-radius: 8px; border: 1px solid var(--linie); flex: none; background: #fff; }
.vorher .klein { margin: 0; }
.haken.frei { border: 1.5px solid var(--linie); border-radius: 10px; padding: 9px 12px; background: #fff; margin-top: 12px; }
.haken.frei:has(input:checked) { border-color: var(--akzent); background: var(--akzent-hell); }
.haken.frei span { font-size: 12.5px; color: var(--leise); }
.haken.frei b { font-size: 14px; color: var(--tinte); }
.modi { display: grid; gap: 6px; margin-top: 12px; }
.modi button {
  font: inherit; text-align: left; cursor: pointer; color: inherit;
  background: #fff; border: 1.5px solid var(--linie); border-radius: 10px; padding: 8px 12px;
}
.modi button b { display: block; font-size: 14px; }
.modi button span { font-size: 12.5px; color: var(--leise); }
.modi button.an { border-color: var(--akzent); background: var(--akzent-hell); }

/* ---------- Dialog ---------- */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(480px, calc(100vw - 24px)); background: var(--karte); color: var(--tinte); }
dialog::backdrop { background: rgba(43, 36, 32, .55); }
dialog.bild-editor { width: auto; max-width: calc(100vw - 16px); }
.ed-inhalt { padding: 18px; }
.ed-inhalt h2 { margin: 0 0 10px; font-size: 18px; }
.ed-leiste { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ed-leiste .k.an { border-color: var(--akzent); background: var(--akzent-hell); }
.ed-pinsel { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.ed-pinsel input { accent-color: var(--akzent); width: 150px; }
.ed-inhalt canvas { display: block; max-width: 100%; margin: 0 auto; border-radius: 8px; touch-action: none; background: #fff; }
dialog.breit { width: min(760px, calc(100vw - 24px)); }
.schritt-foto { padding: 22px; }
.schritt-foto h2 { margin: 0 0 12px; font-size: 19px; }
.schritt-foto img { display: block; width: 100%; max-height: 62vh; object-fit: contain; border-radius: 12px; background: #ebe3d6; }
.dialog-form, .danke { padding: 22px; }
.dialog-form h2, .danke h2 { margin: 0 0 12px; font-size: 19px; }
.dialog-form img { display: block; width: 100%; max-height: 260px; object-fit: contain; border-radius: 12px; background: #ebe3d6; }
.dialog-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.fehler { color: var(--rot); font-size: 13.5px; margin: 10px 0 0; }
.danke { text-align: center; }
.code {
  font-size: 30px; font-weight: 700; letter-spacing: .12em; padding: 12px; margin: 8px 0 10px;
  background: var(--akzent-hell); border-radius: 12px; color: var(--akzent); user-select: all;
}

.fuss { text-align: center; font-size: 12px; color: var(--leise); padding: 6px 16px 22px; }
.fuss a { color: inherit; }

/* ---------- Tablet / Handy ---------- */
@media (max-width: 1100px) {
  .haupt-raster { grid-template-columns: minmax(0, 1fr) 320px; }
  .links { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .links .karte { flex: 1 1 260px; }
  .mitte { grid-row: 2; }
  .rechts { grid-row: 2; grid-column: 2; }
}
@media (max-width: 760px) {
  .haupt-raster { display: flex; flex-direction: column; padding: 10px; gap: 12px; }
  .mitte { order: -1; position: sticky; top: 56px; z-index: 10; background: var(--grund); padding-bottom: 4px; width: 100%; }
  .mitte > .klein { display: none; }
  .buehne { height: 44vh; min-height: 260px; }
  .spalte, .links { width: 100%; flex-direction: column; }
  .marke span, .kopf-knoepfe .leise span { display: none; }
  .kopf { padding: 8px 12px; }
  .leer-hinweis { white-space: normal; width: 80%; }
  .drei-leiste span { display: none; }
}
