/* Scan-Studio – gleiche Farben und Schriften wie der Shop (Theme «kartenshop») */

@font-face {
	font-family: "Manrope";
	src: url("fonts/manrope-latin-wght-normal.woff2") format("woff2");
	font-weight: 200 800;
	font-display: swap;
}

@font-face {
	font-family: "Sora";
	src: url("fonts/sora-latin-wght-normal.woff2") format("woff2");
	font-weight: 100 800;
	font-display: swap;
}

:root {
	--grund: #11141b;
	--flaeche: #1b2030;
	--linie: #2a3045;
	--gold: #e6b54a;
	--gold-dunkel: #c99a32;
	--text: #f2efe6;
	--leise: #a3a7b5;
	--fehler: #f07a6a;
	--ok: #7fcf95;
	--radius: 14px;
	--abstand: 16px;
	color-scheme: dark;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	min-height: 100%;
	background: var(--grund);
	color: var(--text);
	font: 16px/1.5 "Manrope", system-ui, sans-serif;
	-webkit-tap-highlight-color: transparent;
}

body {
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

h1 {
	font: 600 1.5rem/1.2 "Sora", system-ui, sans-serif;
	margin: 0 0 var(--abstand);
}

[hidden] {
	display: none !important;
}

/* --- Kopf --- */

.kopf {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px var(--abstand);
	border-bottom: 1px solid var(--linie);
}

.kopf__titel {
	font: 600 1.05rem "Sora", system-ui, sans-serif;
	color: var(--gold);
}

.kopf__abmelden {
	background: none;
	border: 0;
	color: var(--leise);
	font: inherit;
	font-size: 0.9rem;
	padding: 8px 0 8px 12px;
	cursor: pointer;
}

main {
	flex: 1;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 560px;
	margin: 0 auto;
	padding: var(--abstand);
}

.ansicht {
	display: flex;
	flex-direction: column;
	gap: var(--abstand);
}

/* --- Bausteine --- */

.karte {
	background: var(--flaeche);
	border: 1px solid var(--linie);
	border-radius: var(--radius);
	padding: 20px;
}

.formular {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.formular label {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 0.9rem;
	color: var(--leise);
}

input {
	font: inherit;
	font-size: 1rem; /* verhindert Zoom auf iOS */
	color: var(--text);
	background: var(--grund);
	border: 1px solid var(--linie);
	border-radius: 10px;
	padding: 12px 14px;
	width: 100%;
}

input:focus {
	outline: 2px solid var(--gold);
	outline-offset: 1px;
}

.knopf {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 12px 20px;
	border-radius: 999px;
	border: 1px solid var(--linie);
	background: var(--flaeche);
	color: var(--text);
	font: 600 1rem "Manrope", system-ui, sans-serif;
	cursor: pointer;
	text-align: center;
}

.knopf--haupt {
	background: var(--gold);
	border-color: var(--gold);
	color: var(--grund);
}

.knopf--haupt:active {
	background: var(--gold-dunkel);
}

.knopf:disabled {
	opacity: 0.45;
	cursor: default;
}

.knopf--leise {
	background: none;
	border: 0;
	color: var(--leise);
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.knopf--rund {
	width: 52px;
	height: 52px;
	padding: 0;
	font-size: 1.3rem;
}

.knopfreihe {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.meldung {
	margin: 0;
	min-height: 1.5em;
	color: var(--fehler);
	font-size: 0.9rem;
}

.meldung:empty {
	min-height: 0;
}

.status {
	margin: 0;
	color: var(--leise);
	font-size: 0.9rem;
	text-align: center;
}

.status.is-ok {
	color: var(--ok);
}

.status.is-fehler {
	color: var(--fehler);
}

.laden {
	text-align: center;
	color: var(--leise);
}

/* --- Start --- */

.gruss {
	margin: 0;
	color: var(--leise);
}

.auswahl {
	display: grid;
	gap: 14px;
}

.kachel {
	display: grid;
	grid-template-columns: 56px 1fr;
	grid-template-rows: auto auto;
	column-gap: 16px;
	align-items: center;
	text-align: left;
	padding: 20px;
	border-radius: var(--radius);
	border: 1px solid var(--linie);
	background: var(--flaeche);
	color: var(--text);
	font: inherit;
	cursor: pointer;
}

.kachel:active {
	border-color: var(--gold);
}

.kachel__symbol {
	grid-row: span 2;
	width: 56px;
	height: 56px;
	border-radius: 12px;
	background: rgba(230, 181, 74, 0.12);
	position: relative;
}

.kachel__symbol::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	border: 2px solid var(--gold);
}

.kachel__symbol--karte::after {
	width: 24px;
	height: 33px;
	border-radius: 3px;
}

.kachel__symbol--produkt::after {
	width: 30px;
	height: 30px;
	border-radius: 6px;
}

.kachel__symbol--entwurf::after {
	width: 26px;
	height: 30px;
	border-radius: 3px;
	border-style: dashed;
}

.kachel__symbol--bestellung::after {
	width: 30px;
	height: 22px;
	border-radius: 3px;
	box-shadow: inset 0 -8px 0 -6px var(--gold);
}

.kachel__symbol--kunde::after {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	transform: translateY(-8px);
}

/* Schultern */
.kachel__symbol--kunde::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 12px;
	margin: auto;
	width: 28px;
	height: 12px;
	border: 2px solid var(--gold);
	border-bottom: 0;
	border-radius: 14px 14px 0 0;
}

.kachel__titel {
	font: 600 1.1rem "Sora", system-ui, sans-serif;
}

.kachel__text {
	color: var(--leise);
	font-size: 0.9rem;
}

/* --- Kamera --- */

.ansicht--kamera {
	flex: 1;
}

.sucher {
	position: relative;
	flex: 1;
	min-height: 55dvh;
	border-radius: var(--radius);
	overflow: hidden;
	background: #000;
}

.sucher video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Hilfsrahmen: Karte 63 × 88 mm, Slab ca. 3:5, Produkt quadratisch */
.sucher__rahmen {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 72%;
	aspect-ratio: 63 / 88;
	max-height: 86%;
	border: 2px solid var(--gold);
	border-radius: 4%;
	box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.45);
	pointer-events: none;
}

.sucher__rahmen.is-produkt {
	width: 82%;
	aspect-ratio: 1;
	border-radius: 2%;
}

.sucher__hinweis {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 10px;
	margin: 0;
	padding: 0 var(--abstand);
	text-align: center;
	font-size: 0.85rem;
	color: var(--text);
	text-shadow: 0 1px 3px #000;
}

.kamera-leiste {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 4px 8px;
}

.ausloeser {
	width: 76px;
	height: 76px;
	border-radius: 50%;
	border: 4px solid var(--text);
	background: var(--gold);
	box-shadow: inset 0 0 0 4px var(--grund);
	cursor: pointer;
}

.ausloeser:active {
	transform: scale(0.94);
}

.ausloeser:disabled {
	opacity: 0.4;
}

.kamera-app {
	align-self: center;
}

/* --- Vorschau --- */

.vorschau {
	margin: 0;
	background: var(--flaeche);
	border: 1px solid var(--linie);
	border-radius: var(--radius);
	overflow: hidden;
}

.vorschau img {
	display: block;
	width: 100%;
	max-height: 60dvh;
	object-fit: contain;
	background: #000;
}

.vorschau figcaption {
	padding: 10px 14px;
	color: var(--leise);
	font-size: 0.85rem;
}

/* --- Umschalter Karte / Slab --- */

.umschalter {
	display: grid;
	grid-template-columns: 1fr 1fr;
	padding: 4px;
	border-radius: 999px;
	background: var(--flaeche);
	border: 1px solid var(--linie);
}

.umschalter button {
	min-height: 40px;
	border: 0;
	border-radius: 999px;
	background: none;
	color: var(--leise);
	font: 600 0.95rem "Manrope", system-ui, sans-serif;
	cursor: pointer;
}

.umschalter button[aria-checked="true"] {
	background: var(--gold);
	color: var(--grund);
}

.sucher__rahmen.is-slab {
	width: 62%;
	aspect-ratio: 80 / 135;
	border-radius: 3%;
}

/* --- Ecken-Editor --- */

.hinweis {
	margin: 0;
	font-size: 0.9rem;
	color: var(--leise);
}

.hinweis.is-warnung {
	color: var(--gold);
}

.editor {
	position: relative;
	align-self: center;
	max-width: 100%;
	touch-action: none; /* Ziehen statt Scrollen */
	user-select: none;
	-webkit-user-select: none;
}

.editor img {
	display: block;
	max-width: 100%;
	max-height: 62dvh;
	border-radius: 8px;
}

.editor__ebene {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
}

.editor__ebene polygon {
	fill: rgba(230, 181, 74, 0.12);
	stroke: var(--gold);
	stroke-width: 2;
}

.editor__ebene circle {
	fill: rgba(17, 20, 27, 0.35);
	stroke: var(--gold);
	stroke-width: 3;
	cursor: grab;
}

.editor__ebene circle.is-aktiv {
	fill: rgba(230, 181, 74, 0.45);
}

.lupe {
	position: absolute;
	width: 120px;
	height: 120px;
	border-radius: 50%;
	border: 3px solid var(--gold);
	background: #000;
	pointer-events: none;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

/* --- Scan-Ergebnis --- */

.scan-ergebnis {
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}

.scan-ergebnis img {
	display: block;
	max-width: 100%;
	max-height: 62dvh;
	filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.55));
}

.scan-ergebnis figcaption {
	color: var(--leise);
	font-size: 0.85rem;
}

/* --- Erkennung --- */

.zwischentitel {
	margin: 4px 0 0;
	font: 600 1.1rem "Sora", system-ui, sans-serif;
}

.gelesen,
.auswahl-karte {
	display: grid;
	grid-template-columns: 72px 1fr;
	gap: 14px;
	align-items: center;
}

.gelesen img,
.auswahl-karte img {
	width: 72px;
	border-radius: 4px;
}

.gelesen p,
.auswahl-karte p {
	margin: 0;
}

.gelesen__titel {
	color: var(--leise);
	font-size: 0.85rem;
}

.treffer {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 10px;
}

.treffer button {
	width: 100%;
	display: grid;
	grid-template-columns: 64px 1fr auto;
	gap: 12px;
	align-items: center;
	padding: 10px;
	text-align: left;
	border-radius: var(--radius);
	border: 1px solid var(--linie);
	background: var(--flaeche);
	color: var(--text);
	font: inherit;
	cursor: pointer;
}

.treffer button:active,
.treffer li:first-child button {
	border-color: var(--gold);
}

.treffer img,
.treffer .ohne-bild {
	width: 64px;
	aspect-ratio: 63 / 88;
	border-radius: 4px;
	object-fit: cover;
	background: var(--grund);
}

.treffer__name {
	display: block;
	font-weight: 700;
}

.treffer__info {
	display: block;
	color: var(--leise);
	font-size: 0.85rem;
}

.treffer__preis {
	font-weight: 700;
	color: var(--gold);
	font-size: 0.9rem;
	white-space: nowrap;
}

.suche summary {
	cursor: pointer;
	font-weight: 600;
}

.suche[open] summary {
	margin-bottom: 14px;
}

.zeile {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

select,
textarea {
	font: inherit;
	font-size: 1rem;
	color: var(--text);
	background: var(--grund);
	border: 1px solid var(--linie);
	border-radius: 10px;
	padding: 12px 14px;
	width: 100%;
}

textarea {
	resize: vertical;
	line-height: 1.4;
}

.auswahl-karte__name {
	font-weight: 700;
	font-size: 1.05rem;
}

.auswahl-karte__info {
	color: var(--leise);
	font-size: 0.9rem;
}

.auswahl-karte .knopf--leise {
	min-height: 0;
	padding: 6px 0 0;
}

.preisherkunft {
	margin: -6px 0 0;
	color: var(--leise);
	font-size: 0.8rem;
}

/* --- Studio-Look --- */

.studio-bild {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: center;
}

.studio-bild img {
	display: block;
	width: 100%;
	max-height: 62dvh;
	object-fit: contain;
	border-radius: 10px;
	background: var(--flaeche);
}

.studio-bild figcaption {
	color: var(--leise);
	font-size: 0.85rem;
}

/* --- Bilder des Produkts --- */

.bilder {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.bilder:empty {
	display: none;
}

.bilder figure {
	position: relative;
	margin: 0;
	width: 84px;
}

.bilder img {
	display: block;
	width: 84px;
	height: 84px;
	object-fit: contain;
	border-radius: 8px;
	background: var(--flaeche);
	border: 1px solid var(--linie);
}

.bilder figcaption {
	font-size: 0.75rem;
	color: var(--leise);
	text-align: center;
}

.bilder button {
	position: absolute;
	top: -8px;
	right: -8px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 1px solid var(--linie);
	background: var(--grund);
	color: var(--text);
	cursor: pointer;
	font-size: 0.9rem;
	line-height: 1;
}

/* --- Gespeichert --- */

.erfolg {
	text-align: center;
}

.erfolg__symbol {
	margin: 0 auto 8px;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--ok);
	color: var(--grund);
	font-size: 1.8rem;
	line-height: 56px;
	font-weight: 700;
}

.erfolg h1 {
	margin-bottom: 6px;
}

.erfolg p {
	margin: 0 0 6px;
}

a.knopf {
	text-decoration: none;
}

/* --- Entwürfe --- */

.entwuerfe {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 14px;
}

.entwurf {
	display: grid;
	gap: 12px;
}

.entwurf__kopf {
	display: grid;
	grid-template-columns: 64px 1fr;
	gap: 12px;
	align-items: center;
}

.entwurf__kopf img,
.entwurf__ohne-bild {
	width: 64px;
	height: 64px;
	object-fit: contain;
	border-radius: 8px;
	background: var(--grund);
}

.entwurf__name {
	font-weight: 600;
	overflow-wrap: anywhere;
}

.entwurf__info {
	color: var(--leise);
	font-size: 0.85rem;
}

.entwurf__aktionen {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.entwurf__aktionen .knopf {
	margin: 0;
}

.knopf--gefahr {
	color: var(--fehler);
}

.entwurf .meldung {
	margin: 0;
}

.entwurf .meldung.is-ok {
	color: var(--ok);
}

/* --- Bestellungen --- */

.bestellungen {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 12px;
}

.bestellung-eintrag {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 4px 12px;
	width: 100%;
	text-align: left;
	color: var(--text);
	font: inherit;
	cursor: pointer;
}

.bestellung-eintrag:active {
	border-color: var(--gold);
}

.bestellung-eintrag__nummer {
	font-weight: 700;
}

.bestellung-eintrag__total {
	font-weight: 700;
	text-align: right;
}

.bestellung-eintrag__info {
	grid-column: 1 / -1;
	color: var(--leise);
	font-size: 0.85rem;
}

.bestellung-status {
	display: inline-block;
	margin: 4px 0;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 0.8rem;
	font-weight: 700;
	background: var(--linie);
	color: var(--text);
}

.bestellung-status.is-offen {
	background: var(--gold);
	color: var(--grund);
}

#kunde-email {
	color: var(--gold);
	overflow-wrap: anywhere;
}

.bestellung-kopf h1 {
	margin: 0;
}

.bestellung-abschnitt {
	margin: 0 0 8px;
	font: 600 1rem "Sora", system-ui, sans-serif;
}

.bestellung-artikel {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 10px;
}

.bestellung-artikel li {
	display: grid;
	grid-template-columns: 48px 1fr auto;
	gap: 10px;
	align-items: center;
}

.bestellung-artikel img,
.bestellung-artikel .entwurf__ohne-bild {
	width: 48px;
	height: 48px;
	object-fit: contain;
	border-radius: 6px;
	background: var(--grund);
}

.bestellung-summe {
	margin: 12px 0 0;
	text-align: right;
}

.auswahl-zeile {
	display: flex !important;
	flex-direction: row !important;
	justify-content: flex-start !important;
	align-items: center;
	gap: 10px;
	color: var(--text) !important;
}

.auswahl-zeile input {
	width: 22px;
	height: 22px;
	accent-color: var(--gold);
}

