/* NextRB ProductScan – fürs Handy zuerst, gleiche Farben wie die 3D-Tools */
:root {
  --petrol: #0D4D55; --petrol-tief: #0A3A40; --blau: #1d7368; --kupfer: #b5461f; --gruen: #1d7a3d; --gruen-hell: #e7f6ec;
  --fond: #F3F6F6; --fuellung: #E3EFF0; --linie: #cfdfe1; --tinte: #10333a; --grau: #516d73; --rot: #b3261e; --rot-hell: #fdecea; --gelb-hell: #fff4d6;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--fond); color: var(--tinte); font-family: 'Schibsted Grotesk', system-ui, sans-serif; font-size: 16px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blau); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprung { position: absolute; left: 8px; top: -60px; z-index: 300; background: var(--petrol); color: #fff; padding: 8px 14px; border-radius: 8px; }
.sprung:focus { top: 8px; }

.kopf { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); background: #fff; border-bottom: 1.5px solid var(--linie); }
.zurueck { color: var(--blau); text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; }
.marke { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--petrol); font-size: 17px; margin-right: auto; }
.marke svg { width: 28px; height: 28px; }

.inhalt { width: min(760px, 100%); margin: 0 auto; padding: 16px 14px 60px; }
h1 { font-size: 24px; line-height: 1.2; margin: 6px 0 4px; color: var(--petrol); letter-spacing: -.01em; }
h2 { font-size: 18px; margin: 22px 0 10px; color: var(--petrol); }
.unter { color: var(--grau); margin: 0 0 14px; }
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid var(--petrol); background: var(--petrol); color: #fff; font-weight: 700; border-radius: 12px; padding: 11px 16px; cursor: pointer; text-decoration: none; min-height: 46px; }
.knopf:hover { background: var(--petrol-tief); }
.knopf.zweit { background: #fff; color: var(--petrol); border-color: var(--linie); }
.knopf.zweit:hover { border-color: var(--petrol); }
.knopf.gross { width: 100%; font-size: 17px; min-height: 56px; border-radius: 16px; }
.knopf:disabled { opacity: .5; cursor: not-allowed; }
.knopf svg, .kachel svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ikon { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1.5px solid var(--linie); background: #fff; color: var(--petrol); border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 16px; }
.ikon.hell { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.4); }

/* Startkacheln (Mitarbeiter) */
.kacheln { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kachel { display: grid; gap: 6px; align-content: start; text-align: left; background: #fff; border: 1.5px solid var(--linie); border-radius: 18px; padding: 16px; cursor: pointer; min-height: 140px; }
.kachel:hover { border-color: var(--blau); box-shadow: 0 10px 26px -18px rgba(13,77,85,.6); }
.kachel .sym { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--fuellung); color: var(--petrol); }
.kachel b { font-size: 16px; color: var(--petrol); }
.kachel small { color: var(--grau); font-size: 13.5px; }
.kachel .marke-ki { justify-self: start; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: var(--blau); border-radius: 999px; padding: 2px 8px; }
@media (max-width: 420px) { .kacheln { grid-template-columns: minmax(0, 1fr); } .kachel { min-height: 0; grid-template-columns: 44px 1fr; align-items: center; } .kachel .sym { grid-row: span 2; } }

/* Chips (Feld, Seite, Planung) */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.chip { flex: none; border: 1.5px solid var(--linie); background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { border-color: var(--blau); background: var(--blau); color: #fff; }

/* Produktkarten */
.ebene { margin-top: 16px; }
.ebene h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--grau); margin: 0 0 8px; }
.produkte { display: grid; gap: 8px; }
.produkt { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; background: #fff; border: 1.5px solid var(--linie); border-radius: 14px; padding: 8px 12px 8px 8px; cursor: pointer; text-align: left; width: 100%; }
.produkt:hover { border-color: var(--blau); }
.produkt.markiert { border-color: var(--gruen); box-shadow: 0 0 0 3px rgba(29,122,61,.18); }
.produkt .bild { width: 64px; height: 64px; border-radius: 10px; background: var(--fuellung) center/contain no-repeat; }
.produkt b { display: block; font-size: 15px; }
.produkt small { display: block; color: var(--grau); font-size: 13px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.preis { font-weight: 800; color: var(--petrol); white-space: nowrap; font-size: 16px; }

/* Detail */
.detail { display: grid; gap: 14px; }
.detail .grossbild { width: 100%; aspect-ratio: 4 / 3; border-radius: 16px; background: var(--fuellung) center/contain no-repeat; }
.detail .preis { font-size: 26px; }
.detail dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 14.5px; }
.detail dt { color: var(--grau); }
.detail dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.platzListe { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.platzListe li { background: var(--fond); border-radius: 10px; padding: 8px 12px; font-size: 14px; }

.meldung { border-radius: 12px; padding: 10px 12px; font-size: 14.5px; margin: 10px 0; }
.meldung.ok { background: var(--gruen-hell); color: #13512a; border: 1px solid #b3dfc2; }
.meldung.warn { background: var(--rot-hell); color: #7c1d16; border: 1px solid #f0c1bb; }
.meldung.info { background: #eef6f8; color: var(--petrol); border: 1px solid #c4dde3; }
.meldung.gelb { background: var(--gelb-hell); color: #6b4a00; border: 1px solid #f0d58a; }
.leer { text-align: center; color: var(--grau); padding: 26px 12px; border: 1.5px dashed var(--linie); border-radius: 16px; background: #fff; }
.suche input { width: 100%; border: 1.5px solid var(--linie); border-radius: 12px; padding: 11px 14px; background: #fff; }
.suche input:focus { border-color: var(--blau); outline: none; }
.fuss { margin-top: 30px; text-align: center; color: var(--grau); font-size: 12.5px; }
.fortschritt { display: flex; align-items: center; gap: 12px; font-weight: 600; padding: 18px 0; }
.fortschritt i { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--fuellung); border-top-color: var(--blau); animation: dreh .9s linear infinite; flex: none; }
@keyframes dreh { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .fortschritt i { animation-duration: 3s; } }

/* Foto + KI */
.fotoFlaeche { display: grid; place-items: center; gap: 10px; border: 2px dashed #9fc0c4; border-radius: 18px; background: #f7fbfb; padding: 22px 14px; text-align: center; }
.fotoFlaeche img { max-width: 100%; max-height: 50vh; border-radius: 12px; }
.ergebnis { display: grid; gap: 8px; margin-top: 12px; }
.zeile { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; background: #fff; border: 1.5px solid var(--linie); border-radius: 12px; padding: 10px 12px; }
.zeile .st { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; }
.zeile .st.ok { background: var(--gruen); } .zeile .st.fehlt { background: var(--rot); } .zeile .st.falsch { background: var(--kupfer); } .zeile .st.unsicher { background: #8a7a2a; }
.zeile b { display: block; }
.zeile small { color: var(--grau); }

/* Scanner */
.scanner { position: fixed; inset: 0; z-index: 200; background: #071c20; color: #fff; display: grid; grid-template-rows: auto 1fr auto auto; }
.scanKopf { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; padding-top: max(12px, env(safe-area-inset-top)); }
.scanKopf h2 { margin: 0; color: #fff; font-size: 17px; }
.scanBild { position: relative; overflow: hidden; }
.scanBild video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanRahmen { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.scanRahmen span { width: min(78vw, 420px); aspect-ratio: 16 / 9; border: 3px solid #8be0a4; border-radius: 16px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
.scanPause { position: absolute; inset: 0; z-index: 2; border: 0; background: rgba(7,28,32,.82); color: #fff; font: inherit; font-size: 17px; font-weight: 700; padding: 24px; cursor: pointer; }
.scanPause:focus-visible { outline: 3px solid #8be0a4; outline-offset: -6px; }
.scanBild.pausiert .scanRahmen { display: none; }
.scanKopf { gap: 8px; }
.scanKopf h2 { flex: 1; }
.scanLicht[aria-pressed="true"] { background: #f5d76e; color: #071c20; }
.scanLicht svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.scanHinweis { margin: 10px 16px 0; text-align: center; color: #cfe6e8; }
.scanHand { display: flex; gap: 8px; padding: 12px 14px; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.scanHand input { flex: 1; min-width: 0; border: 0; border-radius: 12px; padding: 12px 14px; }

.dlg { border: 0; border-radius: 20px; padding: 0; width: min(620px, calc(100vw - 20px)); max-height: calc(100dvh - 20px); box-shadow: 0 24px 70px rgba(13,77,85,.35); color: var(--tinte); }
.dlg::backdrop { background: rgba(10,40,45,.5); }
.dlgKopf { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1.5px solid var(--linie); position: sticky; top: 0; background: #fff; z-index: 2; }
.dlgKopf h2 { margin: 0; font-size: 17px; }
.dlgInhalt { padding: 16px; overflow: auto; max-height: calc(100dvh - 90px); }
.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 400; background: var(--petrol); color: #fff; padding: 11px 16px; border-radius: 12px; font-weight: 600; box-shadow: 0 10px 30px rgba(13,77,85,.35); max-width: calc(100vw - 28px); }
.aktionen { display: flex; gap: 8px; flex-wrap: wrap; }
.liste { display: grid; gap: 8px; }
.listenKarte { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; background: #fff; border: 1.5px solid var(--linie); border-radius: 14px; padding: 10px 12px; }
.listenKarte b { display: block; }
.listenKarte small { color: var(--grau); }
.qr { display: grid; place-items: center; margin: 10px 0; }
.qr img, .qr canvas { border: 1px solid var(--linie); border-radius: 12px; padding: 8px; background: #fff; }
.feldzeile { display: grid; gap: 6px; margin-bottom: 12px; }
.feldzeile > span { font-weight: 600; font-size: 13.5px; color: var(--grau); }

/* Kunde: Code scannen | Foto machen */
.knopfReihe { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.knopfReihe .knopf.gross { font-size: 16px; padding: 10px; }
.knopf.zweit.gross { background: #fff; color: var(--petrol); }
.listenKarte .feldzeile { order: 3; grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.listenKarte .feldzeile > span { font-size: 13px; color: var(--grau); }

/* Sprache als Auswahl: nur die aktuelle Flagge, Liste beim Öffnen */
.sprachen { position: relative; display: block; }
.spracheKnopf { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 8px; border: 1.5px solid var(--linie, #cfdfe1); border-radius: 9px; background: var(--flaeche, #fff); color: var(--petrol, #0D4D55); cursor: pointer; font-weight: 700; font-size: 12.5px; }
.spracheKnopf svg.flagge { width: 24px; height: 17px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.spracheKnopf svg.pfeil { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.spracheListe { position: absolute; right: 0; top: calc(100% + 6px); z-index: 120; min-width: 170px; padding: 5px; margin: 0; list-style: none; background: var(--flaeche, #fff); border: 1.5px solid var(--linie, #cfdfe1); border-radius: 12px; box-shadow: 0 14px 34px rgba(13,77,85,.25); }
.spracheListe[hidden] { display: none; }
.spracheListe button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 9px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: inherit; font-size: 13.5px; text-align: left; }
.spracheListe button:hover, .spracheListe button:focus-visible { background: rgba(29,115,104,.08); }
.spracheListe button[aria-checked="true"] { font-weight: 700; }
.spracheListe svg { width: 24px; height: 17px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.marke .version { font-size: 12px; font-weight: 400; color: var(--grau); }

/* 3D und AR in der Kundenansicht */
.modellKarte { position: relative; background: #fff; border: 1.5px solid var(--linie); border-radius: 18px; padding: 10px; margin: 0 0 16px; }
.modellKarte .buehne { position: relative; height: min(52vh, 440px); border-radius: 12px; background: var(--fuellung) center / cover no-repeat; overflow: hidden; }
.modellKarte .buehne.aktiv { background: linear-gradient(180deg, #f7fafa, #e6eeef); cursor: grab; }
.modellKarte .buehne canvas { display: block; }
.modellKarte .modellStart { position: absolute; top: 18px; right: 18px; z-index: 2; }
.modellKarte .ikon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.modellKarte .knopfReihe .knopf { padding: 10px 12px; }
.modellKarte .modellStatus { margin: 8px 2px; min-height: 1.2em; font-size: 14px; color: var(--grau); }
.modellKarte .modellStatus:empty { margin: 4px 0; min-height: 0; }
.knopfReihe.einzeln { grid-template-columns: 1fr; }
