:root {
	--lp-color-primary: #1d4ed8;
	--lp-color-bg: #f5f2ee;
	--lp-color-surface: #ffffff;
	--lp-color-text: #1f2933;
	--lp-color-muted: #6b7280;
	--lp-color-border: #d8d3cb;
	--lp-color-success: #1a7f37;
	--lp-color-danger: #c0392b;
	--lp-color-gebaeck-bg: #fdf6ea;
	--lp-color-gebaeck-border: #e3cd9c;
	--lp-color-extra-bg: #eef8f0;
	--lp-color-extra-border: #b9dfc2;
	--lp-radius: 10px;
	--lp-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--lp-font-family-accent: cursive;
}

.lp-wizard {
	box-sizing: border-box;
	width: 100%;
	padding: 1.5rem;
	background: var(--lp-color-surface);
	color: var(--lp-color-text);
	font-family: var(--lp-font-family);
	border-radius: var(--lp-radius);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}
.lp-wizard *,
.lp-wizard *::before,
.lp-wizard *::after {
	box-sizing: inherit;
}

.lp-progress {
	margin-bottom: 1rem;
}
.lp-progress-bar {
	height: 4px;
	background: var(--lp-color-border);
	border-radius: 999px;
	overflow: hidden;
}
.lp-progress-fill {
	height: 100%;
	width: 33%;
	background: var(--lp-color-primary);
	transition: width 0.25s ease;
}
.lp-progress-row {
	margin-top: 0.5rem;
	text-align: right;
}
.lp-progress-nav {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	background: var(--lp-color-bg);
	border-radius: 999px;
	padding: 0.3rem 0.4rem;
}
.lp-progress-nav-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.75rem;
	height: 1.75rem;
	flex: none;
	border: none;
	border-radius: 50%;
	background: var(--lp-color-surface);
	color: var(--lp-color-text);
	font-size: 1.15rem;
	line-height: 1;
	cursor: pointer;
}
.lp-progress-nav-btn:hover:not(:disabled) {
	background: var(--lp-color-primary);
	color: #fff;
}
.lp-progress-count {
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--lp-color-muted);
	padding: 0 0.15rem;
	white-space: nowrap;
}
.lp-progress-nav .lp-btn-small {
	margin-left: 0.15rem;
}

.lp-steps {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	border-bottom: 1px solid var(--lp-color-border);
	padding-bottom: 0.75rem;
	margin-bottom: 1.5rem;
}
/* Same [hidden]-vs-author-display issue as .lp-lightbox below: without
   this, hiding the step bar after a successful submission wouldn't
   actually hide it. */
.lp-steps[hidden] {
	display: none;
}
.lp-step {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	color: var(--lp-color-muted);
	font-weight: 600;
	padding: 0 0 0.75rem;
	margin-bottom: -0.76rem;
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	font: inherit;
	font-weight: 600;
	cursor: default;
}
.lp-step:not(:disabled) {
	cursor: pointer;
}
.lp-step:not(:disabled):hover {
	color: var(--lp-color-text);
}
.lp-step:disabled {
	opacity: 0.6;
}
.lp-step-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.5rem;
	height: 1.5rem;
	flex: none;
	border-radius: 999px;
	font-size: 0.8rem;
	background: var(--lp-color-border);
	color: var(--lp-color-text);
}
.lp-step.is-active {
	color: var(--lp-color-primary);
	border-bottom-color: var(--lp-color-primary);
}
.lp-step.is-active .lp-step-number {
	background: var(--lp-color-primary);
	color: #fff;
}
.lp-step.is-done .lp-step-number {
	background: var(--lp-color-success);
	color: #fff;
}
.lp-step.is-done:not(:disabled):hover .lp-step-number {
	filter: brightness(0.92);
}

.lp-panel {
	display: none;
}
.lp-panel.is-active {
	display: block;
}

.lp-intro-text {
	color: var(--lp-color-text);
	line-height: 1.5;
	margin-bottom: 1.5rem;
}

/* Auto-fit so multiple packages (e.g. "Lunchpaket" and "Catering") sit
   side by side once there's room for more than one at that minimum
   width, and collapse back to a single column otherwise — no fixed
   breakpoint, since .lp-wizard's own width is now whatever the embedding
   page gives it, not a value this stylesheet controls. */
.lp-package-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 1rem;
	align-items: start;
}
.lp-package-item {
	border: 1px solid var(--lp-color-border);
	border-radius: var(--lp-radius);
	padding: 1rem;
}
.lp-package-checkbox {
	display: block;
	cursor: pointer;
}
/* Image beside the text (name/qty/description), not stacked above it —
   a large package photo stacked full-width was pushing the description
   far down the page. */
.lp-package-checkbox-content {
	display: flex;
	gap: 1rem;
	align-items: flex-start;
}
.lp-package-text {
	flex: 1 1 auto;
	min-width: 0;
}
.lp-package-checkbox-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.75rem;
}
.lp-package-checkbox-input {
	width: 1.25rem;
	height: 1.25rem;
	flex: none;
	accent-color: var(--lp-color-primary);
}
.lp-package-name {
	font-size: 1.05rem;
	font-weight: 600;
	flex: 1 1 auto;
	min-width: 8rem;
}
.lp-field-person-count {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin-bottom: 1.25rem;
}
.lp-field-person-count .lp-field-label {
	display: inline;
	margin-bottom: 0;
	white-space: nowrap;
}
.lp-person-qty-slider {
	flex: 1 1 auto;
	width: auto;
	min-width: 100px;
	accent-color: var(--lp-color-primary);
}
.lp-field-person-count input[type="number"] {
	width: auto;
	flex: 0 0 5.5rem;
}
.lp-package-image {
	display: block;
	flex: 0 0 112px;
	width: 112px;
	height: 112px;
	object-fit: cover;
	border-radius: calc(var(--lp-radius) - 2px);
	cursor: pointer;
}
.lp-package-description {
	margin-top: 0.5rem;
	color: var(--lp-color-muted);
}

.lp-field {
	margin-bottom: 0.75rem;
}
.lp-field-label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.3rem;
	font-size: 0.9rem;
}
.lp-field-input {
	width: 100%;
	padding: 0.6rem 0.75rem;
	border: 1px solid var(--lp-color-border);
	border-radius: calc(var(--lp-radius) - 4px);
	font-family: inherit;
	font-size: 1rem;
	background: var(--lp-color-surface);
	color: var(--lp-color-text);
}
.lp-field-input:focus {
	outline: 2px solid var(--lp-color-primary);
	outline-offset: 1px;
	border-color: var(--lp-color-primary);
}

.lp-package-config {
	border: 1px solid var(--lp-color-border);
	border-radius: var(--lp-radius);
	padding: 1.25rem;
	margin-bottom: 1.5rem;
}
.lp-package-config:last-child {
	margin-bottom: 0;
}
.lp-package-config-title {
	font-family: var(--lp-font-family-accent);
	font-size: 1.6rem;
	margin: 0 0 0.25rem;
}
.lp-package-config-desc {
	color: var(--lp-color-muted);
	margin-bottom: 1rem;
}

.lp-item-group {
	border: 1px solid var(--lp-color-border);
	border-radius: calc(var(--lp-radius) - 4px);
	padding: 1rem;
	margin-bottom: 1.25rem;
}
.lp-item-group--gebaeck {
	background: var(--lp-color-gebaeck-bg);
	border-color: var(--lp-color-gebaeck-border);
}
.lp-item-group--zusatz {
	background: var(--lp-color-extra-bg);
	border-color: var(--lp-color-extra-border);
}
.lp-item-group-label {
	font-size: 1rem;
	margin: 0 0 0.75rem;
}
.lp-item-list {
	margin-bottom: 0.75rem;
}
/* Each row is its own clearly bounded card — a visibly different
   surface from the group's own tan/green background, with a gap
   between cards (0.85rem) deliberately *larger* than the gaps used
   *within* a card (0.75rem/0.6rem below). Proximity is what tells two
   adjacent items apart from one grouped item, so the between-card gap
   has to win against the within-card gaps, not just be "some" gap —
   with two Gebäck rows stacked directly on the group background and
   barely any space between them, a second row's Art question used to
   read as if it belonged *inside* the row above it. */
.lp-item-row-wrap {
	background: var(--lp-color-surface);
	border: 1px solid var(--lp-color-border);
	border-radius: calc(var(--lp-radius) - 4px);
	padding: 0.75rem;
	margin-bottom: 0.85rem;
}
/* A small "1."/"2." label, the Art question (Gebäck rows only — it
   fills the space between via flex-grow below) and the one remove
   button that belongs to the whole card, all on one line — always
   present, in both the pending and the fully-answered state, so it's
   never ambiguous which card a given remove button acts on. Extras
   rows have no Art question, so this is just label+remove there;
   margin-left: auto on the remove button (rather than relying on
   justify-content) keeps it pinned to the right edge either way. */
.lp-item-row-header {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	margin-bottom: 0.6rem;
}
.lp-item-row-label {
	flex-shrink: 0;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--lp-color-muted);
	/* Matches .lp-item-row-art label's own top padding so "1." lines up
	   with the first line of tab text instead of the pill's outer edge —
	   align-items is flex-start (not center) because a long custom tab
	   label (see Einstellungen settings) can wrap the pill to several lines,
	   and center would then strand this label and the remove button in
	   the middle of a tall box instead of at its top. */
	padding-top: 0.5rem;
}
/* A fixed grid template — not flex — so Menge (column 3) always lands
   in the same physical position whether or not a given row happens to
   show Belag (column 2). Flexbox would close ranks around a missing
   Belag field and shift Menge left; grid leaves that track's space
   alone even when nothing occupies it. This is also what lets
   .lp-field-sum below line up with Menge exactly, rather than just
   approximately. */
/* Pre-emptive "Art" question (belegt/unbelegt) for a Gebäck row, sitting
   in the row's header line rather than as a grid item itself. Styled as
   a two-segment tab/pill control rather than two plain radio buttons,
   so picking one reads as switching views rather than ticking a
   checkbox: the actual <input type="radio"> stays in the DOM for
   a11y/keyboard use, just visually hidden, and :has() drives the
   active segment's look. flex: 1 1 auto fills the header's remaining
   width between the label and the remove button. */
.lp-item-row-art {
	display: flex;
	flex: 1 1 auto;
	gap: 2px;
	background: var(--lp-color-bg);
	border: 1px solid var(--lp-color-border);
	border-radius: 999px;
	padding: 2px;
}
.lp-item-row-art label {
	position: relative;
	flex: 1 1 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	cursor: pointer;
	text-align: center;
	padding: 0.45rem 0.75rem;
	border-radius: 999px;
	font-size: 0.85rem;
	color: var(--lp-color-muted);
	transition: color 0.15s ease, background-color 0.15s ease;
}
.lp-item-row-art label:hover {
	color: var(--lp-color-text);
}
.lp-item-row-art label:has(input:checked) {
	background: var(--lp-color-primary);
	color: #fff;
	font-weight: 600;
}
.lp-item-row-art input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	pointer-events: none;
}
.lp-item-row {
	display: grid;
	grid-template-columns: minmax(200px, 1fr) 120px 75px;
	gap: 0.75rem;
	align-items: end;
}
/* Format+Gebäck (or just Produkt, for an Extra row) stay grouped as one
   unit so it's clear they describe the same item. Belag (if it appears at
   all) comes right after that group, and Menge trails after Belag. */
.lp-item-row-primary {
	grid-column: 1;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}
.lp-item-row-primary .lp-field {
	flex: 1 1 150px;
}
.lp-item-row .lp-field-belag {
	grid-column: 2;
}
.lp-item-row .lp-field-qty {
	grid-column: 3;
}
.lp-item-row .lp-field {
	margin-bottom: 0;
}
.lp-item-row-remove {
	flex-shrink: 0;
	margin-left: auto;
	height: 2.6rem;
	width: 2.6rem;
}
.lp-item-add-row {
	margin-top: 0.25rem;
}
/* Lines up with Menge's own column exactly, regardless of whether any
   row above happens to show Belag. */
.lp-field-sum {
	grid-column: 3;
}
.lp-field-sum .lp-field-input {
	background: var(--lp-color-bg);
	cursor: default;
}
.lp-item-group-total {
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--lp-color-muted);
	margin: 0.75rem 0 0;
}
.lp-item-group-total.is-complete {
	color: var(--lp-color-success);
}
.lp-item-group-total.is-mismatch {
	color: var(--lp-color-danger);
}

.lp-summary {
	margin-bottom: 1.5rem;
}
.lp-summary-alert {
	color: var(--lp-color-danger);
	font-weight: 600;
	margin: 0 0 0.75rem;
}
.lp-field-comment {
	margin-top: 1rem;
	margin-bottom: 0;
}
.lp-field-comment .lp-field-input {
	resize: vertical;
	min-height: 4.5rem;
}
.lp-summary-text {
	white-space: pre-wrap;
	background: var(--lp-color-bg);
	border-radius: calc(var(--lp-radius) - 4px);
	padding: 0.75rem 1rem;
	font-family: inherit;
	font-size: 0.9rem;
	line-height: 1.5;
	margin: 0;
}

.lp-hp-field {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.lp-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.75rem;
	margin-top: 1.5rem;
	padding-top: 1rem;
	border-top: 1px solid var(--lp-color-border);
}
.lp-actions[hidden] {
	display: none;
}
.lp-btn {
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	padding: 0.65rem 1.4rem;
	border-radius: calc(var(--lp-radius) - 2px);
	border: 1px solid transparent;
	cursor: pointer;
}
.lp-btn-small {
	font-size: 0.85rem;
	padding: 0.4rem 0.9rem;
}
.lp-btn-primary {
	background: var(--lp-color-primary);
	color: #fff;
	margin-left: auto;
}
.lp-btn-primary:hover {
	filter: brightness(0.92);
}
.lp-btn-secondary {
	background: transparent;
	border-color: var(--lp-color-border);
	color: var(--lp-color-text);
}
.lp-btn-secondary:hover {
	background: var(--lp-color-bg);
}
.lp-btn-icon {
	padding: 0.4rem 0.6rem;
	font-size: 1.1rem;
	line-height: 1;
}

/* Replaces .lp-panels/.lp-steps/.lp-progress/.lp-actions in-place once a
   submission succeeds (all four get [hidden] right as this is revealed —
   see handleSubmit()) so the wizard card actually has content in it
   afterward, instead of just the floating .lp-form-message toast above an
   otherwise-empty card. display:flex here needs the explicit [hidden]
   override below — author CSS always beats the UA [hidden]{display:none}
   rule regardless of specificity, same reasoning as .lp-actions above. */
.lp-success {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 0.5rem;
	padding: 2.5rem 1rem;
}
.lp-success[hidden] {
	display: none;
}
.lp-success-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	margin-bottom: 0.5rem;
	border-radius: 50%;
	background: var(--lp-color-success);
	color: #fff;
	font-size: 1.5rem;
	line-height: 1;
}
.lp-success-heading {
	margin: 0;
	font-family: var(--lp-font-family-accent);
	font-size: 1.6rem;
	font-weight: normal;
}
.lp-success-text {
	margin: 0;
	max-width: 32rem;
	color: var(--lp-color-muted);
}

.lp-form-message {
	position: fixed;
	top: 1rem;
	left: 50%;
	transform: translateX(-50%);
	z-index: 9999;
	max-width: calc(100% - 2rem);
	width: max-content;
	padding: 0.75rem 1.25rem;
	border-radius: calc(var(--lp-radius) - 4px);
	font-size: 0.9rem;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}
.lp-form-message.is-error {
	background: #fdecea;
	color: var(--lp-color-danger);
}
.lp-form-message.is-success {
	background: #eaf6ec;
	color: var(--lp-color-success);
}

.lp-loading,
.lp-error-text {
	color: var(--lp-color-muted);
}

@media (max-width: 640px) {
	.lp-wizard {
		padding: 1rem;
		border-radius: 0;
		box-shadow: none;
	}
	.lp-package-image {
		flex-basis: 76px;
		width: 76px;
		height: 76px;
	}
	.lp-item-row-art {
		flex-direction: column;
		border-radius: 10px;
	}
	.lp-item-row-art label {
		border-radius: 8px;
	}
	.lp-item-row {
		grid-template-columns: 1fr;
	}
	.lp-item-row-primary,
	.lp-item-row .lp-field-belag,
	.lp-item-row .lp-field-qty,
	.lp-field-sum {
		grid-column: 1;
	}
	.lp-steps {
		gap: 0.5rem 1rem;
	}
	.lp-step-label {
		display: none;
	}
	.lp-btn {
		flex: 1 1 auto;
		text-align: center;
	}
}

.lp-lightbox {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem;
	background: rgba(0, 0, 0, 0.85);
}
/* The [hidden] attribute selector (0,2,0) beats the bare class above
   (0,1,0), so this reliably wins regardless of source order — needed
   because author CSS always overrides the UA stylesheet's own
   `[hidden] { display: none }` at equal specificity, and without this
   override the "hidden" overlay was actually showing (and intercepting
   every click) on every page load, lightbox open or not. */
.lp-lightbox[hidden] {
	display: none;
}
.lp-lightbox-image {
	display: block;
	max-width: 100%;
	max-height: 100%;
	border-radius: calc(var(--lp-radius) - 2px);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.lp-lightbox-close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	width: 2.75rem;
	height: 2.75rem;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
}
.lp-lightbox-close:hover {
	background: rgba(255, 255, 255, 0.3);
}

/* Classic diagonal corner ribbon, pinned to the viewport (not the wizard
   box) so it reads as "this page", not just "this form". Purely a visual
   notice — never intercepts clicks on whatever's underneath it. */
.lp-maintenance-ribbon {
	position: fixed;
	top: 0;
	right: 0;
	width: 160px;
	height: 160px;
	overflow: hidden;
	z-index: 9998;
	pointer-events: none;
}
.lp-maintenance-ribbon span {
	position: absolute;
	top: 32px;
	right: -42px;
	width: 220px;
	transform: rotate(45deg);
	background: var(--lp-color-danger);
	color: #fff;
	text-align: center;
	font-weight: 700;
	font-size: 0.85rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	padding: 0.45rem 0;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
