:root {
	--green: #76b82a;
	--green-dark: #3d7a12;
	--green-light: #f1f8ea;
	--blue: #0071bc;
	--ink: #23292e;
	--muted: #5b6670;
	--line: #e3e7ea;
	--line-strong: #c9d0d5;
	--bg: #f4f6f2;
	--white: #ffffff;
	--radius: 16px;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: "Barlow", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.45;
}

img { max-width: 100%; }
a { color: #0062a3; }
a:hover { color: #004a7c; }
button { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.wrap { max-width: 1280px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* Kopf und Fuss */
.site-header { background: var(--white); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.site-header__logo img { display: block; height: 40px; width: auto; }
.site-header__title { font-weight: 700; font-style: italic; font-size: 20px; color: var(--green-dark); }
.site-header__bar { height: 6px; background: var(--green); border-bottom: 2px solid var(--blue); box-sizing: content-box; }

.site-footer { background: var(--ink); color: #d5dade; font-size: 14px; }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; padding-top: 18px; padding-bottom: 18px; }
.site-footer nav { display: flex; gap: 20px; }
.site-footer a { color: #d5dade; }

/* Seitenaufbau */
.page { padding-top: 32px; padding-bottom: 48px; }
.intro { margin-bottom: 28px; }
.intro h1 { margin: 0 0 6px; font-size: 34px; }
.intro p { margin: 0; color: var(--muted); font-size: 17px; }

.layout { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.config { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.result { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.card--flush { padding: 0; gap: 0; overflow: hidden; }

.step { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.step__nr { width: 28px; height: 28px; border-radius: 50%; background: var(--green-dark); color: var(--white); display: inline-flex; align-items: center; justify-content: center; font-size: 15px; flex: none; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field__label { font-size: 14px; font-weight: 600; color: var(--muted); }
.field__label strong { color: var(--ink); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

/* Zauntypen */
.types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.type { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 12px; border: 2px solid var(--line); background: var(--white); cursor: pointer; text-align: left; }
.type img { width: 100%; height: 64px; object-fit: contain; background: var(--white); border-radius: 8px; display: block; }
.type span { font-size: 13px; font-weight: 600; line-height: 1.25; }
.type[aria-pressed="true"] { border-color: var(--green-dark); background: var(--green-light); }
.type:hover { border-color: var(--line-strong); }
.type[aria-pressed="true"]:hover { border-color: var(--green-dark); }

/* Auswahl-Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--line-strong); background: var(--white); font-size: 15px; font-weight: 600; cursor: pointer; }
.pill[aria-pressed="true"] { border-color: var(--green-dark); background: var(--green-dark); color: var(--white); }
.swatch { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px 0 8px; border-radius: 999px; border: 2px solid var(--line-strong); background: var(--white); cursor: pointer; font-size: 14px; font-weight: 500; }
.swatch img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; display: block; }
.swatch[aria-pressed="true"] { border-color: var(--green-dark); background: var(--green-light); }

/* Zahlenfelder */
.stepper { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: var(--white); }
.stepper button { width: 44px; height: 44px; border: 0; background: var(--bg); font-size: 20px; cursor: pointer; flex: none; }
.stepper button:hover { background: #e8ece5; }
.stepper input { flex: 1; min-width: 0; height: 44px; border: 0; text-align: center; font: inherit; font-size: 17px; font-weight: 600; color: var(--ink); -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Pfostentypen */
.posts { display: flex; flex-direction: column; gap: 8px; }
.post { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: 12px; border: 2px solid var(--line); background: var(--white); cursor: pointer; text-align: left; }
.post img { width: 44px; height: 44px; object-fit: contain; flex: none; }
.post span { flex: 1; font-weight: 600; }
.post::after { content: ""; flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #9aa4ac; box-sizing: border-box; }
.post[aria-pressed="true"] { border-color: var(--green-dark); background: var(--green-light); }
.post[aria-pressed="true"]::after { border: 6px solid var(--green-dark); }

/* Vorschau */
.preview { position: relative; background: var(--bg); }
.preview img { width: 100%; aspect-ratio: 825 / 385; object-fit: cover; display: block; }
.preview__tags { position: absolute; left: 16px; top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.preview__tags span { background: var(--white); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.scenes { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; font-size: 14px; }
.scenes__list { display: flex; gap: 8px; flex-wrap: wrap; }
.scene { width: 64px; height: 44px; padding: 0; border-radius: 8px; overflow: hidden; border: 2px solid var(--line); background: var(--white); cursor: pointer; }
.scene img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scene[aria-pressed="true"] { border-color: var(--green-dark); }

/* Stueckliste */
.list-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.list-head h2 { margin: 0 0 2px; font-size: 22px; }
.items { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.item { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.item img { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; background: var(--bg); flex: none; }
.item__text { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item__text strong { font-weight: 600; }
.item__text span { font-size: 13px; color: var(--muted); }
.qty { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.qty button { width: 40px; height: 40px; border: 0; background: var(--bg); font-size: 18px; cursor: pointer; }
.qty output { min-width: 44px; text-align: center; font-weight: 700; }
.extras-title { margin: 8px 0 0; font-size: 16px; }
.list-foot { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.list-foot p { margin: 0; flex: 1 1 280px; }

.btn { display: inline-flex; align-items: center; gap: 10px; background: var(--green-dark); color: var(--white); text-decoration: none; font-weight: 700; font-size: 16px; padding: 14px 22px; border-radius: 12px; }
.btn:hover { background: #2f6109; color: var(--white); }
.btn--small { padding: 12px 18px; }

button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* Ladezustand */
#app.is-loading .result { opacity: .6; transition: opacity .2s; }
.loading { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: var(--green); animation: load 1s ease-in-out infinite; }
@keyframes load { 0% { transform: scaleX(0); transform-origin: left; } 50% { transform: scaleX(1); transform-origin: left; } 100% { transform: scaleX(0); transform-origin: right; } }

/* Mobile Leiste */
.mobile-bar { display: none; }

/* Textseiten */
.text-page { max-width: 820px; }
.text-page .card { gap: 8px; }

@media (max-width: 760px) {
	.wrap { padding-left: 16px; padding-right: 16px; }
	.page { padding-top: 20px; padding-bottom: 100px; }
	.intro h1 { font-size: 26px; }
	.types { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 112px; overflow-x: auto; padding-bottom: 4px; }
	.site-header__logo img { height: 30px; }
	.site-header__title { font-size: 16px; }
	.card { padding: 14px; }
	.mobile-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--white); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0, 0, 0, .08); font-size: 13px; color: var(--muted); line-height: 1.3; }
	.mobile-bar strong { color: var(--ink); font-size: 15px; }
	.list-foot .btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
	.loading { animation: none; }
}
