/* ==========================================================================
   Milonor - formularze zapytań (wtyczka milonor-core)
   Ładowane tylko na stronach z formularzem (inc/assets.php).
   ========================================================================== */

/* Zapytanie firmowe: formularz + kolumna z krokami i kontaktem */
.quote {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
	gap: clamp(2rem, 1rem + 3vw, 4rem);
	align-items: start;
}

/* Wycena: kolumna z ceną jest częścią formularza (.mln-side) */
.quote--single {
	display: block;
}

.quote__aside {
	position: sticky;
	top: calc(var(--header-h) + 1.5rem);
	display: grid;
	gap: 0.85rem;
}

.quote-card {
	padding: 1.3rem;
	border-radius: var(--r-l);
	border: 1px solid var(--line);
	background: var(--surface-soft);
}

.quote-card .eyebrow {
	margin-bottom: 0.9rem;
}

/* Formularz stoi w treści strony - bez wcięć i odstępów list z .entry-content */
.mln-form :is(ul, ol),
.quote-card :is(ul, ol) {
	padding-left: 0;
	list-style: none;
}

.mln-form li + li,
.quote-card li + li {
	margin-top: 0;
}

.quote-steps {
	display: grid;
	gap: 0.6rem;
}

.quote-steps li {
	display: flex;
	align-items: baseline;
	gap: 0.65rem;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--ink);
}

.quote-steps li::before {
	content: "";
	flex: none;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--blue);
	translate: 0 -0.15em;
}

/* Warunki dla firm: lista z „ptaszkami” */
.quote-perks {
	display: grid;
	gap: 0.55rem;
}

.quote-perks li {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--ink);
}

.quote-perks .icon {
	flex: none;
	width: 16px;
	height: 16px;
	stroke-width: 2.2;
	color: var(--blue);
}

.quote-card__text {
	margin-top: 0.9rem;
	padding-top: 0.9rem;
	border-top: 1px solid var(--line);
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--text-soft);
}

.quote-card--dark {
	display: grid;
	gap: 0.55rem;
	padding: 1.15rem 1.3rem;
	border-color: var(--navy-900);
	background: var(--navy-900);
	color: var(--on-dark-soft);
}

.quote-card__title {
	font-size: 1rem;
	font-weight: 700;
	color: #fff;
}

.quote-card--dark a {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	font-size: 0.9375rem;
	color: #fff;
	text-decoration: none;
}

.quote-card--dark a:hover {
	color: var(--blue-on-dark);
}

.quote-card--dark .icon {
	width: 16px;
	height: 16px;
	color: var(--blue-on-dark);
}

/* ── Formularz ───────────────────────────────────────────────────── */
.mln-form {
	--mln-control: 2.5rem; /* wysokość pól i przycisków wyboru - żeby rzędy się wyrównywały */
	display: grid;
	gap: 2rem;
}

.mln-form[hidden] {
	display: none;
}

/* Wycena: [model i materiał | cena] nad [szczegóły i kontakt]; cena jedzie przy przewijaniu */
.mln-form--quote {
	grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
	grid-template-rows: auto 1fr;
	column-gap: clamp(2rem, 1rem + 3vw, 4rem);
	align-items: start;
}

.mln-form__part {
	display: grid;
	grid-column: 1;
	gap: 2rem;
	min-width: 0;
}

.mln-side {
	position: sticky;
	top: calc(var(--header-h) + 1.5rem);
	grid-column: 2;
	grid-row: 1 / span 2;
	display: grid;
	gap: 0.85rem;
}

/* Przełącznik trybu wyceny: „Mam model 3D” / „Nie mam modelu” */
.mln-mode {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.3rem;
	min-width: 0;
	margin: 0 0 -0.5rem;
	padding: 0.3rem;
	border: 1px solid var(--line);
	border-radius: 16px;
	background: var(--surface-soft);
}

.mln-mode__option {
	position: relative;
	display: block;
	cursor: pointer;
}

.mln-mode__option input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.mln-mode__card {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	height: 100%;
	padding: 0.65rem 0.8rem;
	border-radius: 12px;
	transition: background-color 0.2s, box-shadow 0.2s;
}

.mln-mode__option:hover .mln-mode__card {
	background: rgb(255 255 255 / 0.65);
}

.mln-mode__option input:checked + .mln-mode__card {
	background: #fff;
	box-shadow: 0 1px 2px rgb(15 23 36 / 0.06), 0 6px 16px -10px rgb(15 23 36 / 0.3);
}

.mln-mode__option input:focus-visible + .mln-mode__card {
	outline: 2px solid var(--blue);
	outline-offset: 2px;
}

.mln-mode__icon {
	flex: none;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: var(--surface-muted);
	color: var(--text-soft);
	transition: background-color 0.2s, color 0.2s;
}

.mln-mode__icon .icon {
	width: 18px;
	height: 18px;
}

.mln-mode__option input:checked + .mln-mode__card .mln-mode__icon {
	background: var(--blue);
	color: #fff;
}

.mln-mode__text {
	display: grid;
	gap: 0.05rem;
	min-width: 0;
}

.mln-mode__title {
	font-size: 0.9375rem;
	font-weight: 700;
	color: var(--text);
}

.mln-mode__option input:checked + .mln-mode__card .mln-mode__title {
	color: var(--ink);
}

.mln-mode__desc {
	font-size: 0.8125rem;
	line-height: 1.4;
	color: var(--text-soft);
}

/* Widać tylko pola wybranego trybu - przełącza CSS, więc działa też bez JavaScriptu */
.mln-step > :is(.mln-for-model, .mln-for-idea) {
	display: grid;
	gap: 1rem;
	min-width: 0;
}

/* Uwagi przy modelu są opcjonalne - niższe pole */
.mln-for-model textarea {
	min-height: 84px;
}

.mln-form--quote:has(input[name="mln_mode"][value="opis"]:checked) .mln-for-model,
.mln-form--quote:has(input[name="mln_mode"][value="model"]:checked) .mln-for-idea {
	display: none;
}

.mln-form.is-busy .mln-step,
.mln-form.is-busy .mln-field--consent {
	opacity: 0.55;
	pointer-events: none;
}

.mln-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.mln-alert {
	padding: 0.85rem 1rem;
	border-radius: var(--r-m);
	border: 1px solid #F3C9C9;
	background: #FDEEEE;
	color: #8E2424;
	font-size: 0.9375rem;
	font-weight: 600;
}

.mln-alert[hidden] {
	display: none;
}

.mln-alert--info {
	margin-bottom: 1.5rem;
	border-color: #CFE0FF;
	background: var(--blue-soft);
	color: var(--navy-800);
}

.mln-step {
	display: grid;
	gap: 1rem;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.mln-step__title {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	width: 100%;
	margin-bottom: 0.1rem;
	padding: 0 0 0.65rem;
	border-bottom: 1px solid var(--line);
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: -0.015em;
	color: var(--ink);
}

.mln-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.9rem 1rem;
}

.mln-grid[hidden] {
	display: none;
}

/* Trzy pola w rzędzie, a w wąskiej kolumnie dwa */
.mln-grid--3 {
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
}

.mln-field {
	display: grid;
	align-content: start;
	gap: 0.4rem;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.mln-field > label,
.mln-label {
	padding: 0;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--ink);
}

.mln-choice > .mln-label {
	margin-bottom: 0.4rem;
}

.mln-opt {
	margin-left: 0.35rem;
	font-size: 0.75rem;
	font-weight: 400;
	color: var(--text-soft);
}

.mln-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.mln-field textarea {
	width: 100%;
	min-height: var(--mln-control);
	padding: 0.45rem 0.8rem;
	border: 1px solid var(--line-strong);
	border-radius: 9px;
	background: #fff;
	color: var(--ink);
	font-size: 0.9375rem;
	line-height: 1.5;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.mln-field input:focus,
.mln-field textarea:focus {
	outline: none;
	border-color: var(--blue);
	box-shadow: 0 0 0 3px rgb(7 104 253 / 0.12);
}

/* Lista rozwijana jak pole tekstowe, ze strzałką */
.mln-field select {
	width: 100%;
	min-height: var(--mln-control);
	padding: 0.45rem 2.2rem 0.45rem 0.8rem;
	border: 1px solid var(--line-strong);
	border-radius: 9px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23677184' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.75rem center / 15px;
	color: var(--ink);
	font: inherit;
	font-size: 0.9375rem;
	line-height: 1.5;
	cursor: pointer;
	appearance: none;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.mln-field select:hover {
	border-color: var(--ink);
}

.mln-field select:focus {
	outline: none;
	border-color: var(--blue);
	box-shadow: 0 0 0 3px rgb(7 104 253 / 0.12);
}

.mln-field textarea {
	min-height: 104px;
	padding-block: 0.6rem;
	resize: vertical;
}

.mln-field ::placeholder {
	color: #9AA3B2;
}

.has-error input:not([type="checkbox"]):not([type="radio"]),
.has-error textarea {
	border-color: var(--danger);
}

.mln-error {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--danger);
}

.mln-hint {
	font-size: 0.75rem;
	color: var(--text-soft);
}

.mln-hint[hidden] {
	display: none;
}

/* Wybór „pigułkami” */
.mln-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.mln-chip {
	position: relative;
}

.mln-chip input {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
}

.mln-chip span {
	display: inline-flex;
	align-items: center;
	min-height: var(--mln-control);
	padding: 0 0.85rem;
	border-radius: 9px;
	border: 1px solid var(--line-strong);
	background: #fff;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--ink);
	cursor: pointer;
	transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.mln-chip:hover span {
	border-color: var(--ink);
}

.mln-chip input:checked + span {
	border-color: var(--navy-800);
	background: var(--navy-800);
	color: #fff;
}

.mln-chip input:focus-visible + span {
	outline: 2px solid var(--blue);
	outline-offset: 2px;
}

/* Pole wyboru */
.mln-check {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	font-size: 0.875rem;
	color: var(--text);
	cursor: pointer;
}

.mln-check input {
	appearance: none;
	flex: none;
	display: grid;
	place-items: center;
	width: 18px;
	height: 18px;
	margin: 0.1rem 0 0;
	border: 1.5px solid var(--line-strong);
	border-radius: 5px;
	background: #fff;
	cursor: pointer;
	transition: background-color 0.2s, border-color 0.2s;
}

.mln-check input::after {
	content: "";
	width: 9px;
	height: 5px;
	margin-top: -2px;
	border: 2px solid #fff;
	border-top: 0;
	border-right: 0;
	transform: rotate(-45deg) scale(0);
	transition: transform 0.2s var(--ease);
}

.mln-check input:checked {
	border-color: var(--blue);
	background: var(--blue);
}

.mln-check input:checked::after {
	transform: rotate(-45deg) scale(1);
}

.mln-check input:focus-visible {
	outline: 2px solid var(--blue);
	outline-offset: 2px;
}

.has-error .mln-check input {
	border-color: var(--danger);
}

.mln-check a {
	color: var(--blue);
}

.mln-field--consent .mln-check {
	font-size: 0.8125rem;
	line-height: 1.55;
	color: var(--text-soft);
}

/* Strefa plików */
.mln-drop {
	position: relative;
	border: 1.5px dashed var(--line-strong);
	border-radius: 14px;
	background: var(--surface-soft);
	transition: border-color 0.2s, background-color 0.2s;
}

.mln-drop:hover,
.mln-drop:focus-within,
.mln-drop.is-dragover {
	border-color: var(--blue);
	background: var(--blue-soft);
}

.mln-drop input[type="file"] {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.mln-drop__label {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	padding: 0.75rem 0.85rem;
	pointer-events: none;
}

.mln-drop__icon {
	flex: none;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 11px;
	border: 1px solid var(--line);
	background: #fff;
	color: var(--blue);
	transition: transform 0.5s var(--ease);
}

.mln-drop__icon .icon {
	width: 19px;
	height: 19px;
}

.mln-drop.is-dragover .mln-drop__icon {
	transform: translateY(-3px);
}

.mln-drop__text {
	display: grid;
	flex: 1;
	gap: 0.1rem;
	min-width: 0;
}

.mln-drop__title {
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--ink);
}

.mln-drop__meta {
	font-size: 0.8125rem;
	line-height: 1.45;
	color: var(--text-soft);
}

/* Wygląda jak przycisk - całe pole i tak otwiera wybór plików */
.mln-drop__button {
	flex: none;
	display: inline-flex;
	align-items: center;
	min-height: 2.25rem;
	padding: 0 0.85rem;
	border-radius: 9px;
	border: 1px solid var(--line-strong);
	background: #fff;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--ink);
	transition: border-color 0.2s, color 0.2s;
}

.mln-drop:hover .mln-drop__button,
.mln-drop:focus-within .mln-drop__button,
.mln-drop.is-dragover .mln-drop__button {
	border-color: var(--blue);
	color: var(--blue);
}

.mln-drop__tap {
	display: none;
}

/* Pole plików zaraz pod tytułem kroku (zapytanie firmowe) - z odstępem od linii */
.mln-step__title + .mln-field > .mln-drop {
	margin-top: 0.4rem;
}

/* Link do dużych plików - zwinięty */
.mln-link {
	margin-top: -0.4rem;
}

.mln-link summary {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	font-size: 0.8125rem;
	color: var(--text-soft);
	cursor: pointer;
	list-style: none;
}

.mln-link summary::-webkit-details-marker {
	display: none;
}

.mln-link summary::after {
	content: "";
	width: 6px;
	height: 6px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	rotate: 45deg;
	translate: 0 -2px;
	transition: rotate 0.2s, translate 0.2s;
}

.mln-link summary:hover {
	color: var(--blue);
}

.mln-link[open] summary {
	margin-bottom: 0.7rem;
}

.mln-link[open] summary::after {
	rotate: 225deg;
	translate: 0 1px;
}

.mln-files {
	display: grid;
	gap: 0.4rem;
}

.mln-files:empty {
	display: none;
}

.mln-file {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.5rem 0.6rem;
	border-radius: 12px;
	border: 1px solid var(--line);
	background: #fff;
}

.mln-file__ext {
	flex: none;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 9px;
	background: var(--navy-800);
	color: #fff;
	font-size: 0.6rem;
	overflow: hidden;
}

/* Załączniki i modele do wyceny ręcznej - jaśniej; zdjęcia jako miniatury */
.mln-file.is-muted .mln-file__ext {
	background: var(--surface-muted);
	color: var(--text);
}

.mln-file__ext img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mln-file__body {
	display: grid;
	flex: 1;
	min-width: 0;
}

.mln-file__name {
	overflow: hidden;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--ink);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mln-file__meta {
	font-size: 0.66rem;
	letter-spacing: 0.02em;
	text-transform: none;
	color: var(--text-soft);
}

.mln-file__remove {
	flex: none;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	font-size: 1.25rem;
	line-height: 1;
	color: var(--text-soft);
}

.mln-file__remove:hover {
	background: var(--surface-muted);
	color: var(--danger);
}

/* ── Ustawienia wydruku i cena (kolumna po prawej) ───────────────── */
.mln-config {
	display: grid;
	gap: 1rem;
	padding: 1.25rem;
	border-radius: var(--r-l);
	border: 1px solid var(--line);
	background: #fff;
	box-shadow: 0 1px 2px rgb(15 23 36 / 0.04), 0 10px 28px -14px rgb(15 23 36 / 0.16);
}

.mln-config .eyebrow {
	margin: 0;
}

.mln-config > :is(.mln-for-model, .mln-for-idea) {
	display: grid;
	gap: 1rem;
}

/* W wąskiej kolumnie mniejsze etykiety i przyciski wyboru */
.mln-config :is(.mln-label, .mln-field > label) {
	font-size: 0.8125rem;
}

.mln-config .mln-choice > .mln-label {
	margin-bottom: 0.35rem;
}

.mln-config .mln-chips {
	gap: 0.25rem;
}

.mln-config .mln-chip span {
	min-height: 2.125rem;
	padding: 0 0.45rem;
	border-radius: 8px;
	font-size: 0.8125rem;
}

/* Kolor: próbki z palety, „Dowolny” i „Inny” */
.mln-swatches__name {
	margin-left: 0.3rem;
	font-weight: 400;
	color: var(--text-soft);
}

.mln-swatches__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
}

.mln-swatch {
	position: relative;
	cursor: pointer;
}

.mln-swatch input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.mln-swatch > span {
	position: relative;
	display: block;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--swatch, #fff);
	box-shadow: inset 0 0 0 1px rgb(15 23 36 / 0.14);
	transition: box-shadow 0.15s;
}

.mln-swatch--any > span {
	background: conic-gradient(#D23B3B, #F2C232, #2E9A58, #0768FD, #8A3FD1, #D23B3B);
}

.mln-swatch--other > span {
	box-shadow: inset 0 0 0 1.5px var(--line-strong);
}

.mln-swatch--other > span::before,
.mln-swatch--other > span::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 10px;
	height: 1.5px;
	background: var(--text-soft);
	translate: -50% -50%;
}

.mln-swatch--other > span::after {
	rotate: 90deg;
}

.mln-swatch input:checked + span {
	box-shadow: inset 0 0 0 1px rgb(15 23 36 / 0.14), 0 0 0 2px #fff, 0 0 0 3.5px var(--navy-800);
}

.mln-swatch input:focus-visible + span {
	outline: 2px solid var(--blue);
	outline-offset: 4px;
}

/* Pole na nazwę innego koloru - CSS, więc działa też bez JavaScriptu */
.mln-color-other {
	display: none;
	margin-top: 0.5rem;
}

.mln-swatches:has(input[value="inny"]:checked) .mln-color-other {
	display: block;
}

/* Liczba sztuk: etykieta z lewej, licznik z prawej */
.mln-config [data-field="quantity"] {
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
}

.mln-config [data-field="quantity"] :is(.mln-hint, .mln-error) {
	grid-column: 1 / -1;
}

.mln-stepper {
	display: inline-flex;
	justify-self: start;
	overflow: hidden;
	border: 1px solid var(--line-strong);
	border-radius: 9px;
	background: #fff;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.mln-stepper:focus-within {
	border-color: var(--blue);
	box-shadow: 0 0 0 3px rgb(7 104 253 / 0.12);
}

.mln-field .mln-stepper input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
	width: 3.5rem;
	min-height: 2.25rem;
	padding: 0.3rem;
	border: 0;
	border-radius: 0;
	text-align: center;
	box-shadow: none;
	appearance: textfield;
}

.mln-stepper input::-webkit-outer-spin-button,
.mln-stepper input::-webkit-inner-spin-button {
	margin: 0;
	appearance: none;
}

.mln-stepper__button {
	display: grid;
	place-items: center;
	width: 2.25rem;
	background: var(--surface-soft);
	color: var(--ink);
	transition: background-color 0.15s, color 0.15s;
}

.mln-stepper__button:hover {
	background: var(--surface-muted);
	color: var(--blue);
}

.mln-stepper__button .icon {
	width: 15px;
	height: 15px;
}

/* Cena pod ustawieniami */
.mln-estimate {
	display: grid;
	gap: 0.6rem;
	padding-top: 1rem;
	border-top: 1px solid var(--line);
}

.mln-estimate__label {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--text-soft);
}

.mln-estimate__price {
	margin-top: 0.15rem;
	font-size: clamp(1.75rem, 1.5rem + 0.9vw, 2.1rem);
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -0.035em;
	color: var(--ink);
	font-variant-numeric: tabular-nums;
}

.mln-estimate__vat {
	margin-top: 0.2rem;
	font-size: 0.75rem;
	color: var(--text-soft);
}

.mln-estimate__summary {
	margin-top: 0.5rem;
	font-size: 0.8125rem;
	color: var(--text);
}

.mln-estimate__summary:empty {
	display: none;
}

.mln-estimate__status {
	align-items: center;
	gap: 0.6rem;
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--text);
}

.mln-estimate__notes {
	gap: 0.45rem;
}

.mln-estimate__notes li {
	position: relative;
	padding-left: 0.9rem;
	font-size: 0.75rem;
	line-height: 1.45;
	color: var(--text);
}

.mln-estimate__notes li::before {
	content: "";
	position: absolute;
	top: 0.5em;
	left: 0;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: #E0A100;
}

.mln-estimate__foot {
	font-size: 0.72rem;
	line-height: 1.45;
	color: var(--text-soft);
}

/* Stany ceny: (loading) → result; manual i error, gdy ceny nie da się policzyć */
.mln-estimate__result,
.mln-estimate__status,
.mln-estimate__notes,
.mln-estimate__foot {
	display: none;
}

.mln-estimate[data-state="empty"] {
	display: none;
}

.mln-estimate[data-state="result"] :is(.mln-estimate__result, .mln-estimate__foot),
.mln-estimate.has-result[data-state="loading"] :is(.mln-estimate__result, .mln-estimate__foot) {
	display: block;
}

.mln-estimate[data-state="result"] .mln-estimate__notes:not(:empty) {
	display: grid;
}

.mln-estimate:not(.has-result)[data-state="loading"] .mln-estimate__status,
.mln-estimate[data-state="manual"] .mln-estimate__status,
.mln-estimate[data-state="error"] .mln-estimate__status {
	display: flex;
}

.mln-estimate.has-result[data-state="loading"] .mln-estimate__result {
	opacity: 0.4;
	transition: opacity 0.2s;
}

.mln-estimate[data-state="loading"] .mln-estimate__status::before {
	content: "";
	flex: none;
	width: 14px;
	height: 14px;
	border: 2px solid var(--line-strong);
	border-top-color: var(--blue);
	border-radius: 50%;
	animation: mln-spin 0.8s linear infinite;
}

@keyframes mln-spin {
	to {
		rotate: 360deg;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mln-estimate[data-state="loading"] .mln-estimate__status::before {
		animation: none;
	}
}

/* Bez modelu: zamiast ceny - jak przygotujemy wycenę */
.mln-config__idea {
	padding-top: 1rem;
	border-top: 1px solid var(--line);
}

.mln-config__idea .quote-steps li,
.mln-intro .quote-steps li {
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--text);
}

/* Przed wgraniem modelu: zapowiedź i kontakt */
.mln-intro {
	display: grid;
	gap: 0.85rem;
}

.mln-intro .quote-card:not(.quote-card--dark) {
	background: #fff;
}

.mln-intro__lead {
	margin-bottom: 0.9rem;
	padding-bottom: 0.9rem;
	border-bottom: 1px solid var(--line);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.45;
	color: var(--ink);
}

/* Kolumna: przed wgraniem modelu zapowiedź, potem ustawienia; bez JavaScriptu od razu ustawienia */
html.js .mln-form--quote:not(.has-model):has(input[name="mln_mode"][value="model"]:checked) .mln-config,
.mln-form--quote.has-model .mln-intro,
html:not(.js) :is(.mln-intro, .mln-estimate) {
	display: none;
}

/* ── Podgląd 3D modelu ───────────────────────────────────────────── */
.mln-viewer {
	position: relative;
	height: clamp(16rem, 36vw, 27rem);
	overflow: hidden;
	border-radius: var(--r-m);
	border: 1px solid var(--line);
	background: radial-gradient(120% 90% at 50% 0%, #FFFFFF 0%, #F3F5F8 55%, #E8ECF1 100%);
}

.mln-viewer[hidden],
.mln-viewer [hidden] {
	display: none;
}

.mln-viewer__canvas {
	display: block;
	width: 100%;
	height: 100%;
	cursor: grab;
	touch-action: pan-y;
}

.mln-viewer__canvas:active {
	cursor: grabbing;
}

.mln-viewer__message {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 1.5rem;
	font-size: 0.875rem;
	text-align: center;
	color: var(--text-soft);
}

.mln-viewer__info {
	position: absolute;
	left: 0.7rem;
	bottom: 0.7rem;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.1rem 0.6rem;
	max-width: calc(100% - 1.4rem);
	padding: 0.35rem 0.6rem;
	border-radius: 8px;
	background: rgb(255 255 255 / 0.88);
	font-size: 0.8125rem;
	pointer-events: none;
}

.mln-viewer__name {
	overflow: hidden;
	max-width: 24ch;
	font-weight: 600;
	color: var(--ink);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mln-viewer__dims {
	font-size: 0.7rem;
	text-transform: none;
	color: var(--text-soft);
}

.mln-viewer__reset {
	position: absolute;
	top: 0.6rem;
	right: 0.6rem;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 9px;
	border: 1px solid var(--line);
	background: rgb(255 255 255 / 0.9);
	color: var(--text);
	transition: border-color 0.15s, color 0.15s;
}

.mln-viewer__reset:hover {
	border-color: var(--blue);
	color: var(--blue);
}

.mln-viewer__reset .icon {
	width: 16px;
	height: 16px;
}

.mln-viewer__help {
	position: absolute;
	top: 0.85rem;
	left: 0.85rem;
	max-width: calc(100% - 4rem);
	font-size: 0.72rem;
	color: var(--text-soft);
	pointer-events: none;
}

/* Po wgraniu modelu: podgląd, lista modeli (klik = podgląd), na dole pole na kolejny */
.has-model [data-field="files"] .mln-viewer {
	order: 1;
}

.has-model [data-field="files"] .mln-files {
	order: 2;
}

.has-model [data-field="files"] .mln-drop {
	order: 3;
}

.has-model [data-field="files"] .mln-error {
	order: 4;
}

.mln-file.is-selected {
	border-color: var(--blue);
	box-shadow: inset 0 0 0 1px var(--blue);
}

button.mln-file__name {
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	text-align: left;
	color: var(--ink);
	cursor: pointer;
}

button.mln-file__name:hover {
	color: var(--blue);
}

/* Wysyłka */
.mln-submit {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1.25rem;
}

.mln-submit .btn[disabled] {
	opacity: 0.6;
	cursor: progress;
}

/* „Napisz do nas” (Kontakt): krótki formularz w karcie - mniejsze odstępy, przycisk na całą szerokość */
.mln-form--contact {
	gap: 1rem;
}

.mln-form--contact .mln-submit .btn {
	width: 100%;
	justify-content: center;
}

/* Zwroty i reklamacje (strona „Zwroty i reklamacje”): rodzaj zgłoszenia przełącza pola - jak tryb wyceny,
   więc działa też bez JavaScriptu; przed wyborem widać tylko wspólne pola */
.mln-form--returns {
	gap: 1.75rem;
}

.mln-form--returns .mln-mode {
	margin: 0;
}

.mln-form--returns .mln-step > .mln-for-zwrot {
	display: grid;
	gap: 1rem;
}

.mln-form--returns .mln-for-zwrot textarea {
	min-height: 64px;
}

.mln-form--returns:not(:has(input[name="mln_kind"]:checked)) :is(.mln-for-zwrot, .mln-for-reklamacja),
.mln-form--returns:has(input[name="mln_kind"][value="zwrot"]:checked) .mln-for-reklamacja,
.mln-form--returns:has(input[name="mln_kind"][value="reklamacja"]:checked) .mln-for-zwrot {
	display: none;
}

/* Numer zamówienia wąsko, produkty szeroko */
.returns-order-fields {
	grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
}

/* Zamówienie z konta klienta: numer i data, pod spodem produkty do zaznaczenia */
.returns-order {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.25rem 1rem;
	padding: 0.7rem 0.9rem;
	border-radius: 12px;
	background: var(--surface-soft);
	font-size: 0.9375rem;
}

.returns-order__title {
	margin: 0;
	color: var(--text-soft);
}

.returns-order__title strong {
	margin-right: 0.3rem;
	color: var(--ink);
}

.returns-order__change {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--blue);
}

.returns-items {
	display: grid;
	gap: 0.4rem;
}

.mln-check.returns-item {
	padding: 0.65rem 0.8rem;
	border: 1px solid var(--line-strong);
	border-radius: 9px;
	background: #fff;
	transition: border-color 0.2s;
}

.mln-check.returns-item:hover {
	border-color: var(--ink);
}

.mln-check.returns-item:has(input:checked) {
	border-color: var(--blue);
}

.has-error .mln-check.returns-item {
	border-color: var(--danger);
}

.returns-item > span {
	display: grid;
	gap: 0.15rem;
}

.returns-item__name {
	font-weight: 600;
	color: var(--ink);
}

/* Wydruk na zamówienie: uwaga tylko przy zwrocie (reklamować go można) */
.returns-item__note {
	display: none;
	font-size: 0.8125rem;
	color: var(--danger);
}

.mln-form--returns:has(input[name="mln_kind"][value="zwrot"]:checked) .returns-item__note {
	display: block;
}

.mln-form--returns .mln-note {
	flex: 1 1 18rem;
}

.mln-success.mln-success--compact {
	gap: 0.6rem;
	padding: 0.5rem 0 0;
	border: 0;
	background: none;
}

.mln-success.mln-success--compact .mln-success__title {
	font-size: var(--fs-h4);
}

.mln-note {
	font-size: 0.8125rem;
	color: var(--text-soft);
}

.mln-progress {
	display: grid;
	gap: 0.5rem;
}

.mln-progress[hidden] {
	display: none;
}

.mln-progress__track {
	display: block;
	height: 6px;
	border-radius: 6px;
	background: var(--surface-muted);
	overflow: hidden;
}

.mln-progress__bar {
	display: block;
	width: 0;
	height: 100%;
	background: linear-gradient(90deg, var(--blue-deep), var(--blue));
	transition: width 0.25s;
}

.mln-progress .mono {
	font-size: 0.68rem;
	color: var(--text-soft);
}

/* Po wysłaniu */
.mln-success {
	display: grid;
	justify-items: start;
	gap: 0.9rem;
	max-width: 52rem;
	padding: clamp(1.75rem, 1.25rem + 2vw, 2.75rem);
	border-radius: var(--r-xl);
	border: 1px solid var(--line);
	background: var(--surface-soft);
	outline: none;
}

.mln-success__icon {
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	border-radius: 15px;
	background: var(--blue);
	color: #fff;
}

.mln-success__icon .icon {
	width: 26px;
	height: 26px;
}

.mln-success .mln-success__title {
	margin: 0;
	font-size: clamp(1.45rem, 1.2rem + 1vw, 1.95rem);
	letter-spacing: -0.03em;
}

.mln-success__text {
	max-width: 40rem;
	color: var(--text-soft);
}

.mln-success__estimate {
	padding: 0.7rem 0.95rem;
	border-radius: 12px;
	border: 1px solid var(--line);
	background: #fff;
	font-size: 0.9375rem;
	color: var(--text);
}

.mln-success__estimate strong {
	color: var(--ink);
}

.mln-success__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 0.4rem;
}

/* Niski ekran: kolumna z ustawieniami zostaje na miejscu - przyklejona nie zmieściłaby się */
@media (max-height: 760px) {
	.mln-side,
	.quote__aside {
		position: static;
	}
}

@media (max-width: 1000px) {
	.quote,
	.mln-form--quote {
		grid-template-columns: minmax(0, 1fr);
	}

	.mln-form--quote {
		grid-template-rows: none;
	}

	.quote__aside,
	.mln-side {
		position: static;
	}

	/* Na telefonie ustawienia i cena stoją zaraz pod modelem; kontakt jest w stopce */
	.mln-side {
		grid-column: auto;
		grid-row: auto;
	}

	.mln-side .quote-card--dark {
		display: none;
	}
}

@media (max-width: 640px) {
	.mln-grid,
	.mln-grid--3 {
		grid-template-columns: 1fr;
	}

	.mln-viewer__help {
		display: none;
	}

	/* Przełącznik na telefonie: same nazwy trybów, każda w jednej linii */
	.mln-mode__desc,
	.mln-mode__icon {
		display: none;
	}

	.mln-mode__card {
		justify-content: center;
		padding: 0.7rem 0.5rem;
		text-align: center;
	}

	.mln-mode__title {
		font-size: 0.875rem;
	}

	/* Na telefonie „Dodaj …” zamiast przeciągania, bez przycisku - całe pole otwiera wybór plików */
	.mln-drop__drag,
	.mln-drop__button {
		display: none;
	}

	.mln-drop__tap {
		display: inline;
	}

	.returns-order-fields {
		grid-template-columns: 1fr;
	}

	/* Liczba sztuk i kolor są krótkie - zostają obok siebie */
	.mln-grid--pair {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	/* 16 px w polach - inaczej iPhone powiększa stronę przy wpisywaniu */
	.mln-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
	.mln-field select,
	.mln-field textarea {
		font-size: 1rem;
	}

	.mln-drop__label {
		justify-content: flex-start;
	}
}
