:root { --flow: cubic-bezier(0.4, 0, 0.15, 1); }
html, body { height: 100%; }
body { overflow: hidden; }

/* ---- Anmeldung: heller Himmel wie auf der Startseite ---- */
.anmeldung {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden;
  color: #0e1638;
  background: linear-gradient(180deg, #4f7fd9 0%, #a8c6f5 55%, #e3eeff 100%);
}
.anm-himmel { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; display: block; }
.anmeldung::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='k'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23k)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.05; mix-blend-mode: overlay;
}
.anmeldung .box {
  position: relative; z-index: 2;
  width: min(430px, 100%); text-align: center; padding: 44px 36px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  box-shadow: 0 40px 90px -40px rgba(14, 22, 56, 0.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  backdrop-filter: blur(22px) saturate(1.3);
}
.anmeldung .wort { display: inline-flex; font-size: 1.55rem; margin-bottom: 28px; color: #0e1638; }
.anmeldung h1 { font-size: 1.45rem; margin-bottom: 8px; letter-spacing: -0.025em; color: #0e1638; }
.anmeldung p { color: #47517e; font-size: 0.95rem; margin: 0 0 26px; }
.anmeldung .feld { background: rgba(255, 255, 255, 0.55); border-color: rgba(14, 22, 56, 0.18); color: #0e1638; }
.anmeldung .feld:focus { border-color: var(--akzent); box-shadow: 0 0 0 3px rgba(57, 50, 220, 0.12); }
.anmeldung .feld::placeholder { color: #8a93b6; }
.anmeldung .code-feld { text-align: center; letter-spacing: 0.28em; font-weight: 500; font-size: 1.15rem; text-transform: uppercase; }
.anmeldung .knopf { background: #0e1638; color: #f5f8ff; }
@media (pointer: fine) { .anmeldung .knopf:hover { background: var(--akzent); color: #fff; } }
.anmeldung .fehler { color: #c62a2a; font-size: 0.9rem; min-height: 1.2em; margin-top: 12px; font-weight: 500; }
.anmeldung .fuss { margin-top: 24px; font-size: 0.84rem; color: #5a6591; }

/* ---- Grundgerüst ---- */
.editor { display: none; height: 100dvh; flex-direction: column; }

.leiste { height: 58px; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; background: var(--flaeche); border-bottom: 1px solid var(--linie); }
.leiste .links { display: flex; align-items: center; gap: 12px; min-width: 0; }
.leiste .marke { font-size: 1.05rem; padding-right: 12px; border-right: 1px solid var(--linie); }
.leiste .seitenname { font-weight: 500; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leiste .host { color: var(--gedimmt); font-size: 0.82rem; }
.leiste .rechts { display: flex; align-items: center; gap: 10px; }

.split { flex: 1; display: flex; min-height: 0; }

/* ---- Vorschau ---- */
.vorschau { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg-muted); }
.vorschau-kopf { flex: none; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 14px; color: var(--gedimmt); font-size: 0.82rem; }
.vorschau-kopf .ampel { display: flex; gap: 6px; }
.vorschau-kopf .ampel i { width: 11px; height: 11px; border-radius: 50%; background: #c6ccd6; }
.vorschau-kopf .adresse { flex: 1; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; padding: 5px 12px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vorschau-rahmen { flex: 1; margin: 0 14px 14px; border-radius: 14px; overflow: hidden; background: #fff; box-shadow: var(--schatten); position: relative; }
.vorschau-rahmen iframe { width: 100%; height: 100%; border: 0; display: block; }
.vorschau-hinweis { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 4;
  background: var(--tinte); color: #fcfcfc; font-size: 0.75rem; font-weight: 500; padding: 6px 14px; border-radius: 999px; letter-spacing: 0.02em;
  display: none; align-items: center; gap: 7px; pointer-events: none; }
.vorschau-hinweis.zeig { display: inline-flex; }

/* ---- Panel ---- */
.panel { width: 400px; flex: none; background: var(--flaeche); border-left: 1px solid var(--linie); display: flex; flex-direction: column; min-height: 0; }
.tabs { flex: none; display: flex; padding: 10px 12px 0; gap: 4px; border-bottom: 1px solid var(--linie); }
.tab { flex: 1; padding: 10px; border: 0; background: none; font: inherit; font-weight: 500; font-size: 0.82rem; color: var(--gedimmt);
  cursor: pointer; border-radius: 9px 9px 0 0; position: relative; text-transform: uppercase; letter-spacing: 0.05em; }
.tab.aktiv { color: var(--akzent); }
.tab.aktiv::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--akzent); border-radius: 2px; }
.tab .zahl { font-size: 0.72rem; background: var(--akzent-weich); color: var(--akzent-tief); border-radius: 999px; padding: 1px 7px; margin-left: 5px; }

.tabinhalt { flex: 1; overflow-y: auto; min-height: 0; }
.tabinhalt[hidden] { display: none; }

/* Felder */
.felder { padding: 8px 16px 20px; }
.gruppe { margin-top: 18px; }
.gruppe > h4 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gedimmt); margin: 0 0 10px; font-weight: 500; }
.feldzeile { margin-bottom: 15px; scroll-margin-top: 14px; }
.feldzeile > label { display: flex; align-items: center; gap: 7px; font-size: 0.85rem; font-weight: 500; margin-bottom: 6px; color: var(--tinte-alt); }
.feldzeile.markiert > label { color: var(--akzent-tief); }
.feldzeile.markiert .feld { border-color: var(--akzent); box-shadow: 0 0 0 3px var(--akzent-weich); }
.mini { font-size: 0.72rem; color: var(--gedimmt); font-weight: 500; }

.bildfeld { display: flex; gap: 12px; align-items: flex-start; }
.bildfeld .vorschaubild { width: 74px; height: 56px; flex: none; border-radius: 9px; object-fit: cover; background: var(--flaeche-2); border: 1px solid var(--linie); }
.bildfeld .rechtsteil { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }

.leerhinweis { padding: 40px 20px; text-align: center; color: var(--gedimmt); font-size: 0.9rem; }

/* Einblendung (Angebot) */
.einbl-karte { margin: 12px 16px 6px; border: 1px solid var(--linie); background: linear-gradient(180deg, var(--akzent-weich), var(--flaeche)); border-radius: 14px; padding: 15px 16px; }
.einbl-kopf h4 { font-size: 0.95rem; font-weight: 500; margin: 0 0 3px; letter-spacing: -0.01em; }
.einbl-hinweis { font-size: 0.8rem; color: var(--gedimmt); margin: 0; line-height: 1.4; }
.schalter-zeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; padding: 10px 0; border-top: 1px solid var(--linie); border-bottom: 1px solid var(--linie); }
.schalter-label { font-size: 0.9rem; font-weight: 500; }
.schalter { width: 46px; height: 27px; flex: none; border: 0; border-radius: 999px; background: var(--linie-stark); position: relative; cursor: pointer; transition: background 0.18s; padding: 0; }
.schalter::after { content: ''; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform 0.18s; }
.schalter.an { background: var(--akzent); }
.schalter.an::after { transform: translateX(19px); }
.einbl-felder { display: flex; flex-direction: column; }
.einbl-felder .feldzeile { margin-bottom: 13px; }
.einbl-felder > .knopf { align-self: flex-start; }

/* Chat */
.chat { display: flex; flex-direction: column; height: 100%; }
.chatlauf { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; }
.blase { max-width: 84%; padding: 10px 14px; border-radius: 15px; font-size: 0.92rem; line-height: 1.5; white-space: pre-wrap; }
.blase.ich { align-self: flex-end; background: var(--akzent); color: #fff; border-bottom-right-radius: 5px; }
.blase.bot { align-self: flex-start; background: var(--flaeche-2); border: 1px solid var(--linie); border-bottom-left-radius: 5px; }
.blase.bot .aenderungen { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.blase.bot .aend { font-size: 0.82rem; background: var(--gut-weich); color: var(--gut); border-radius: 8px; padding: 5px 9px; font-weight: 500; }
.chat-vorschlaege { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 16px 12px; }
.chip { border: 1px solid var(--linie-stark); background: var(--flaeche); border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 0.82rem; color: #333a45; cursor: pointer; }
.chip:hover { border-color: var(--akzent); color: var(--akzent-tief); background: var(--akzent-weich); }
.chateingabe { flex: none; border-top: 1px solid var(--linie); padding: 12px; display: flex; gap: 8px; align-items: flex-end; }
.chateingabe textarea { flex: 1; max-height: 120px; min-height: 44px; }
.chatsende { flex: none; height: 44px; width: 44px; padding: 0; border-radius: 11px; display: grid; place-items: center; }
.chatsende svg { width: 19px; height: 19px; }
.tippt { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; }
.tippt i { width: 7px; height: 7px; border-radius: 50%; background: #b7bfcc; animation: hopp 1s infinite; }
.tippt i:nth-child(2){ animation-delay: .15s; } .tippt i:nth-child(3){ animation-delay: .3s; }
@keyframes hopp { 0%,60%,100%{ transform: translateY(0); opacity:.5 } 30%{ transform: translateY(-5px); opacity:1 } }

/* Fußleiste */
.aktionsleiste { flex: none; border-top: 1px solid var(--linie); padding: 12px 16px; display: flex; align-items: center; gap: 10px; background: var(--flaeche); }
.aktionsleiste .stand { flex: 1; font-size: 0.83rem; color: var(--gedimmt); display: flex; align-items: center; gap: 7px; }
.aktionsleiste .stand .punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--gut); }
.aktionsleiste .stand.geaendert .punkt { background: var(--warn); }

@media (max-width: 860px) {
  .split { flex-direction: column; }
  .panel { width: 100%; border-left: 0; border-top: 1px solid var(--linie); max-height: 52%; }
  .vorschau { min-height: 42%; }
}


/* Übersicht nach dem Login: Begrüßung + klickbare Website-Kachel */
.uebersicht { display: none; flex-direction: column; min-height: 100dvh; }
.u-leiste { height: 58px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; background: var(--flaeche); border-bottom: 1px solid var(--linie); }
.u-leiste .marke { font-size: 1.05rem; }
.u-optionen { display: flex; align-items: center; gap: 10px; }
.u-inhalt { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; padding: 48px 20px; }
.u-kopf { text-align: center; }
.u-gruss { color: var(--gedimmt); font-size: 1.02rem; margin: 0 0 6px; min-height: 1.45em; }
.u-gruss.tippt-gruss::after { content: ''; display: inline-block; width: 1px; height: 1em; background: currentColor; margin-left: 3px; vertical-align: -0.12em; animation: grussPuls 0.9s steps(2) infinite; }
@keyframes grussPuls { 50% { opacity: 0; } }
.u-titel { font-size: 1.7rem; letter-spacing: -0.03em; }
.website-kachel { width: min(940px, 100%); padding: 0; border: 1px solid var(--linie); border-radius: 16px; background: var(--flaeche); box-shadow: var(--schatten); cursor: pointer; overflow: hidden; text-align: left; font: inherit; color: inherit; display: block; transition: box-shadow .35s var(--ease), transform .25s var(--ease), border-color .25s var(--ease); }
@media (pointer: fine) { .website-kachel:hover { box-shadow: var(--schatten-tief); transform: translateY(-4px); border-color: var(--linie-stark); } }
.website-kachel:focus-visible { outline: 2px solid var(--akzent); outline-offset: 3px; }
.kachel-rahmen { position: relative; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; background: var(--flaeche-2); border-bottom: 1px solid var(--linie); }
.kachel-rahmen iframe { position: absolute; top: 0; left: 0; width: 1400px; height: 875px; border: 0; transform-origin: top left; pointer-events: none; }
.kachel-fuss { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; gap: 12px; }
.kachel-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kachel-name { font-weight: 500; font-size: 1rem; }
.kachel-host { color: var(--gedimmt); font-size: 0.85rem; }
.kachel-cta { color: var(--akzent); font-weight: 500; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }

/* Weißer Begrüßungs-Screen vor dem Workspace: die fette Anrede tippt sich */
.gruss-schirm { display: none; align-items: center; justify-content: center; min-height: 100dvh; padding: 28px; background: #fff; text-align: center; }
.gruss-text { margin: 0; font-size: clamp(1.9rem, 5.2vw, 3.1rem); font-weight: 700; letter-spacing: -0.035em; color: var(--tinte); line-height: 1.1; min-height: 1.1em; }
.gruss-text.tippt-gruss::after { content: ''; display: inline-block; width: 2px; height: 0.92em; background: currentColor; margin-left: 5px; vertical-align: -0.08em; animation: grussPuls 0.9s steps(2) infinite; }
@keyframes grussPuls { 50% { opacity: 0; } }

/* Ruhige, überlappende Crossfades zwischen den Vollbild-Szenen.
   Nur mit JS aktiv; ohne JS bleiben die inneren Szenen via display:none aus. */
html.js .anmeldung, html.js .gruss-schirm, html.js .uebersicht, html.js .editor {
  position: fixed; inset: 0;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .64s var(--flow), visibility 0s linear .64s;
  will-change: opacity;
}
html.js .gruss-schirm, html.js .uebersicht, html.js .editor { display: flex; }
html.js .anmeldung.aktiv, html.js .gruss-schirm.aktiv, html.js .uebersicht.aktiv, html.js .editor.aktiv {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity .64s var(--flow);
}
@media (prefers-reduced-motion: reduce) {
  html.js .anmeldung, html.js .gruss-schirm, html.js .uebersicht, html.js .editor { transition: none !important; }
}
