/* Fassadenvorschau – Gestaltung nach farben-volz.de
   Viel Weiß, Blau #364693 als Akzent (hellblaue Flächen für Hover/Auswahl),
   dunkelgraue Texte, eckige Karten mit rundum weichem Schatten
   (0 0 16px rgba(0,0,0,.2) wie auf der Website), Gelb nur im Logo.
   Fußzeile #575757, Open Sans. */

:root {
  --blue: #364693;
  --blue-dark: #2a3775;
  --blue-light: #eef1f9;
  --blue-soft: #dfe4f3;
  --text: #212529;
  --text-2: #575757;
  --muted: #6c757d;
  --border: #dee2e6;
  --input-border: #ced4da;
  --bg: #fff;
  --bg-soft: #f7f8fa;
  --card: #fff;
  --danger: #b3261e;
  --danger-light: #fdecea;
  --warn-light: #fff9db;
  --radius: 0;
  --radius-sm: 4px;
  --shadow: 0 0 16px 0 rgba(0, 0, 0, 0.12);
  --shadow-strong: 0 0 16px 0 rgba(0, 0, 0, 0.2);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; color: var(--text); font-weight: 600; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75em; }
a { color: var(--blue); }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ── Kopf (wie farben-volz.de: weiß, großes Logo ragt in den Inhalt) ─ */
.mock-banner {
  background: var(--warn-light); border-bottom: 1px solid #f0e2a0;
  color: #5c4d00; font-size: .82rem;
  padding: 5px 16px; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap;
}
.mock-banner select { font: inherit; padding: 1px 6px; border-radius: var(--radius-sm); border: 1px solid #d9c770; background: #fff; }
.mock-banner a { color: inherit; }

.site-header { background: #fff; box-shadow: var(--shadow-strong); position: relative; z-index: 5; }
.header-inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 92px; }
.brand { display: flex; align-items: center; gap: 18px; text-decoration: none; color: var(--text); }
.brand-logo {
  width: 210px; height: auto; position: relative; z-index: 6;
  margin: 10px 0 -64px -14px; /* ragt wie auf der Website über die Kopfzeile hinaus */
}
.brand-text { display: flex; flex-direction: column; border-left: 1px solid var(--border); padding-left: 18px; }
.brand-title { font-weight: 600; font-size: 1.2rem; color: var(--text); }
.brand-sub { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.main-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.main-nav a, .nav-logout {
  color: var(--text-2); text-decoration: none; padding: 8px 12px; border-radius: var(--radius-sm);
  background: none; border: 0; font: inherit; font-size: 1rem; cursor: pointer;
}
.main-nav a:hover, .nav-logout:hover { color: var(--blue); }
.main-nav a.active { color: var(--blue); font-weight: 600; }
/* wie „Online-Shop" auf der Website: blauer, fetter Text auf heller Fläche mit Schatten */
.main-nav .nav-cta {
  color: var(--blue); font-weight: 700; background: #fff; box-shadow: var(--shadow-strong); margin-left: 8px;
}
.main-nav .nav-cta:hover { background: var(--blue-light); }
.nav-logout { font-size: .9rem; color: var(--muted); }

/* main.wrap: sonst setzt .wrap (padding: 0 16px) den Abstand unten auf 0
   und die letzte Karte stößt an die Fußzeile */
main.wrap { flex: 1 0 auto; padding-top: 34px; padding-bottom: 48px; }
/* Platz für das überstehende Logo */
.has-logo-overlap main.wrap { padding-top: 84px; }

/* Schlanke Fußzeile: nur die Firmenzeile, immer unten angedockt */
.site-footer {
  position: sticky; bottom: 0; z-index: 4; flex-shrink: 0;
  background: #575757; color: #e9e9e9; font-size: .78rem; line-height: 1.3;
}
@media (max-width: 600px) { .footer-claim { display: none; } }
.footer-inner { padding-top: 9px; padding-bottom: 9px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Bausteine ──────────────────────────────────────── */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:not(:disabled):hover { background: var(--blue-dark); }
.btn-secondary { background: #fff; color: var(--blue); border-color: var(--blue); }
.btn-secondary:not(:disabled):hover { background: var(--blue-light); }
.btn-ghost { background: transparent; color: var(--blue); }
.btn-ghost:not(:disabled):hover { background: var(--blue-light); }
.btn-ghost.danger { color: var(--danger); }
.btn-ghost.danger:not(:disabled):hover { background: var(--danger-light); }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-lg { padding: 13px 26px; font-size: 1.02rem; }
.icon-btn { background: none; border: 0; font-size: 1.15rem; cursor: pointer; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--muted); }
.icon-btn:hover { background: var(--bg-soft); color: var(--text); }
.pill { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 9px; border-radius: var(--radius-sm); background: var(--blue-light); color: var(--blue); }
.pill-teal { background: var(--blue-light); color: var(--blue); }

label { font-weight: 600; display: block; margin-bottom: 4px; color: var(--text); }
input[type=text], input[type=email], input[type=password], input[type=search], textarea {
  width: 100%; font: inherit; color: var(--text); padding: 10px 12px;
  border: 1px solid var(--input-border); border-radius: var(--radius-sm); background: #fff;
}
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, select:focus-visible {
  outline: 3px solid rgba(54, 70, 147, .25); outline-offset: 1px; border-color: var(--blue);
}
textarea { resize: vertical; min-height: 84px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; white-space: nowrap; }
input[type=checkbox] { accent-color: var(--blue); }

.alert { border-radius: var(--radius-sm); padding: 10px 14px; margin: 10px 0; font-size: .92rem; border-left: 3px solid; }
.alert-error { background: var(--danger-light); color: var(--danger); border-color: var(--danger); }
.alert-info { background: var(--blue-light); color: var(--blue-dark); border-color: var(--blue); }
.alert-warn { background: var(--warn-light); color: #5c4d00; border-color: #d9b800; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%; display: inline-block; vertical-align: middle; flex: none;
  border: 3px solid rgba(54,70,147,.18); border-top-color: var(--blue); animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center-load { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 60px 0; color: var(--muted); }

.swatch-dot { width: 22px; height: 22px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); display: inline-block; }

/* ── Anmeldung ──────────────────────────────────────── */
.login { max-width: 440px; margin: 20px auto; }
.login h1 { font-size: 1.45rem; }
.login form > * + * { margin-top: 14px; }
.login .btn { width: 100%; }
.login-fixed-email { padding: 10px 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); }

/* ── Übersicht ──────────────────────────────────────── */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0 0 6px; }
.stats { display: flex; gap: 8px; flex-wrap: wrap; }
.grid-objects { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.obj-card { padding: 0; overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: box-shadow .15s; }
.obj-card:hover { box-shadow: var(--shadow-strong); }
.obj-card:hover h3 { color: var(--blue); }
.obj-card .thumb { aspect-ratio: 4 / 3; background: #e9ecef center / cover no-repeat; }
.obj-card .body { padding: 14px 16px 16px; }
.obj-card h3 { margin-bottom: 2px; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.chips .swatch-dot { width: 18px; height: 18px; }

.empty { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 40px; align-items: center; padding: 8px 0 24px; }
.empty h1 { font-size: 2.1rem; }
.lead { font-size: 1.05rem; color: var(--text-2); }
.steps-mini { list-style: none; padding: 0; margin: 22px 0 26px; counter-reset: st; }
.steps-mini li { counter-increment: st; display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; margin-bottom: 14px; }
.steps-mini li::before {
  content: counter(st); grid-row: span 2; width: 30px; height: 30px; border-radius: 50%;
  background: var(--blue-light); color: var(--blue); font-weight: 700; display: grid; place-items: center;
}
.steps-mini b { color: var(--text); }
.steps-mini span { color: var(--muted); font-size: .9rem; }
.example { margin: 0; }
.example figcaption { font-size: .8rem; color: var(--muted); margin-top: 8px; text-align: center; }
.compare-fluid { width: 100%; max-height: none; }
@media (max-width: 860px) { .empty { grid-template-columns: 1fr; gap: 24px; } }

/* ── Neues Objekt ───────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--blue-soft); background: var(--blue-light);
  padding: 52px 20px; text-align: center; cursor: pointer; transition: background .15s, border-color .15s;
}
.dropzone.drag, .dropzone:hover { border-color: var(--blue); background: #e5e9f6; }
.dropzone .big { font-size: 1.15rem; font-weight: 600; color: var(--blue); margin-bottom: 4px; }
.tips { margin: 18px 0 0; padding-left: 20px; color: var(--muted); }
.test-photos { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.test-photos button { padding: 0; border: 2px solid transparent; overflow: hidden; cursor: pointer; background: none; width: 120px; }
.test-photos button:hover { border-color: var(--blue); }
.test-photos img { width: 100%; height: 80px; object-fit: cover; }

/* ── Objektseite ────────────────────────────────────── */
.obj-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.obj-head .name-input {
  font-size: 1.5rem; font-weight: 600; color: var(--text); border: 1px solid transparent; background: transparent;
  padding: 4px 8px; flex: 1 1 260px; min-width: 0; border-radius: var(--radius-sm);
}
.obj-head .name-input:hover { border-color: var(--border); background: #fff; }
/* Foto-Karte so hoch wie die Schritte daneben, Foto mittig darin – beide Spalten enden auf einer Linie */
.obj-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: stretch; }
@media (max-width: 860px) { .obj-layout { grid-template-columns: 1fr; } }
.photo-card { padding: 12px; display: flex; align-items: center; justify-content: center; min-width: 0; }
.photo-card img { width: 100%; height: auto; max-height: var(--photo-max, 70vh); object-fit: contain; margin: auto; }
.steps-col { display: flex; flex-direction: column; }
.section + .section { margin-top: 20px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.section-head h2 { margin: 0; display: flex; gap: 10px; align-items: center; }
.step-no {
  background: var(--blue-light); color: var(--blue); width: 26px; height: 26px; border-radius: 50%;
  display: inline-grid; place-items: center; font-size: .82rem; font-weight: 700; flex: none;
}
.counter { font-size: .8rem; color: var(--muted); text-align: right; margin-top: 4px; }
.counter.full { color: var(--danger); font-weight: 600; }

/* Schritt 2: gewählte Farbtöne */
.chip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.color-chip {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 8px 6px 8px 8px; border: 1px solid var(--border); background: #fff;
}
.chip-swatch { width: 40px; height: 40px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.chip-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.chip-text b { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-text small { color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-rm:disabled { opacity: .3; cursor: not-allowed; }

/* Hochformat-Fotos: Foto schmaler, Schritte 1–3 rechts daneben, Foto nie höher als der Bildschirm */
.obj-layout.is-portrait { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.is-portrait .photo-card img { width: auto; max-width: 100%; max-height: var(--photo-max, calc(100vh - 140px)); }
.is-portrait .step-results { margin-top: 20px; flex: 1; }
.is-portrait .photo-card img { height: auto; }
/* Kleinere Ergebnis-Vorschauen im Hochformat: Foto, Optionen und Ergebnisse etwa gleich hoch */
.is-portrait .results-grid { gap: 12px; }
.is-portrait .results-grid > .res-card { flex-basis: calc((100% - 2 * 12px) / 3); min-width: 150px; }
.is-portrait .res-media { max-height: 200px; }
/* per JS eingepasst (fitResults): Spalten und Bildhöhe exakt bis zur Fotounterkante */
/* Raster ohne Scrollen … */
.is-portrait .results-grid.fitted:not(.carousel) {
  display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); overflow: visible; padding-bottom: 0;
}
/* … oder Karussell: eine Zeile, feste Kartenbreite, seitlich scrollen */
.results-grid.fitted.carousel > .res-card { flex: 0 0 var(--card-w); min-width: 0; }
.results-grid.fitted.carousel .res-media { height: var(--media-h); max-height: none; aspect-ratio: auto; }
.results-grid.fitted.carousel .res-media img { object-fit: contain; background: var(--bg-soft); }
/* Querformat: Schritt 2 füllt die Spalte bis zur Fotounterkante */
.is-landscape .steps-col > #step-colors { flex: 1; }
.is-landscape.measuring .steps-col > #step-colors { flex: none; }
/* Objektseite passt auf einen Bildschirm (Abstand unten = bottomGap in fitResults) */
.page-object main.wrap { padding-bottom: 16px; }
.page-object .obj-head { margin-bottom: 14px; }
/* Objektseite: Kopfzeile neben dem überstehenden Logo statt darunter – spart Höhe */
@media (min-width: 861px) {
  .page-object.has-logo-overlap main.wrap { padding-top: 14px; }
  .page-object .obj-head { padding-left: 206px; min-height: 52px; }
}
.compact-steps #limit-note .alert { padding: 2px 8px; font-size: .72rem; line-height: 1.35; margin: 6px 0 0; }
.is-portrait .results-grid.fitted:not(.carousel) > .res-card { min-width: 0; }
/* Verdichtete Schritte 1–2, wenn viele Farbtöne neben ein Hochformat-Foto müssen */
.compact-steps .section { padding: 16px 18px; }
.compact-steps .section + .section, .compact-steps .step-results { margin-top: 14px; }
.compact-steps .section-head { margin-bottom: 8px; }
.compact-steps #comment { min-height: 46px; height: 46px; }
.compact-steps #step-wish p.small, .compact-steps .counter { display: none; }
.compact-steps .chip-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.compact-steps .color-chip { grid-template-columns: 22px minmax(0, 1fr) auto; gap: 6px; padding: 4px 2px 4px 6px; }
.compact-steps .chip-swatch { width: 22px; height: 22px; }
.compact-steps .chip-text small { display: none; }
.compact-steps .chip-text b { font-size: .8rem; }
.compact-steps .chip-rm { padding: 2px 6px; font-size: 1rem; }
.is-portrait .results-grid.fitted .res-media { height: var(--media-h); max-height: none; aspect-ratio: auto; }
.results-grid.fitted { gap: 10px; }
.results-grid.fitted .res-head { padding: 7px 10px; }
.results-grid.fitted .res-head .swatch-dot { width: 18px; height: 18px; }
.results-grid.fitted .res-title small { display: none; }
.results-grid.fitted .res-title b { font-size: .8rem; }
.results-grid.fitted .res-head { gap: 6px; }
.results-grid.fitted .res-foot { padding: 6px 8px; }
.results-grid.fitted .res-foot { flex-wrap: nowrap; }
.results-grid.fitted[data-tight] .res-card.is-done .res-foot { display: none; }
.results-grid.fitted[data-tight] .res-hover { opacity: 1; font-size: .68rem; padding: 4px; }
.results-grid.fitted .res-foot .ok, .results-grid.fitted .res-foot .wish { display: none; }
.results-grid.fitted .res-foot .res-actions { margin-left: 0; width: 100%; }
.results-grid.fitted .res-foot .res-actions .btn { flex: 1; }
.results-grid.fitted .btn-sm { padding: 5px 8px; font-size: .8rem; }
/* sehr schmale Karten: Download nur über „Alle herunterladen“ und im Vergleich */
.results-grid.fitted[data-narrow] .res-actions .icon-btn { display: none; }
/* passt nicht exakt (viele Farbtöne / kleiner Bildschirm): Foto oben, scrollt mit */
.obj-layout.fit-overflow .photo-card { align-self: start; position: sticky; top: 12px; }
.is-portrait .res-media img { object-fit: contain; background: var(--bg-soft); }
.is-portrait .res-foot { padding: 8px 10px; }
.is-portrait .res-foot .ok { display: none; }
.is-portrait .res-actions { margin-left: 0; width: 100%; }
.is-portrait .res-actions .btn { flex: 1; }
@media (max-width: 860px) {
  .obj-layout.is-portrait { grid-template-columns: 1fr; }
  .is-portrait .photo-card img { max-height: 60vh; }
}

/* Schritt 3: Ergebnis */
.step-results { margin-top: 24px; scroll-margin-top: 16px; outline: none; }
/* Eine Zeile; passen nicht alle hinein, erscheint eine Scrollleiste (plus Pfeile) */
.results-wrap { position: relative; }
.results-grid {
  position: relative; display: flex; gap: 18px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; padding-bottom: 8px;
  scrollbar-width: thin; scrollbar-color: var(--blue-soft) transparent;
}
.results-grid::-webkit-scrollbar { height: 8px; }
.results-grid::-webkit-scrollbar-thumb { background: var(--blue-soft); border-radius: 4px; }
.results-grid::-webkit-scrollbar-thumb:hover { background: var(--blue); }
.results-grid > .res-card { flex: 0 0 calc((100% - 3 * 18px) / 4); min-width: 230px; scroll-snap-align: start; }
@media (max-width: 860px) { .results-grid > .res-card { flex-basis: 72%; min-width: 0; } }
.car-btn {
  position: absolute; top: 42%; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: #fff; color: var(--blue); font-size: 1.5rem; line-height: 1; cursor: pointer;
  box-shadow: var(--shadow-strong); display: none; place-items: center; transition: transform .15s;
}
.car-btn:hover { transform: scale(1.08); }
.car-btn.prev { left: -12px; }
.car-btn.next { right: -12px; }
.results-wrap.can-prev .car-btn.prev, .results-wrap.can-next .car-btn.next { display: grid; animation: fadeIn .2s ease both; }
.res-card { border: 1px solid var(--border); background: #fff; display: flex; flex-direction: column; min-width: 0; }
.res-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 3px solid var(--c, var(--border)); }
.res-head .swatch-dot { width: 24px; height: 24px; }
.res-title { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.res-title b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-title small { color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-media {
  position: relative; display: block; width: 100%; padding: 0; border: 0; margin: 0; overflow: hidden;
  background: var(--bg-soft); font: inherit; color: inherit;
}
button.res-media { cursor: zoom-in; }
.res-media img { width: 100%; height: 100%; object-fit: cover; }
.res-base { filter: grayscale(.55) brightness(1.04); }
.is-queued .res-base, .is-pending .res-base, .is-error .res-base { opacity: .55; }
.res-overlay {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  background: rgba(33, 37, 41, .72); color: #fff; font-weight: 600; font-size: .85rem; padding: 7px 14px; border-radius: 99px;
}
.res-overlay.soft { background: rgba(255,255,255,.92); color: var(--text-2); font-weight: 400; box-shadow: var(--shadow); }
.res-overlay.err-ov { background: var(--danger); width: 40px; height: 40px; padding: 0; justify-content: center; font-size: 1.2rem; }
.res-hover {
  position: absolute; inset: auto 0 0 0; padding: 8px; text-align: center; font-size: .8rem; font-weight: 600;
  color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.6)); opacity: 0; transition: opacity .2s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.res-media:hover .res-hover, .res-media:focus-visible .res-hover { opacity: 1; }
.res-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; font-size: .85rem; margin-top: auto; }
.res-actions { margin-left: auto; display: inline-flex; gap: 4px; align-items: center; }
.res-foot .ok { color: var(--blue); font-weight: 600; }
.res-foot .err { color: var(--danger); white-space: pre-line; flex-basis: 100%; }
.res-foot .wish { flex-basis: 100%; color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-card.is-error { border-color: #ebb4b0; }
.res-card.is-running { border-color: var(--blue-soft); }

/* ── Dialoge ────────────────────────────────────────── */
.dialog {
  border: 0; padding: 0; border-radius: 0; box-shadow: var(--shadow-strong);
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); color: var(--text);
}
.dialog[open] { display: flex; flex-direction: column; }
.dialog::backdrop { background: rgba(33, 37, 41, .45); }
.dialog-wide { width: min(1000px, calc(100vw - 24px)); height: min(820px, calc(100vh - 24px)); }
.dialog-viewer { width: min(1280px, calc(100vw - 24px)); }
.dialog-small { width: min(440px, calc(100vw - 24px)); }
.dialog-small form { display: flex; flex-direction: column; }
.dialog-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.dialog-head h2 { margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dialog-body { padding: 18px; overflow: auto; flex: 1; min-height: 0; }
.dialog-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.dialog-tabs { display: flex; flex-wrap: wrap; gap: 0 2px; overflow-x: auto; padding: 6px 18px 0; border-bottom: 1px solid var(--border); scrollbar-width: thin; flex: none; }
.dialog-tabs button {
  font: inherit; font-size: .86rem; white-space: nowrap; cursor: pointer;
  background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 10px; color: var(--text-2);
}
.dialog-tabs button:hover { color: var(--blue); }
.dialog-tabs button.active { color: var(--blue); font-weight: 600; border-bottom-color: var(--blue); }
.dialog-tabs .tab-sep { width: 1px; background: var(--border); margin: 9px 4px; flex: none; }
.dialog-tools { display: flex; gap: 12px; align-items: center; padding: 12px 18px; flex-wrap: wrap; flex: none; }
.dialog-tools input[type=search] { flex: 1 1 260px; }

.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.swatch-btn {
  font: inherit; border: 1px solid var(--border); padding: 0; cursor: pointer; background: #fff;
  overflow: hidden; text-align: left; position: relative; border-radius: 0;
}
.swatch-btn .c { height: 54px; }
.swatch-btn .t { padding: 5px 7px; font-size: .74rem; line-height: 1.3; }
.swatch-btn .t b { display: block; font-size: .78rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swatch-btn .t span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.swatch-btn:hover { box-shadow: var(--shadow-strong); }
.swatch-btn.sel { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); background: var(--blue-light); }
.swatch-btn.sel::after {
  content: "✓"; position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--blue); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: .8rem;
}
.swatch-btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.more-row { text-align: center; margin-top: 14px; }

.fan-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.fan-nav button {
  font: inherit; font-size: .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff;
  padding: 3px 10px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; color: var(--text-2);
}
.fan-nav button:hover { border-color: var(--blue); color: var(--blue); }
.fan-nav button .swatch-dot { width: 12px; height: 12px; }
.fan-group { margin-bottom: 18px; }
.fan-group h3 { margin-bottom: 6px; }
.fan { display: flex; gap: 3px; overflow-x: auto; padding: 8px 2px 10px; scrollbar-width: thin; }
.blade {
  flex: none; width: 58px; height: 150px; border: 2px solid transparent; cursor: pointer;
  position: relative; padding: 0; font: inherit; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .12s;
}
.blade:hover { transform: translateY(-6px); }
.blade .code {
  position: absolute; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.94); color: var(--text);
  font-size: .68rem; font-weight: 600; padding: 3px 2px; text-align: center;
}
.blade.sel { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue); transform: translateY(-6px); }
.blade.sel::after {
  content: "✓"; position: absolute; top: 4px; left: 50%; transform: translateX(-50%); width: 20px; height: 20px;
  border-radius: 50%; background: var(--blue); color: #fff; font-size: .75rem; font-weight: 700; display: grid; place-items: center;
}

.custom-color { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; max-width: 560px; }
.custom-color input[type=color] { width: 110px; height: 110px; border: 1px solid var(--border); padding: 0; background: none; cursor: pointer; }
.custom-color .fields > * + * { margin-top: 10px; }

.selected-strip { flex: 1; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-width: 0; }
.sel-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); font-size: .8rem; background: #fff; max-width: 200px;
}
.sel-chip span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-chip .swatch-dot { width: 16px; height: 16px; }
.sel-chip button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 4px; font-size: .85rem; }

/* Vergleich */
.viewer-body { display: flex; align-items: center; justify-content: center; background: var(--bg-soft); padding: 12px; }
.compare { position: relative; max-width: 100%; max-height: calc(100vh - 220px); user-select: none; touch-action: pan-y; overflow: hidden; box-shadow: var(--shadow); }
.compare img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.compare .after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos, 50%)); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 6px rgba(0,0,0,.45); pointer-events: none; }
.compare .handle::after {
  content: "‹ ›"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--blue); font-weight: 700;
  display: grid; place-items: center; box-shadow: 0 0 10px rgba(0,0,0,.3); font-size: .95rem; letter-spacing: 2px;
}
.compare input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.compare .tag, .side figure .tag {
  position: absolute; top: 10px; background: rgba(33,37,41,.72); color: #fff; font-size: .72rem; font-weight: 600;
  letter-spacing: .06em; padding: 3px 10px; border-radius: var(--radius-sm); pointer-events: none;
}
.compare .tag.l { left: 10px; } .compare .tag.r { right: 10px; }
.side { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.side figure { margin: 0; position: relative; }
.side figure .tag { left: 10px; }
.side img { width: 100%; max-height: calc(100vh - 220px); object-fit: contain; }
@media (max-width: 700px) { .side { grid-template-columns: 1fr; } }
.viewer-foot { justify-content: space-between; }
.viewer-nav { display: flex; align-items: center; gap: 4px; font-size: .85rem; color: var(--muted); }
.viewer-nav .btn { font-size: 1.3rem; padding: 2px 12px; }
.viewer-meta { flex: 1; font-size: .8rem; color: var(--muted); min-width: 200px; }
.viewer-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { font: inherit; font-size: .82rem; border: 0; background: #fff; padding: 6px 12px; cursor: pointer; color: var(--text-2); }
.seg button.active { background: var(--blue-light); color: var(--blue); font-weight: 600; }

.toast {
  animation: toastIn .28s ease both;
  position: fixed; left: 50%; bottom: 52px; transform: translateX(-50%); z-index: 1000;
  background: #fff; color: var(--text); padding: 12px 18px; border-left: 3px solid var(--blue);
  box-shadow: var(--shadow-strong); max-width: calc(100vw - 32px); font-size: .92rem;
}
.toast.error { border-left-color: var(--danger); color: var(--danger); }

@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; min-height: 0; }
  .brand-logo { width: 104px; margin: 0 0 0 -6px; }
  .brand-text { padding-left: 12px; }
  .brand-title { font-size: 1.05rem; }
  .main-nav { width: 100%; justify-content: space-between; gap: 2px; }
  .main-nav a, .nav-logout { padding: 7px 8px; font-size: .92rem; }
  .main-nav .nav-cta { margin-left: 0; }
  .has-logo-overlap main.wrap, main.wrap { padding-top: 22px; padding-bottom: 40px; }
  h1 { font-size: 1.4rem; }
  .card { padding: 16px; }
}

/* ── Willkommen / Zugangscode ───────────────────────── */
.is-welcome main.wrap { padding-top: 96px; }
.welcome { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 420px); gap: 48px; align-items: center; }
.welcome-hero h1 { font-size: 2.15rem; line-height: 1.2; margin-bottom: .4em; }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; font-weight: 600; color: var(--blue); margin-bottom: 10px; }
.welcome-hero .example { margin-top: 22px; }
.welcome-card { padding: 32px 30px; text-align: center; }
.welcome-card h2 { font-size: 1.45rem; margin-bottom: .3em; }
.wc-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-light); color: var(--blue); }
.code-input {
  display: block; width: 100%; margin: 18px 0 6px; text-align: center; text-transform: uppercase;
  font: 600 1.7rem/1.2 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: .22em;
  padding: 14px 10px 14px calc(10px + .22em); border: 2px solid var(--input-border); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.code-input::placeholder { color: #c4c9d1; }
.code-input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(54,70,147,.14); outline: none; }
.code-error { color: var(--danger); font-size: .88rem; min-height: 1.2em; margin: 4px 0 8px; }
.welcome-card .btn { width: 100%; margin-top: 8px; }
.wc-note { margin: 18px 0 0; }
.welcome-card form > div { text-align: left; margin-bottom: 12px; }
.wc-success { padding: 28px 0; animation: viewIn .35s ease both; }
.wc-success .check-pop { position: static; margin: 0 auto 14px; width: 64px; height: 64px; font-size: 1.8rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 860px) {
  .welcome { grid-template-columns: 1fr; gap: 24px; }
  .welcome-card { order: -1; }
  .welcome-hero h1 { font-size: 1.6rem; }
  .is-welcome main.wrap { padding-top: 22px; }
}

/* ── Animationen (dezent; aus bei „Bewegung reduzieren“) ─ */
.spinner-light { border-color: rgba(255,255,255,.35); border-top-color: #fff; }
.view-enter > * { animation: viewIn .38s cubic-bezier(.2,.7,.2,1) both; }
.view-enter > *:nth-child(2) { animation-delay: .05s; }
.view-enter > *:nth-child(3) { animation-delay: .1s; }
.obj-card { animation: viewIn .4s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 50ms); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.color-chip.enter, .res-card.enter { animation: popIn .32s cubic-bezier(.2,.8,.3,1.2) both; }
@keyframes popIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }

/* Während die KI malt: Farbband streicht über das Foto, Fortschrittsbalken läuft */
.paint-sweep {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: multiply; opacity: .55;
  background: linear-gradient(100deg, transparent 0%, transparent 30%, var(--c) 45%, var(--c) 55%, transparent 70%, transparent 100%);
  background-size: 250% 100%; animation: sweep 2.6s ease-in-out infinite;
}
@keyframes sweep { from { background-position: 120% 0; } to { background-position: -20% 0; } }
.res-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.6); overflow: hidden; }
.res-progress::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 35%; background: var(--c, var(--blue));
  animation: indet 1.6s ease-in-out infinite;
}
@keyframes indet { from { left: -35%; } to { left: 100%; } }
.is-running .res-head .swatch-dot, .is-queued .res-head .swatch-dot { animation: breathe 1.8s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.18); box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 22%, transparent); } }

/* Fertige Variante wird von links „aufgestrichen“ */
.res-card.reveal .res-img { animation: reveal 1s cubic-bezier(.5,0,.2,1) both; }
@keyframes reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.check-pop {
  position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--blue); color: #fff; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.25); animation: checkPop .6s .75s cubic-bezier(.2,.9,.3,1.4) both;
}
@keyframes checkPop { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: none; } }

/* Schritt 3 hebt sich kurz hervor, wenn die Erzeugung startet */
.step-results.pulse { animation: ring 1.4s ease-out 1; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(54,70,147,.45), var(--shadow); } 100% { box-shadow: 0 0 0 18px rgba(54,70,147,0), var(--shadow); } }

.dialog[open] { animation: dlgIn .22s cubic-bezier(.2,.7,.2,1) both; }
.dialog[open]::backdrop { animation: fadeIn .22s ease both; }
@keyframes dlgIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.welcome-card.shake { animation: shake .42s ease both; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .paint-sweep { display: none; }
}

/* ── Hilfe ──────────────────────────────────────────── */
.nav-help {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: .95rem; color: var(--text-2); padding: 8px 10px; border-radius: var(--radius-sm);
}
.nav-help:hover { color: var(--blue); }
.help-q {
  width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center;
  border: 1.5px solid currentColor; font-weight: 700; font-size: .8rem;
}
.help-drawer {
  margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(420px, 100vw); border-radius: 0;
}
.help-drawer[open] { animation: drawerIn .26s cubic-bezier(.2,.7,.2,1) both; }
@keyframes drawerIn { from { transform: translateX(100%); } to { transform: none; } }
#help-list h3 { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 20px 0 6px; }
#help-list ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
#help-list li button {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left;
  background: #fff; border: 0; border-bottom: 1px solid var(--border); padding: 11px 4px; font: inherit; font-size: .92rem;
  color: var(--text); cursor: pointer;
}
#help-list li button span { color: var(--blue); font-size: 1.2rem; transition: transform .15s; }
#help-list li button:hover { color: var(--blue); background: var(--blue-light); }
#help-list li button:hover span { transform: translateX(3px); }
.help-tour {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer; font: inherit;
  background: var(--blue-light); border: 1px solid var(--blue-soft); padding: 12px 14px; color: var(--text);
}
.help-tour:hover { border-color: var(--blue); }
.help-tour b { display: block; color: var(--blue); }
.help-tour small { color: var(--muted); }
.help-tour-icon { width: 34px; height: 34px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: .8rem; flex: none; }
.help-foot { margin-top: 22px; }

/* Geführte Anzeige: Lichtkegel um das Element, Sprechblase daneben */
.tour { position: fixed; inset: 0; z-index: 3000; }
.tour.no-target { background: rgba(20, 26, 56, .55); }
.tour-hole {
  position: fixed; border-radius: 6px; pointer-events: none;
  box-shadow: 0 0 0 200vmax rgba(20, 26, 56, .55), 0 0 0 3px #fff inset;
  transition: left .3s ease, top .3s ease, width .3s ease, height .3s ease;
  animation: holePulse 1.8s ease-in-out infinite;
}
.tour.no-target .tour-hole { display: none; }
@keyframes holePulse {
  50% { box-shadow: 0 0 0 200vmax rgba(20, 26, 56, .55), 0 0 0 3px #fff inset, 0 0 0 6px rgba(255,255,255,.35); }
}
.tour-tip {
  position: fixed; width: min(360px, calc(100vw - 16px)); background: #fff; padding: 18px 18px 14px;
  box-shadow: var(--shadow-strong); border-top: 3px solid var(--blue); transition: left .3s ease, top .3s ease;
}
.tour-tip.tip-in { animation: viewIn .3s ease both; }
.tour-tip::before {
  content: ""; position: absolute; width: 14px; height: 14px; background: #fff; transform: rotate(45deg);
  left: calc(var(--arrow-x, 50%) - 7px);
}
.tour-tip[data-side="bottom"]::before { top: -9px; background: var(--blue); }
.tour-tip[data-side="top"]::before { bottom: -7px; }
.tour-tip[data-side="center"]::before, .tour-tip[data-side="inside"]::before,
.tour-tip[data-side="left"]::before, .tour-tip[data-side="right"]::before { display: none; }
.tour-count { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--blue); font-weight: 600; margin-bottom: 4px; }
.tour-tip h3 { margin: 0 24px 6px 0; font-size: 1.05rem; }
.tour-text { font-size: .92rem; color: var(--text-2); margin-bottom: 12px; }
.tour-actions { display: flex; justify-content: flex-end; gap: 8px; }
.tour-close { position: absolute; top: 8px; right: 8px; }
@media (max-width: 600px) {
  .nav-help { padding: 7px 6px; } .help-q { width: 24px; height: 24px; }
  .nav-help-label { display: none; }
  .main-nav { flex-wrap: nowrap; gap: 0; }
  .main-nav a, .nav-logout { padding: 6px 6px; font-size: .85rem; white-space: nowrap; }
  .main-nav .nav-cta { padding: 6px 8px; }
}
