/* Oberfläche des CMS (nicht die Website selbst).
   --akzent und --dunkel kommen aus cms.json der Website. */
:root {
  --akzent: #C1AB82; --dunkel: #0b0c0f;
  --tinte: #14161b; --text: #3d4350; --leise: #6b7280; --linie: #e7e5e0; --linie-stark: #d6d3cc;
  --papier: #ffffff; --flaeche: #f6f5f2; --flaeche-2: #efede8;
  --blau: #2f6fe4; --gelb: #d48a06; --gelb-hell: #fdf3dc; --gruen: #15803d; --gruen-hell: #e3f4e8; --rot: #c42b2b;
  --leiste: 64px; --seitenleiste: 290px; --rund: 12px;
  --schatten: 0 1px 2px rgba(20,22,27,.05), 0 8px 24px rgba(20,22,27,.06);
  --schatten-gross: 0 24px 64px rgba(10,12,16,.22);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--flaeche); }
h1, h2 { color: var(--tinte); margin: 0 0 .5rem; line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; }
.leise { color: var(--leise); font-size: .88rem; margin: .25rem 0 .75rem; font-weight: 400; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }

/* ── Knöpfe ─────────────────────────────────────────── */
button, .knopf-geist { font: inherit; }
.knopf-haupt, .knopf-zweit, .knopf-geist { display: inline-flex; align-items: center; gap: .4rem; border-radius: 9px; padding: .5rem .95rem;
  cursor: pointer; font-weight: 600; font-size: .9rem; white-space: nowrap; border: 1px solid transparent; text-decoration: none; transition: background .15s, border-color .15s, color .15s, transform .1s; }
.knopf-haupt:active, .knopf-zweit:active { transform: translateY(1px); }
.knopf-haupt { background: var(--akzent); color: #15120b; }
.knopf-haupt:hover:not(:disabled) { filter: brightness(1.08); }
.knopf-zweit { background: #fff; color: var(--tinte); border-color: var(--linie-stark); }
.knopf-zweit:hover:not(:disabled) { background: var(--flaeche); }
.knopf-geist { background: transparent; color: inherit; border-color: transparent; }
.knopf-geist:hover:not(:disabled) { background: rgba(127,127,127,.12); }
.knopf-gefahr { background: var(--rot) !important; color: #fff !important; }
.knopf-haupt:disabled, .knopf-zweit:disabled, .knopf-geist:disabled { opacity: .4; cursor: default; }
.knopf-symbol { background: none; border: 0; font-size: 1.1rem; cursor: pointer; padding: .35rem .55rem; color: inherit; border-radius: 8px; opacity: .75; }
.knopf-symbol:hover { background: rgba(127,127,127,.14); opacity: 1; }

/* ── Anmeldung ──────────────────────────────────────── */
.anmeldung { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(193,171,130,.22), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(193,171,130,.12), transparent 60%), var(--dunkel); }
.anmelde-karte { width: 100%; max-width: 400px; background: #fff; border-radius: 18px; padding: 2.4rem 2.2rem 2rem; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.anmelde-karte h1 { font-size: 1.5rem; }
.anmelde-karte .knopf-haupt { width: 100%; justify-content: center; padding: .8rem; margin-top: .6rem; font-size: 1rem; }
.anmelde-zeichen { width: 44px; height: 44px; border-radius: 12px; background: var(--dunkel); color: var(--akzent); display: grid; place-items: center; font-weight: 800; margin-bottom: 1.2rem; letter-spacing: -.02em; }
label { display: block; font-weight: 600; color: var(--tinte); font-size: .88rem; margin: 0 0 1rem; }
input[type=text], input[type=password], input[type=search], textarea, select {
  display: block; width: 100%; margin-top: .4rem; padding: .65rem .75rem; border: 1px solid var(--linie-stark); border-radius: 9px; font: inherit; color: var(--tinte); background: #fff; font-weight: 400; transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--akzent); box-shadow: 0 0 0 3px rgba(193,171,130,.3); }
textarea { resize: vertical; }
.fehler { color: var(--rot); font-weight: 600; margin: .75rem 0 0; font-size: .9rem; }

/* ── Gerüst ─────────────────────────────────────────── */
.app { height: 100vh; overflow: hidden; display: grid; grid-template-columns: var(--seitenleiste) 1fr; grid-template-rows: var(--leiste) 1fr; }
.leiste { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; padding: 0 .9rem 0 1rem;
  background: var(--dunkel); color: #e8e6e1; border-bottom: 1px solid rgba(255,255,255,.06); }
.leiste-links, .leiste-rechts { display: flex; align-items: center; gap: .45rem; min-width: 0; }
.leiste-mitte { min-width: 0; display: flex; justify-content: center; }
.marke { display: flex; align-items: center; gap: .65rem; }
.marke-zeichen { width: 34px; height: 34px; border-radius: 9px; background: var(--akzent); color: #15120b; display: grid; place-items: center; font-weight: 800; font-size: .85rem; letter-spacing: -.02em; flex: none; }
.marke-text { display: flex; flex-direction: column; line-height: 1.15; }
.marke-text b { color: #fff; font-size: .92rem; }
.marke-text small { color: rgba(232,230,225,.55); font-size: .74rem; }
.seiten-kopf { display: flex; align-items: center; gap: .6rem; min-width: 0; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); padding: .35rem .5rem .35rem .85rem; border-radius: 99px; }
.seiten-titel { font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw; font-size: .9rem; }
.status { display: inline-flex; align-items: center; gap: .35rem; font-size: .74rem; font-weight: 700; padding: .2rem .6rem; border-radius: 99px; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-live { background: var(--gruen-hell); color: var(--gruen); }
.status-entwurf { background: var(--gelb-hell); color: #9a5b00; }
.status-neu { background: #e5edfd; color: var(--blau); }
.status-platzhalter { background: #fff1e0; color: #b45309; }
.leiste .knopf-geist { color: #e8e6e1; }
.leiste .knopf-zweit { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.14); }
.leiste .knopf-zweit:hover:not(:disabled) { background: rgba(255,255,255,.14); }
.leiste .knopf-zweit.hervor { background: #fff; color: var(--tinte); border-color: #fff; }
.leiste .knopf-warnung { color: #f5b48a; }
.umschalter { display: inline-flex; background: rgba(255,255,255,.07); border-radius: 9px; padding: 3px; }
.umschalter button { border: 0; background: transparent; padding: .38rem .7rem; cursor: pointer; color: rgba(232,230,225,.7); border-radius: 7px; font-size: .84rem; font-weight: 600; }
.umschalter button.aktiv { background: rgba(255,255,255,.14); color: #fff; }

/* ── Seitenleiste ───────────────────────────────────── */
.seitenleiste { background: var(--papier); border-right: 1px solid var(--linie); display: flex; flex-direction: column; min-height: 0; }
.suche { padding: .9rem .9rem .5rem; }
.suche input { margin: 0; padding-left: 2.1rem; background: var(--flaeche) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E") no-repeat .75rem center; border-color: transparent; }
#seitenliste { flex: 1; overflow-y: auto; padding: .2rem .6rem 1rem; }
.lade { padding: .6rem; }
.seitenleiste details { margin-bottom: .15rem; }
.seitenleiste summary { cursor: pointer; display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--tinte); padding: .55rem .5rem; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .05em; border-radius: 8px; list-style: none; }
.seitenleiste summary::-webkit-details-marker { display: none; }
.seitenleiste summary::before { content: "›"; display: inline-block; width: .7rem; color: var(--leise); transition: transform .15s; font-size: 1rem; }
.seitenleiste details[open] > summary::before { transform: rotate(90deg); }
.seitenleiste summary:hover { background: var(--flaeche); }
.anzahl { margin-left: auto; color: var(--leise); font-weight: 600; font-size: .75rem; background: var(--flaeche); padding: .05rem .45rem; border-radius: 99px; }
.seite { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .5rem .6rem .5rem 1.25rem; border-radius: 9px; cursor: pointer; position: relative; }
.seite:hover { background: var(--flaeche); }
.seite.aktiv { background: var(--flaeche-2); }
.seite.aktiv::before { content: ""; position: absolute; left: .45rem; top: .55rem; bottom: .55rem; width: 3px; border-radius: 3px; background: var(--akzent); }
.seite-titel { display: flex; align-items: center; gap: .4rem; color: var(--tinte); font-size: .88rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seite-pfad { display: block; color: var(--leise); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trenner { margin: .7rem .6rem .25rem 1.25rem; padding-top: .6rem; border-top: 1px solid var(--linie); color: var(--leise); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.punkt { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none; }
.punkt-entwurf { background: var(--gelb); }
.punkt-neu { background: var(--blau); }
.punkt-live { background: var(--gruen); }
.neu-knopf { display: block; width: calc(100% - .75rem); margin: .1rem 0 .35rem .75rem; text-align: left; border: 1px dashed var(--linie-stark); background: none; border-radius: 9px;
  padding: .45rem .6rem; color: var(--tinte); font-weight: 600; font-size: .84rem; cursor: pointer; }
.neu-knopf:hover { border-color: var(--akzent); background: rgba(193,171,130,.1); }
.schnell { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; margin: .1rem .25rem .8rem; }
.schnell-knopf { display: grid; grid-template-columns: auto 1fr; column-gap: .5rem; align-items: center; text-align: left; border: 1px solid var(--linie); background: var(--flaeche);
  border-radius: 11px; padding: .55rem .6rem; cursor: pointer; color: var(--tinte); font-weight: 700; font-size: .84rem; line-height: 1.15; transition: border-color .15s, background .15s; }
.schnell-knopf span { grid-row: span 2; width: 26px; height: 26px; border-radius: 8px; background: var(--dunkel); color: var(--akzent); display: grid; place-items: center; font-size: 1.05rem; }
.schnell-knopf small { color: var(--leise); font-weight: 500; font-size: .72rem; }
.schnell-knopf:hover { border-color: var(--akzent); background: #fff; }
.seitenleiste-fuss { border-top: 1px solid var(--linie); padding: .75rem 1rem; font-size: .8rem; color: var(--leise); display: flex; align-items: center; gap: .5rem; }

/* ── Projektübersicht (Admin) ───────────────────────── */
.modus-projekte { grid-template-columns: 1fr; }
.modus-projekte .seitenleiste, .modus-projekte .buehne, .modus-projekte .leiste-mitte > *, .modus-projekte .leiste-rechts > :not(#knopf-abmelden) { display: none !important; }
.projekte { overflow-y: auto; padding: 2.4rem clamp(1rem, 4vw, 3rem) 3rem; }
.projekte-kopf { max-width: 1180px; margin: 0 auto 1.6rem; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 0 1rem; }
.projekte-kopf .ueberzeile { grid-column: 1 / -1; }
.projekte-kopf h1 { font-size: 1.9rem; margin: 0; }
.projekte-kopf input { width: 260px; margin: 0; }
.projekt-gitter { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem; }
.projekt-karte { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; text-align: left; background: #fff; border: 1px solid var(--linie); border-radius: 16px;
  padding: 1.2rem 1.2rem 1.1rem; cursor: pointer; box-shadow: var(--schatten); transition: transform .15s, box-shadow .15s, border-color .15s; font: inherit; color: inherit; }
.projekt-karte:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--akzent); box-shadow: 0 2px 4px rgba(20,22,27,.05), 0 16px 36px rgba(20,22,27,.1); }
.projekt-karte:disabled { opacity: .6; cursor: default; }
.projekt-zeichen { width: 42px; height: 42px; border-radius: 11px; background: var(--dunkel); color: var(--akzent); display: grid; place-items: center; font-weight: 800; margin-bottom: .6rem; }
.projekt-name { font-weight: 700; color: var(--tinte); font-size: 1.02rem; }
.projekt-adresse { color: var(--leise); font-size: .84rem; }
.projekt-zahlen { display: flex; align-items: center; gap: .6rem; margin-top: .7rem; font-size: .84rem; color: var(--text); }
.projekt-letzte { color: var(--leise); font-size: .78rem; margin-top: .35rem; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.status-fehler { background: #fde8e8; color: var(--rot); margin-top: .7rem; }
.knopf-projekte { font-size: .84rem; padding: .4rem .65rem; margin-right: .2rem; }

/* ── Bühne ──────────────────────────────────────────── */
.buehne { position: relative; overflow: hidden; background: var(--flaeche); display: flex; justify-content: center; padding: 14px; }
.rahmen { position: relative; width: 100%; height: 100%; border-radius: var(--rund); overflow: hidden; box-shadow: var(--schatten); background: #fff; transition: width .25s; }
.buehne.handy .rahmen { width: 392px; border-radius: 28px; border: 8px solid var(--tinte); }
.rahmen iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.laden { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .7rem; background: rgba(246,245,242,.85); color: var(--leise); font-weight: 600; backdrop-filter: blur(2px); }
.kreisel { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--linie-stark); border-top-color: var(--akzent); animation: dreh .8s linear infinite; }
@keyframes dreh { to { transform: rotate(360deg); } }

.willkommen { align-self: center; max-width: 560px; width: 100%; background: #fff; border-radius: 18px; padding: 2.4rem 2.6rem; box-shadow: var(--schatten); }
.ueberzeile { text-transform: uppercase; letter-spacing: .08em; font-size: .74rem; font-weight: 700; color: #9a8559; margin: 0 0 .4rem; }
.willkommen h1 { font-size: 1.6rem; margin-bottom: 1.4rem; }
.kennzahlen { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: 1.6rem; }
.kennzahlen div { background: var(--flaeche); border-radius: 12px; padding: .9rem 1rem; }
.kennzahlen b { display: block; font-size: 1.6rem; color: var(--tinte); line-height: 1.1; }
.kennzahlen span { color: var(--leise); font-size: .84rem; }
.schritte { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.schritte li { counter-increment: s; display: grid; grid-template-columns: 2rem 1fr; column-gap: .6rem; margin: 0 0 .9rem; }
.schritte li::before { content: counter(s); grid-row: span 2; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--dunkel); color: var(--akzent); display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.schritte b { color: var(--tinte); }
.schritte span { color: var(--leise); font-size: .88rem; }
.schritte em { font-style: normal; font-weight: 800; color: #9a8559; }

/* ── Tafeln rechts ──────────────────────────────────── */
.tafel { position: fixed; top: calc(var(--leiste) + 14px); right: 14px; width: 410px; max-width: calc(100vw - 28px); max-height: calc(100vh - var(--leiste) - 28px); overflow-y: auto;
  background: #fff; border-radius: 16px; padding: 1.3rem 1.3rem 1.1rem; box-shadow: var(--schatten-gross); z-index: 20; animation: rein .2s ease-out; }
@keyframes rein { from { opacity: 0; transform: translateY(-6px); } }
.tafel-kopf { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .6rem; }
.tafel-kopf h2 { margin: 0; }
.tafel-kopf .knopf-symbol { color: var(--leise); }
.tafel-fuss { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.1rem; }
.tafel .knopf-geist, .dialog .knopf-geist { color: var(--text); }
.zaehler { float: right; font-weight: 500; color: var(--leise); font-size: .78rem; }
.zaehler.zu-lang { color: var(--rot); font-weight: 700; }
.google-vorschau { border: 1px solid var(--linie); border-radius: 12px; padding: .9rem 1rem; margin: .2rem 0 1.1rem; font-family: arial, sans-serif; background: #fff; }
.g-adresse { color: #4d5156; font-size: .78rem; }
.g-titel { color: #1a0dab; font-size: 1.12rem; margin: .2rem 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-text { color: #4d5156; font-size: .84rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bild-vorschau { width: 100%; max-height: 240px; object-fit: contain; background: var(--flaeche) repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 16px 16px; border-radius: 12px; margin: .2rem 0 .8rem; }
.datei-knopf { display: inline-flex; margin: 0; }
.datei-knopf input { display: none; }

/* ── Dialoge ────────────────────────────────────────── */
.dialog-grund { position: fixed; inset: 0; background: rgba(10,12,16,.55); display: grid; place-items: center; z-index: 50; padding: 1rem; animation: blende .15s; }
@keyframes blende { from { opacity: 0; } }
.dialog { background: #fff; border-radius: 18px; padding: 1.6rem; width: 100%; max-width: 470px; box-shadow: var(--schatten-gross); max-height: calc(100vh - 2rem); overflow-y: auto; }
.dialog-breit { max-width: 560px; }
.dialog small { display: block; margin-top: .35rem; font-weight: 400; }
.liste-pfade { max-height: 40vh; overflow-y: auto; padding-left: 1.2rem; }
.liste-pfade li { margin: .2rem 0; }
.adresse-feld { display: flex; align-items: stretch; margin-top: .4rem; border: 1px solid var(--linie-stark); border-radius: 9px; overflow: hidden; }
.adresse-feld span { background: var(--flaeche); color: var(--leise); padding: .65rem .2rem .65rem .75rem; font-weight: 500; white-space: nowrap; }
.adresse-feld input { border: 0; margin: 0; border-radius: 0; padding-left: .1rem; }
.adresse-feld input:focus { box-shadow: none; }
.neu-bild { margin: 0 0 1rem; }
.feld-titel { display: block; font-weight: 600; color: var(--tinte); font-size: .88rem; margin-bottom: .4rem; }
.neu-bild-zeile { display: flex; align-items: center; gap: .8rem; margin-bottom: .8rem; flex-wrap: wrap; }
.neu-bild-zeile img { width: 96px; height: 54px; object-fit: cover; border-radius: 8px; }
.neu-bild-zeile .leise { margin: 0; }

/* ── Meldungen ──────────────────────────────────────── */
.meldung { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--tinte); color: #fff; padding: .8rem 1.15rem; border-radius: 12px; z-index: 60;
  box-shadow: var(--schatten-gross); max-width: calc(100vw - 32px); font-weight: 500; display: flex; align-items: center; gap: .6rem; animation: hoch .25s ease-out; }
@keyframes hoch { from { opacity: 0; transform: translate(-50%, 8px); } }
.meldung::before { font-weight: 800; }
.meldung-ok { background: #123d24; }
.meldung-ok::before { content: "✓"; color: #7ee2a1; }
.meldung-fehler { background: #5c1414; }
.meldung-fehler::before { content: "!"; color: #ffb4b4; }

/* ── Kleine Bildschirme ─────────────────────────────── */
.nur-handy { display: none; }
@media (max-width: 1180px) {
  .marke-text small, #knopf-live { display: none; }
  .seiten-titel { max-width: 22vw; }
}
@media (max-width: 960px) {
  .projekte-kopf { grid-template-columns: 1fr; }
  .projekte-kopf input { width: 100%; margin-top: 1rem; }
  .app { grid-template-columns: 1fr; }
  .nur-handy { display: inline-block; }
  .seitenleiste { position: fixed; top: var(--leiste); bottom: 0; left: 0; width: min(320px, 85vw); z-index: 30; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--schatten-gross); }
  .liste-offen .seitenleiste { transform: none; }
  .umschalter, #knopf-infos, .marke-text, .status-platzhalter { display: none; }
  .leiste { padding: 0 .5rem; gap: .4rem; }
  .leiste-rechts { gap: .25rem; }
  .buehne { padding: 0; }
  .rahmen { border-radius: 0; }
}
