:root { --bg:#0a0a0b; --ink:#22201c; --paper:#f4efe4; --accent:#e07a5f; --muted:rgba(255,255,255,.64); --glass:rgba(10,10,11,.74); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scrollbar-width: none; } html::-webkit-scrollbar { display: none; } /* sonst liegt die Leiste über dem rechten Bildrand */
html, body { margin: 0; background: var(--bg); color: #fff; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow-x: hidden; }
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; }
.panel { background: var(--glass); border: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.fade { transition: opacity .35s, transform .35s; }
.hide { opacity: 0 !important; pointer-events: none !important; }
.brand { position: fixed; top: 18px; left: 24px; z-index: 8; font: 600 15px/1 system-ui, sans-serif; letter-spacing: .02em; padding: 8px 12px; border-radius: 999px; max-width: calc(100vw - 48px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand b { color: var(--accent); font-weight: 600; }
.brand span { font-weight: 400; color: rgba(255,255,255,.8); }
.hero { position: fixed; left: 24px; top: 72px; z-index: 5; max-width: 420px; pointer-events: none; }
.hero h1 { font: 500 clamp(30px, 4vw, 46px)/1.14 Georgia, "Playfair Display", serif; margin: 0 0 12px; padding-bottom: 4px; }
.hero h1 em { color: var(--accent); font-style: italic; }
.hero p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.cap { position: fixed; left: 24px; bottom: 24px; z-index: 5; padding: 14px 18px; border-radius: 14px; min-width: 230px; max-width: calc(50vw - 80px); pointer-events: none; background: rgba(12,12,13,.96) !important; }
.cap small { display: block; color: var(--accent); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 4px; }
.cap strong { font: 500 22px/1.2 Georgia, "Playfair Display", serif; }
.cap span { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
/* Raumleiste: antippen springt zum Raum */
.rooms { position: fixed; right: 24px; top: 18px; z-index: 8; margin: 0; padding: 4px; border-radius: 999px; display: flex; gap: 2px; max-width: calc(100vw - 360px); overflow-x: auto; scrollbar-width: none; }
.rooms::-webkit-scrollbar { display: none; }
.rooms button { flex: none; font: 500 12px system-ui, sans-serif; color: rgba(255,255,255,.62); background: none; border: 0; border-radius: 999px; padding: 8px 12px; cursor: pointer; white-space: nowrap; transition: color .25s, background .25s; }
.rooms button:hover { color: #fff; }
.rooms button.on { background: var(--accent); color: #fff; }
#veil { position: fixed; inset: 0; z-index: 5; background: var(--bg); opacity: 0; pointer-events: none; }
.ui { position: absolute; inset: 0; opacity: 0; transition: opacity .3s; pointer-events: none; }
.ui.show { opacity: 1; }
.ui .split { pointer-events: auto; }
/* Foto ist der Star: Rahmen im Seitenverhältnis des Bildes, so groß wie möglich (Größe setzt viewer.js) */
.photo { position: fixed; inset: 0; z-index: 6; opacity: 0; pointer-events: none; touch-action: pan-y; user-select: none; -webkit-user-select: none; background: var(--bg); overflow: hidden; }
.photo.on { pointer-events: auto; }
.photo .bg { position: absolute; inset: -60px; width: calc(100% + 120px); height: calc(100% + 120px); object-fit: cover; filter: blur(30px) brightness(.38) saturate(.85); }
.frame { position: absolute; border-radius: 14px; overflow: hidden; cursor: ew-resize; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.layer { position: absolute; inset: 0; overflow: hidden; }
.layer img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform-origin: 50% 55%; will-change: transform; -webkit-user-drag: none; }
.layer.vor { clip-path: inset(0 calc(100% - var(--x, 50%)) 0 0); }
.split { position: absolute; top: 0; bottom: 0; left: var(--x, 50%); width: 2px; margin-left: -1px; background: rgba(255,255,255,.9); z-index: 2; }
.split button { position: absolute; top: 50%; left: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; border: 2px solid #fff; background: rgba(10,10,11,.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #fff; font: 600 24px/1 system-ui, sans-serif; cursor: ew-resize; touch-action: none; }
.split button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.tag { position: absolute; top: 14px; z-index: 2; font: 500 12px system-ui, sans-serif; letter-spacing: .06em; padding: 6px 12px; border-radius: 999px; background: rgba(10,10,11,.6); transition: opacity .2s; }
.tag.l { left: 14px; } .tag.r { right: 14px; }
.hinweis { position: absolute; right: 12px; bottom: 12px; z-index: 3; font: 500 11px/1.2 system-ui, sans-serif; padding: 5px 10px; border-radius: 999px; background: rgba(10,10,11,.66); color: rgba(255,255,255,.9); pointer-events: none; }
.photo.pano .vor, .photo.pano .split, .photo.pano .tag.l { display: none; }
.drag-hint { position: absolute; top: calc(50% + 36px); left: 50%; transform: translateX(-50%); white-space: nowrap; font: 500 13px system-ui, sans-serif; color: #fff; background: rgba(10,10,11,.72); padding: 6px 12px; border-radius: 999px; transition: opacity .3s; pointer-events: none; }
/* Vorschau-Wasserzeichen über den Fotos */
/* zweimal, oben und unten: die Mitte bleibt frei für den Schieber */
.wm { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.wm span { position: absolute; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); font: 800 clamp(34px, 6.5vw, 96px)/1 system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.42); -webkit-text-stroke: 1px rgba(0,0,0,.18); text-shadow: 0 2px 14px rgba(0,0,0,.35); white-space: nowrap; }
.wm span:first-child { top: 24%; } .wm span:last-child { top: 78%; }
/* Untere Leiste: Raum-Pille links, Vor/Zurück mittig, Ansichten rechts */
.bar { position: fixed; left: 24px; right: 24px; bottom: 20px; z-index: 9; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px; pointer-events: none; }
.bar > * { pointer-events: auto; }
.pill { justify-self: start; display: flex; align-items: center; gap: 4px; min-width: 0; max-width: min(640px, 100%); min-height: 44px; padding: 10px 16px; border-radius: 22px; font-size: 14px; line-height: 1.35; color: rgba(255,255,255,.88); background: rgba(12,12,13,.86); }
.pill b { font-weight: 600; color: #fff; }
#pillText { min-width: 0; }
.nav { justify-self: center; display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: 999px; }
.nav button, .edit button, .pill button { min-width: 44px; height: 44px; border: 0; border-radius: 999px; background: none; color: #fff; font: 500 22px/1 system-ui, sans-serif; cursor: pointer; }
.nav button:hover:not(:disabled), .edit button:hover, .pill button:hover { background: rgba(255,255,255,.12); }
.nav button:disabled { opacity: .3; cursor: default; }
.nav button:focus-visible, .edit button:focus-visible, .pill button:focus-visible, .thumbs button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.nav span { min-width: 44px; text-align: center; font: 500 13px system-ui, sans-serif; color: var(--muted); }
.nav span:empty { display: none; }
.implan .nav { position: fixed; left: 24px; } /* Grundriss: links über der Bildunterschrift, nicht auf dem Plan (bottom setzt hud()) */
.pill button { flex: none; align-self: center; width: 44px; height: 44px; margin: -10px -12px -10px 0; font-size: 18px; }
.thumbs { justify-self: end; display: flex; gap: 8px; }
.thumbs button { position: relative; width: 92px; height: 62px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: #222; cursor: pointer; opacity: .7; transition: opacity .2s, border-color .2s; }
.thumbs button.on { border-color: #fff; opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs em { position: absolute; inset: auto 0 0 0; font: 600 11px/1.7 system-ui, sans-serif; font-style: normal; color: #fff; background: rgba(10,10,11,.7); }
.edit { position: fixed; top: 70px; right: 24px; z-index: 9; display: flex; gap: 8px; }
.edit button { height: 44px; padding: 0 16px; font-size: 14px; font-weight: 600; background: rgba(12,12,13,.86); border: 1px solid rgba(255,255,255,.14); }
.cta { position: fixed; left: 24px; top: 50%; transform: translateY(-50%); z-index: 7; max-width: 440px; padding: 26px; border-radius: 18px; background: rgba(12,12,13,.96) !important; }
.cta h2 { font: 500 28px/1.18 Georgia, "Playfair Display", serif; margin: 0 0 18px; }
.btn { display: inline-block; min-height: 48px; box-sizing: border-box; background: var(--accent); color: #fff; text-decoration: none; font-weight: 600; font-size: 15px; padding: 13px 22px; border-radius: 12px; }
.btn:hover { background: #d4694e; }
#fallback { position: fixed; inset: 0; z-index: 4; display: grid; place-items: center; background: var(--bg); }
#fallback[hidden] { display: none; }
#fallback img { height: 80vh; max-width: 100%; object-fit: contain; border-radius: 12px; }
#fallback p { position: absolute; bottom: 24px; left: 24px; right: 24px; margin: 0; color: var(--muted); font-size: 14px; text-align: center; }
.lbl { transform-origin: 50% 50%; color: var(--ink); text-align: center; font: 600 12px/1.25 Georgia, serif; white-space: nowrap; pointer-events: none; background: var(--paper); padding: 2px 6px; border-radius: 4px; }
.lbl span { display: block; font: 400 11px/1.3 system-ui, sans-serif; opacity: .75; }
.sheet-title { color: var(--ink); font: 600 13px Georgia, serif; white-space: nowrap; pointer-events: none; }
.sheet-title.floor { background: var(--paper); padding: 3px 10px; border-radius: 999px; font-size: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.pano-hint { display: none; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; white-space: nowrap; font: 600 14px system-ui, sans-serif; color: #fff; background: rgba(10,10,11,.72); padding: 8px 14px; border-radius: 999px; pointer-events: none; }
.photo.pano .pano-hint { display: block; animation: hinweisWeg .4s ease 4s forwards; }
.photo.pano.gezogen .pano-hint { display: none; } /* nach dem ersten Ziehen weg */
@keyframes hinweisWeg { to { opacity: 0; visibility: hidden; } }
.photo.pano .frame { cursor: grab; }
/* ?auto=1: nur Bild, Pille und Hinweis (für die Videoaufnahme) */
.auto .brand, .auto .hero, .auto .cap, .auto .rooms, .auto .nav, .auto .thumbs, .auto .edit, .auto .drag-hint, .auto .split button { display: none !important; }
@media (max-width: 640px) {
  .brand { left: 16px; top: 14px; max-width: calc(100vw - 32px); }
  .hero { left: 16px; right: 16px; top: 62px; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 14px; }
  .cap { left: 16px; right: 16px; bottom: 84px; min-width: 0; max-width: none; padding: 10px 14px; }
  .cap strong { font-size: 18px; }
  .rooms { left: 0; right: 0; top: 58px; max-width: none; border-radius: 0; border-width: 1px 0; padding: 4px 12px; scroll-snap-type: x proximity; -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
  .rooms button { min-height: 44px; padding: 12px 12px; font-size: 13px; scroll-snap-align: start; }
  .rooms { padding-right: 72px; } /* letzter Raum lässt sich ganz aus dem Verlauf schieben */
  .edit { top: 116px; right: 16px; }
  .edit button { height: 48px; }
  .bar { left: 16px; right: 16px; bottom: 16px; display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
  .thumbs { order: 1; align-self: flex-end; }
  .pill { order: 2; align-self: flex-start; max-width: 100%; border-radius: 18px; font-size: 13.5px; }
  .nav { order: 3; align-self: center; }
  .cta { left: 16px; right: 16px; top: auto; bottom: 84px; transform: none; padding: 20px; max-width: none; }
  .cta h2 { font-size: 23px; }
  .lbl { font-size: 9px; padding: 1px 3px; } .lbl span { font-size: 8px; }
  .sheet-title { font-size: 9px; }
}

/* Text bearbeiten (S4) */
.editor { position: fixed; left: 24px; bottom: 90px; z-index: 12; width: min(340px, calc(100vw - 32px)); padding: 12px 14px; border-radius: 16px; background: rgba(12,12,13,.97) !important; color: #fff; }
.editor h2 { margin: 0 0 8px; font: 600 15px/1.2 system-ui, sans-serif; }
.editor label, .editor legend { display: block; margin: 0 0 6px; padding: 0; font: 500 13px/1.3 system-ui, sans-serif; color: rgba(255,255,255,.86); }
.editor fieldset { margin: 8px 0 0; padding: 0; border: 0; min-width: 0; }
.editor .feld { position: relative; margin: 0 0 6px; }
.editor input { display: block; width: 100%; height: 44px; margin: 0; padding: 0 56px 0 12px; border: 1px solid rgba(255,255,255,.3); border-radius: 10px; background: rgba(255,255,255,.07); color: #fff; font: 400 16px system-ui, sans-serif; }
.editor #edName { padding-right: 12px; }
.editor input:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.editor .edtasten button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.editor input[aria-invalid=true] { border-color: #ff9d85; box-shadow: 0 0 0 1px #ff9d85; }
.zaehl { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font: 500 12px system-ui, sans-serif; color: rgba(255,255,255,.78); pointer-events: none; }
.zaehl.voll { color: #ffb4a0; font-weight: 700; }
.edfehler { margin: 0 0 6px; padding: 8px 10px; border-radius: 8px; background: rgba(224,122,95,.2); color: #ffe1d8; font: 500 13px/1.4 system-ui, sans-serif; }
.edtasten { display: flex; gap: 8px; margin-top: 8px; }
.edtasten button { flex: 1; min-height: 44px; border-radius: 999px; border: 1px solid rgba(255,255,255,.28); background: none; color: #fff; font: 600 14px system-ui, sans-serif; cursor: pointer; }
.edtasten button[type=submit] { background: var(--accent); border-color: var(--accent); color: #1a1008; }
.edtasten button:disabled { opacity: .6; cursor: default; }
.editor textarea { display: block; width: 100%; min-height: 68px; margin: 0; padding: 10px 12px 22px; border: 1px solid rgba(255,255,255,.3); border-radius: 10px; background: rgba(255,255,255,.07); color: #fff; font: 400 16px/1.4 system-ui, sans-serif; resize: none; }
.editor textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.editor textarea[aria-invalid=true] { border-color: #ff9d85; box-shadow: 0 0 0 1px #ff9d85; }
.editor .feld .zaehl { top: auto; bottom: 8px; transform: none; }
.edhinweis { margin: 0 0 8px; font: 400 13px/1.4 system-ui, sans-serif; color: rgba(255,255,255,.78); }
.edrest { margin: 0 0 4px; font: 600 13px/1.3 system-ui, sans-serif; color: rgba(255,255,255,.92); }
.edrest.leer { margin: 4px 0 6px; padding: 8px 10px; border-radius: 8px; background: rgba(224,122,95,.2); color: #ffe1d8; font-weight: 500; line-height: 1.4; }
.editing .split, .editing .pano-hint { visibility: hidden; }
/* Bild wird bearbeitet: ruhige Abdunklung, ein langsam drehender Ring, kein Blinken */
.lauf { pointer-events: auto; position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(12,12,13,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); cursor: default; }
.lauf[hidden] { display: none; }
.lauf-in { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 360px; text-align: center; color: #fff; font: 500 15px/1.45 system-ui, sans-serif; }
.lauf-in p { margin: 0; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; animation: dreh 1.6s linear infinite; }
.lauf.fehler .spin { display: none; }
.lauf-in button { min-height: 44px; padding: 0 22px; border-radius: 999px; border: 1px solid rgba(255,255,255,.4); background: none; color: #fff; font: 600 14px system-ui, sans-serif; cursor: pointer; }
.lauf-in button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@keyframes dreh { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 6s; } }
.edit button:disabled { opacity: .45; cursor: default; }
@media (max-width: 640px) {
  .editor { left: 0; right: 0; bottom: 0; width: auto; border-radius: 18px 18px 0 0; padding: 10px 16px 14px; max-height: 45dvh; overflow-y: auto; }
  .editor h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } /* nur für Screenreader: spart Höhe */
  .editor fieldset { margin-top: 6px; }
}

.edconfirm { margin: 0 0 6px; font: 600 14px/1.4 system-ui, sans-serif; color: #fff; }
.restbadge { align-self: center; min-width: 0 !important; height: 32px !important; padding: 0 12px !important; font: 600 12px system-ui, sans-serif !important; border-radius: 999px; color: rgba(255,255,255,.92) !important; background: rgba(12,12,13,.86) !important; border: 1px solid rgba(255,255,255,.14) !important; cursor: default !important; }
.restbadge.leer { cursor: pointer !important; color: #ffe1d8 !important; border-color: rgba(224,122,95,.7) !important; }
.restbadge[hidden] { display: none; }
.edhinweis a { color: #fff; text-decoration: underline; }
.toast { position: absolute; left: 50%; bottom: 52px; transform: translateX(-50%); z-index: 4; width: max-content; max-width: calc(100% - 24px); padding: 12px 18px; border-radius: 14px; background: rgba(12,12,13,.96); border: 1px solid rgba(255,255,255,.2); color: #fff; font: 500 14px/1.4 system-ui, sans-serif; text-align: center; text-wrap: balance; pointer-events: none; }
.toast[hidden] { display: none; }
.lauf-in p { text-wrap: balance; max-width: 300px; font-size: 16px; }
.spin { width: 48px; height: 48px; border-width: 4px; border-color: rgba(255,255,255,.28); border-top-color: #fff; }
.lauf { background: rgba(8,8,9,.68); }
.lauf-tasten { display: flex; flex-direction: column; gap: 8px; align-items: stretch; width: 220px; }
.lauf-tasten[hidden] { display: none; }
.lauf-in button.haupt { background: var(--accent); border-color: var(--accent); color: #1a1008; }
@media (max-width: 640px) {
  #bildDlg h2 { position: static; width: auto; height: auto; overflow: visible; clip-path: none; margin: 0 0 6px; }
  .bildoffen .pill, .bildoffen .thumbs { visibility: hidden; }
}
