:root {
  --green: #1f4d3f;
  --green-2: #2e6b58;
  --sand: #f4ecdc;
  --sand-2: #e9dcc2;
  --accent: #d6a45c;
  --bg: #faf8f4;
  --card: #ffffff;
  --text: #1d2521;
  --muted: #6b716d;
  --line: #e6e1d7;
  --warn-bg: #fff3e0;
  --warn: #9a5b00;
  --ok-bg: #e8f3ee;
  --ok: #1f6b4a;
  --danger: #b3261e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(31,77,63,.06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
a { color: var(--green-2); }
h1 { font-size: 1.6rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.2rem; margin: 0 0 .8rem; display: flex; align-items: center; gap: .5rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: calc(.6rem + env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) .6rem max(1rem, env(safe-area-inset-left));
  background: var(--green); color: #fff; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-weight: 700; }
.brand img { border-radius: 8px; }
.nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav a { color: #fff; text-decoration: none; font-size: .95rem; opacity: .92; }
.nav a:hover { opacity: 1; text-decoration: underline; }
.demo-banner { background: var(--sand-2); padding: .45rem 1rem; font-size: .88rem; text-align: center; }

.container { max-width: 1100px; margin: 0 auto; padding: 1rem max(1rem, env(safe-area-inset-left)) 4rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.page-head h1 { margin-bottom: .2rem; }
.page-head p { margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .55rem 1rem;
  border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--text); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--green-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-2); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #1d2521 !important; opacity: 1 !important; }
.btn-small { min-height: 34px; padding: .3rem .7rem; font-size: .88rem; }
.btn-lg { min-height: 56px; font-size: 1.1rem; }
.btn-block { width: 100%; }
.btn-link { background: none; border: none; color: var(--green-2); padding: .3rem .4rem; min-height: 36px; font-weight: 500; }
.btn-link:hover { text-decoration: underline; }
.danger { color: var(--danger) !important; }

input, select, textarea {
  width: 100%; font: inherit; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green-2); outline-offset: 0; border-color: transparent; }
input[type=checkbox], input[type=radio] { width: 1.2rem; height: 1.2rem; min-height: 0; accent-color: var(--green); flex: none; }
label { display: block; font-weight: 600; font-size: .9rem; }
label > input, label > select, label > textarea { margin-top: .3rem; font-weight: 400; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .9rem; }
legend { font-weight: 700; font-size: .9rem; padding: 0 .3rem; }
.stack > * + * { margin-top: .8rem; }
.stack-lg > * + * { margin-top: 1rem; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .8rem; margin-top: .8rem; }
.row-3 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.row-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; }
.row-inline input, .row-inline select { width: auto; flex: 1 1 160px; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; margin: .4rem 0; cursor: pointer; }

.step { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--green); color: #fff; font-size: .9rem; }
.choice-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: inline-block; padding: .75rem 1.1rem; border: 2px solid var(--line); border-radius: 12px; font-weight: 600; background: #fff; }
.choice input:checked + span { border-color: var(--green); background: var(--ok-bg); color: var(--green); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); }
.choice-small span { padding: .5rem .85rem; font-size: .92rem; }

.photo-drop { border: 2px dashed var(--sand-2); border-radius: 12px; min-height: 180px; display: grid; place-items: center; overflow: hidden; background: var(--sand); }
.photo-drop img { width: 100%; max-height: 420px; object-fit: contain; display: block; background: #000; }
.photo-empty { text-align: center; color: var(--muted); }
.big-icon { font-size: 2.6rem; }
.file-btn { cursor: pointer; }

.flash { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-warn { background: var(--warn-bg); color: var(--warn); }
.note { background: var(--warn-bg); color: var(--warn); border-left: 4px solid var(--accent); border-radius: 8px; padding: .55rem .8rem; font-size: .92rem; margin: .5rem 0; }
.note::before { content: "⚠ "; }
.plan-notes { background: var(--warn-bg); color: var(--warn); border: 1px solid #f0d4a8; border-left: 5px solid var(--accent); border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: 1rem; }
.plan-notes ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.plan-notes li + li { margin-top: .25rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.project-card { padding: 0; overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.project-card .thumb { aspect-ratio: 4/3; background: var(--sand); }
.project-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project-meta { padding: .8rem 1rem; display: flex; flex-direction: column; gap: .1rem; }
.empty { text-align: center; padding: 2rem 1rem; }

.login-card { max-width: 420px; margin: 3rem auto; }

.original summary, details > summary { cursor: pointer; font-weight: 600; }
.original-body { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; margin-top: .8rem; }
.original-body img { width: 100%; border-radius: 10px; }
.original-body dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .3rem .8rem; font-size: .92rem; }
.original-body dt { color: var(--muted); }
.original-body dd { margin: 0; }

.variants { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.variant-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.variant-head h2 { margin: 0; }
.render { margin: .8rem 0; }
.render img { width: 100%; max-height: 75vh; object-fit: contain; background: var(--sand); border-radius: 12px; display: block; }
.render-wait { position: relative; min-height: 220px; background: var(--sand); border-radius: 12px; overflow: hidden; display: grid; place-items: center; }
.render-wait img.dim { position: absolute; inset: 0; height: 100%; object-fit: cover; opacity: .35; }
.spinner-box { position: relative; text-align: center; padding: 1rem; }
.spinner { width: 42px; height: 42px; border: 4px solid var(--sand-2); border-top-color: var(--green); border-radius: 50%; margin: 0 auto .6rem; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 2fr); gap: .5rem; background: var(--sand); border-radius: 12px; padding: .7rem; margin-bottom: .6rem; }
.kpis > div { display: flex; flex-direction: column; }
.kpi { font-size: 1.3rem; font-weight: 700; color: var(--green); }
.kpi-price { text-align: right; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.items-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.items-table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); border-bottom: 2px solid var(--line); padding: .5rem; }
.items-table td { border-bottom: 1px solid var(--line); padding: .55rem .5rem; vertical-align: top; }
.items-table tfoot td { border-bottom: none; padding-top: .35rem; padding-bottom: .35rem; }
.items-table .r { text-align: right; white-space: nowrap; }
.items { margin-top: .4rem; }
.items > summary { margin-bottom: .4rem; }
.swatch { display: inline-block; width: .85rem; height: .85rem; border-radius: 50%; border: 1px solid rgba(0,0,0,.2); margin-right: .35rem; vertical-align: -1px; }

.history ul { padding-left: 1.1rem; margin: .5rem 0; font-size: .9rem; }
.history li + li { margin-top: .5rem; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }

.change-form { display: flex; gap: .5rem; margin-top: .9rem; }
.change-form input { flex: 1; }
.change-result { margin-top: .6rem; font-size: .92rem; }
.variant-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; margin-top: .4rem; }
.add-variant { margin-top: 1rem; }
.danger-zone { text-align: center; margin-top: 1.5rem; }

.filter-bar { margin: .5rem 0 1rem; }
.products-table .thumb-cell img { width: 48px; height: 48px; object-fit: contain; background: var(--sand); border-radius: 8px; }
.products-table tr.inactive { opacity: .55; }
.product-preview { width: 120px; height: 120px; object-fit: contain; background: var(--sand); border-radius: 10px; }
.tag { display: inline-block; font-size: .7rem; font-weight: 700; padding: .1rem .45rem; border-radius: 999px; background: var(--line); margin: 0 .2rem .2rem 0; }
.tag-demo { background: var(--sand-2); }
.tag-gastro { background: var(--ok-bg); color: var(--ok); }
.tag-privat { background: #e8eef8; color: #2b4f8a; }
code { background: var(--sand); padding: .05rem .3rem; border-radius: 4px; font-size: .88em; }

.only-mobile { display: none; }
@media (max-width: 720px) {
  h1 { font-size: 1.35rem; }
  .hide-mobile { display: none; }
  .only-mobile { display: inline; }
  .brand span { display: none; }
  .nav { gap: .75rem; font-size: .9rem; flex-wrap: nowrap; }
  .topbar { gap: .4rem; flex-wrap: nowrap; }
  .original-body { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi-price { grid-column: 1 / -1; text-align: left; }
  .kpi { font-size: 1.1rem; }
  .items-table { font-size: .85rem; }
  .items-table th:nth-child(4), .items-table td:nth-child(4) { display: none; }
  .items-table tfoot td[colspan] { }
  .card { padding: .9rem; }
}

/* ---------- mehrere Fotos / Perspektiven ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin: .4rem 0 .8rem; }
.photo-tile { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--sand); border: 1px solid var(--line); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile.removed img { opacity: .3; filter: grayscale(1); }
.photo-badge { position: absolute; left: 6px; top: 6px; background: rgba(31, 77, 63, .88); color: #fff; font-size: .72rem; font-weight: 700; padding: .15rem .45rem; border-radius: 999px; }
.photo-del { position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; border-radius: 50%; border: none; background: rgba(0, 0, 0, .6); color: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.photo-del:hover { background: var(--danger); }
.photo-remove { position: absolute; left: 6px; bottom: 6px; background: rgba(255, 255, 255, .92); border-radius: 8px; padding: .15rem .45rem; font-size: .8rem; display: flex; gap: .3rem; align-items: center; cursor: pointer; }
.photo-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; cursor: pointer; border-style: dashed; color: var(--green); font-weight: 600; font-size: .85rem; text-align: center; padding: .5rem; }
.photo-add:hover { background: var(--sand-2); }
.photo-empty-box { border: 2px dashed var(--sand-2); border-radius: 12px; background: var(--sand); text-align: center; color: var(--muted); padding: 1.2rem; }
.facts { margin: .6rem 0 0; display: grid; grid-template-columns: auto 1fr; gap: .3rem .8rem; font-size: .92rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.render-stage .hidden-view { display: none; }
.view-strip { display: flex; gap: .5rem; margin-top: .5rem; overflow-x: auto; padding-bottom: .2rem; }
.view-thumb { flex: 0 0 auto; width: 120px; border: 2px solid transparent; border-radius: 10px; padding: 0; background: var(--sand); cursor: pointer; overflow: hidden; text-align: left; font: inherit; }
.view-thumb img { width: 100%; height: 72px; object-fit: cover; display: block; }
.view-thumb span { display: block; font-size: .75rem; padding: .2rem .4rem; font-weight: 600; }
.view-thumb.active { border-color: var(--green); }
.view-thumb:focus-visible { outline: 2px solid var(--accent); }

/* ---------- Änderungswunsch für alle Varianten ---------- */
.change-all { border: 2px solid var(--accent); }
.change-all textarea { margin-top: .4rem; resize: vertical; min-height: 96px; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0; }
.chip { border: 1px solid var(--line); background: var(--sand); border-radius: 999px; padding: .3rem .7rem; font: inherit; font-size: .85rem; cursor: pointer; }
.chip:hover { border-color: var(--green-2); }
.change-all-foot { align-items: center; }
.change-all-foot .spacer { flex: 1; }
.change-line { margin-top: .35rem; }
.change-form textarea { flex: 1; resize: vertical; min-height: 44px; }
.change-form { align-items: flex-start; }

/* ---------- Fragetool & Schirm-Schalter ---------- */
.ask-panel { border: 2px solid var(--green-2); }
.ask-panel textarea { margin-top: .4rem; resize: vertical; min-height: 60px; }
.qa { border-top: 1px solid var(--line); padding: .7rem 0 .2rem; }
.qa-q { font-weight: 700; margin-bottom: .3rem; }
.qa-a { white-space: pre-line; line-height: 1.5; }
.qa-use { margin-top: .5rem; white-space: normal; text-align: left; height: auto; }
.umb-toggle.on { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.umb-toggle.off { background: var(--sand); color: var(--muted); }
.extras { display: flex; flex-wrap: wrap; gap: 6px; }
.extra-toggle { padding: 6px 10px; font-size: .85rem; }
.extra-toggle.unavailable { opacity: .55; border-style: dashed; }
