/* ==========================================================================
   iPMarket24 – kalkulator wyceny
   Układ „jeden ekran”: kalkulator wypełnia wysokość okna (100dvh − nagłówek strony),
   a kroki są zaprojektowane tak, by mieściły się bez przewijania. Gdy ekran jest
   wyjątkowo mały, kontener rośnie (min-height) zamiast ucinać treść.
   Kolory wyłącznie z tokenów style.css – motyw jasny i ciemny bez dodatkowych reguł.
   ========================================================================== */

.page-valuation .topbar {
    display: none;
}

.valuator-page {
    --vgap: clamp(0.5rem, 0.3rem + 0.6vh, 0.875rem);
    position: relative;
    /* clip przycina poświatę jak hidden, ale nie tworzy kontenera przewijania – pasek „Wstecz/Dalej” może się przyklejać (sticky) */
    overflow: hidden;
    overflow: clip;
    padding-block: var(--vgap) var(--space-12);
}

.valuator-page__glow {
    position: absolute;
    top: -300px;
    left: 50%;
    z-index: -1;
    width: min(1000px, 120vw);
    aspect-ratio: 2 / 1;
    border-radius: 50%;
    background: radial-gradient(closest-side, var(--glow-1), transparent);
    transform: translateX(-50%);
    filter: blur(30px);
    opacity: 0.7;
    pointer-events: none;
}

/* Tło zablokowane, gdy otwarte jest okno; rezerwujemy miejsce paska przewijania, aby strona nie przeskakiwała. */
html.has-dialog {
    overflow: hidden;
}

html.has-dialog.has-scrollbar {
    scrollbar-gutter: stable;
}

.vicon {
    display: inline-flex;
}

.vicon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
}

/* ---------- Kontener ---------- */
.valuator {
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    min-height: calc(100vh - var(--header-height) - 2 * var(--vgap));
    min-height: calc(100dvh - var(--header-height) - 2 * var(--vgap));
    margin-inline: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.valuator--empty {
    min-height: 0;
    max-width: 640px;
    align-items: center;
    margin-top: var(--space-10);
    padding: var(--space-12) var(--space-8);
    text-align: center;
}

.valuator--empty h1 {
    margin-top: var(--space-4);
    font-size: var(--text-xl);
}

.valuator--empty p {
    margin: var(--space-3) 0 var(--space-6);
    color: var(--color-muted);
}

.valuator-empty__icon {
    display: inline-flex;
    width: 56px;
    height: 56px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-primary-soft);
    color: var(--color-primary-text);
}

/* ---------- Nagłówek z postępem (stałe miejsce) ---------- */
.valuator__head {
    padding: 0.85rem 1.5rem 0.8rem;
    border-bottom: 1px solid var(--color-border);
}

.valuator__head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: 0.6rem;
}

.valuator__title {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-base);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.valuator__title-icon {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--color-primary-soft);
    color: var(--color-primary-text);
}

.valuator__title-icon .icon {
    width: 16px;
    height: 16px;
}

.valuator__meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
}

.valuator__counter {
    padding: 0.1rem 0.6rem;
    border-radius: var(--radius-pill);
    background: var(--color-primary-soft);
    color: var(--color-primary-text);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.valuator__step-name {
    color: var(--color-muted);
    font-weight: 500;
}

.valuator__track {
    position: relative;
    height: 5px;
    overflow: hidden;
    border-radius: 5px;
    background: var(--color-surface-2);
}

.valuator__bar {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-2));
    transform: scaleX(0.03);
    transform-origin: left center;
    transition: transform 600ms var(--ease-out);
}

/* ---------- Układ: treść + panel boczny ---------- */
.valuator__layout {
    display: grid;
    flex: 1;
    grid-template-columns: minmax(0, 1fr) 240px;
    min-height: 0;
}

/* Krok 1 (przed wyborem modelu) – bez panelu bocznego, pełna szerokość */
.valuator__layout:has(> .valuator__aside[hidden]) {
    grid-template-columns: minmax(0, 1fr);
}

.valuator__main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 1.1rem 1.5rem 1rem;
}

.valuator__stage {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

.valuator__noscript {
    color: var(--color-muted);
}

/* Nawigacja zawsze na dole kontenera */
.valuator__nav {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}

.valuator__nav .btn {
    min-height: 48px;
    padding-inline: 1.5rem;
}

.valuator__nav [data-next] {
    margin-left: auto;
}

/* Podpowiedź zamiast „Dalej” – etapy przechodzą dalej automatycznie po udzieleniu odpowiedzi */
.valuator__hint {
    flex: 1 1 auto;
    align-self: center;
    margin: 0;
    color: var(--color-muted);
    font-size: var(--text-sm);
    line-height: 1.45;
    text-align: right;
}

.valuator__hint:empty {
    display: none;
}

.valuator__hint.is-pending {
    color: var(--color-primary-text);
    font-weight: 600;
}

/* „Dalej” wygląda na nieaktywny, ale po kliknięciu pokazuje brakujące odpowiedzi */
.btn.is-inactive {
    opacity: 0.45;
    box-shadow: none;
}

.btn.is-inactive:hover {
    transform: none;
}

.btn.is-loading {
    pointer-events: none;
    opacity: 0.7;
}

/* ---------- Panel boczny ---------- */
.valuator__aside {
    padding: 1.1rem 1.1rem 1rem;
    border-left: 1px solid var(--color-border);
    background: linear-gradient(180deg, var(--color-bg-alt), transparent);
    border-radius: 0 0 var(--radius-xl) 0;
}

.valuator-device {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-border);
}

.valuator-device__icon {
    display: inline-flex;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: var(--color-primary-soft);
    color: var(--color-primary-text);
}

.valuator-device__label {
    color: var(--color-soft);
    font-size: var(--text-xs);
}

.valuator-device__name {
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.3;
}

.valuator-steps {
    display: grid;
    gap: 2px;
}

.valuator-steps__item {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-height: 34px;
    font-size: var(--text-sm);
}

.valuator-steps__item:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 28px;
    left: 11px;
    width: 2px;
    height: 8px;
    border-radius: 2px;
    background: var(--color-border);
}

.valuator-steps__item.is-done:not(:last-child)::after {
    background: var(--color-primary);
}

.valuator-steps__dot {
    display: inline-flex;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border-strong);
    border-radius: 50%;
    color: var(--color-soft);
    font-size: 0.6875rem;
    font-weight: 600;
    transition: background-color var(--duration) ease, border-color var(--duration) ease, color var(--duration) ease;
}

.valuator-steps__dot .vicon svg {
    width: 12px;
    height: 12px;
}

.is-done .valuator-steps__dot {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
}

.is-current .valuator-steps__dot {
    border-color: var(--color-primary);
    color: var(--color-primary-text);
    box-shadow: 0 0 0 4px var(--color-primary-soft);
}

.valuator-steps__link,
.valuator-steps__label {
    padding: 2px 0;
    border: 0;
    background: none;
    color: var(--color-muted);
    text-align: left;
}

.valuator-steps__link:hover {
    color: var(--color-primary-text);
}

.is-current .valuator-steps__label {
    color: var(--color-text);
    font-weight: 600;
}

.valuator-aside__note {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-4);
    color: var(--color-soft);
    font-size: var(--text-xs);
    line-height: 1.5;
}

.valuator-aside__note .icon {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    margin-top: 2px;
    color: var(--color-green);
}

/* ---------- Krok i przejścia ---------- */
.vstep {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    transition: opacity 260ms var(--ease-out), transform 360ms var(--ease-out);
}

.vstep.is-entering {
    opacity: 0;
    transform: translate3d(calc(var(--dir, 1) * 20px), 0, 0);
    transition: none;
}

.vstep.is-leaving {
    opacity: 0;
    transform: translate3d(calc(var(--dir, 1) * -12px), 0, 0);
    transition: opacity 150ms ease, transform 150ms ease;
}

.vstep__header {
    margin-bottom: var(--space-4);
}

.vstep__title {
    font-size: clamp(1.3rem, 1.05rem + 0.8vw, 1.75rem);
    font-weight: 750;
    letter-spacing: -0.035em;
    line-height: 1.15;
    outline: none;
}

.vstep__lead {
    margin-top: 0.3rem;
    color: var(--color-muted);
    font-size: var(--text-sm);
    line-height: 1.5;
}

/* ---------- Karty wyboru (wspólne) ---------- */
.vbrand,
.vmodel,
.vopt,
.vstorage__option,
.vchoice {
    position: relative;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    border: 1.5px solid var(--color-border);
    background: var(--color-surface);
    transition: border-color var(--duration) ease, background-color var(--duration) ease, box-shadow var(--duration) ease, transform var(--duration-fast) var(--ease-out);
}

@media (hover: hover) {
    .vbrand:hover,
    .vmodel:hover,
    .vopt:hover,
    .vstorage__option:hover,
    .vchoice:hover {
        border-color: var(--color-border-strong);
        box-shadow: var(--shadow-sm);
    }
}

.vbrand:active,
.vmodel:active,
.vopt:active,
.vstorage__option:active,
.vchoice:active {
    transform: scale(0.985);
}

/* Fokus klawiatury na ukrytym polu – obrys całej karty */
.vbrand:has(input:focus-visible),
.vmodel:has(input:focus-visible),
.vopt:has(input:focus-visible),
.vstorage__option:has(input:focus-visible),
.vchoice:has(input:focus-visible),
.vseg__option:has(input:focus-visible),
.vtoggle:has(input:focus-visible),
.vcheck:has(input:focus-visible) {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

.vbrand:has(input:checked),
.vmodel:has(input:checked),
.vopt:has(input:checked),
.vstorage__option:has(input:checked),
.vchoice:has(input:checked) {
    border-color: var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 6%, var(--color-surface));
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}

/* Znacznik zaznaczenia */
.vbrand__check,
.vmodel__check,
.vstorage__check,
.vopt__check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 200ms ease, transform 320ms var(--ease-out);
}

.vbrand__check svg,
.vmodel__check svg,
.vstorage__check svg,
.vopt__check svg {
    width: 12px;
    height: 12px;
    stroke-width: 2.75;
}

:has(> input:checked) > .vbrand__check,
:has(> input:checked) > .vmodel__check,
:has(> input:checked) > .vstorage__check,
:has(> input:checked) > .vopt__check {
    opacity: 1;
    transform: scale(1);
}

/* ---------- Krok 1: marka i model ---------- */
.vbrands {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-3);
}

.vbrand {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: var(--space-3);
    padding: 0.7rem 2.5rem 0.7rem 0.75rem;
    border-radius: var(--radius-md);
}

.vbrand__icon,
.vbrand__logo {
    grid-row: span 2;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: contain;
}

.vbrand__icon {
    align-items: center;
    justify-content: center;
    background: var(--color-surface-2);
    color: var(--color-text);
}

.vbrand__name {
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.25;
}

.vbrand__meta {
    color: var(--color-soft);
    font-size: var(--text-xs);
}

.vbrand__check {
    top: 50%;
    margin-top: -10px;
    right: 12px;
}

.vmodels {
    margin-top: var(--space-4);
}

.vmodels__inner {
    transition: opacity 300ms var(--ease-out), transform 400ms var(--ease-out);
}

.vmodels__inner.is-entering {
    opacity: 0;
    transform: translate3d(0, 10px, 0);
}

.vmodels__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.vmodels__title {
    font-size: var(--text-lg);
    letter-spacing: -0.02em;
}

.vsearch {
    position: relative;
    flex: 0 1 300px;
}

.vsearch__icon {
    position: absolute;
    top: 50%;
    left: 14px;
    color: var(--color-soft);
    transform: translateY(-50%);
    pointer-events: none;
}

.vsearch__icon svg {
    width: 18px;
    height: 18px;
}

.vsearch__input {
    width: 100%;
    min-height: 44px;
    padding: 0 var(--space-4) 0 42px;
    border: 1.5px solid var(--color-border-strong);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    font-size: var(--text-sm);
    transition: border-color var(--duration) ease, box-shadow var(--duration) ease;
}

.vsearch__input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px var(--color-primary-soft);
}

/* Zakładki serii (krótkie etykiety: „17”, „16”… z prefiksem „iPhone” obok) */
.vseries-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.vseries__prefix {
    color: var(--color-soft);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.vseries {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.vseries--sub {
    margin: -4px 0 var(--space-3);
    padding-left: var(--space-3);
    border-left: 2px solid var(--color-border);
}

.vseries__tab--sub {
    min-height: 32px;
    padding: 0 0.7rem;
    font-size: var(--text-xs);
}

.vseries__tab--sub.is-active {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
    color: var(--color-primary-text);
}

.vseries__tab {
    min-height: 36px;
    padding: 0 0.85rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    color: var(--color-muted);
    font-size: var(--text-sm);
    font-weight: 600;
    white-space: nowrap;
    transition: background-color var(--duration) ease, color var(--duration) ease, border-color var(--duration) ease;
}

.vseries__tab:hover {
    border-color: var(--color-border-strong);
    color: var(--color-text);
}

.vseries__tab.is-active {
    border-color: var(--color-contrast);
    background: var(--color-contrast);
    color: var(--color-on-contrast);
}

.vsearch__count:empty {
    display: none;
}

.vsearch__count {
    margin: -4px 0 var(--space-2);
    color: var(--color-soft);
    font-size: var(--text-xs);
}

.vmodel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: var(--space-2);
}

.vmodel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    min-height: 56px;
    padding: 0.5rem 2.25rem 0.5rem 0.85rem;
    border-radius: var(--radius-md);
}

.vmodel__name {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.25;
}

.vmodel__year {
    color: var(--color-soft);
    font-size: var(--text-xs);
}

.vmodel__check {
    top: 50%;
    margin-top: -10px;
}

.vmodels__empty {
    padding: var(--space-5);
    border-radius: var(--radius-md);
    background: var(--color-surface-2);
    color: var(--color-muted);
    font-size: var(--text-sm);
    text-align: center;
}

/* ---------- Pamięć ---------- */
.vstorage {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-3);
}

.vstorage__option {
    display: flex;
    min-height: 84px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
}

.vstorage__value {
    font-size: 1.4rem;
    font-weight: 750;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

/* ---------- Pytania ---------- */
.vquestions {
    display: grid;
    gap: var(--space-3);
}

.vq {
    transition: opacity 320ms var(--ease-out), transform 420ms var(--ease-out);
}

.vq.is-entering {
    opacity: 0;
    transform: translate3d(0, -6px, 0);
}

.vq__title {
    font-size: var(--text-base);
    font-weight: 650;
    letter-spacing: -0.015em;
    line-height: 1.3;
}

.vq__help {
    margin-top: 2px;
    color: var(--color-soft);
    font-size: var(--text-xs);
    line-height: 1.45;
}

.vq__head {
    margin-bottom: var(--space-2);
}

/* Krótkie pytanie w jednym wierszu */
.vq--inline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: var(--space-4);
    padding: 0.6rem 0.6rem 0.6rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-alt);
}

.vq--inline .vq__head {
    margin-bottom: 0;
}

.vq--inline .vq__error {
    grid-column: 1 / -1;
}

/* Pytanie zależne – podpięte pod poprzednie; na szerokim ekranie pytanie po lewej, odpowiedzi po prawej */
.vq--child {
    margin-top: -0.35rem;
    padding-left: var(--space-4);
    border-left: 2px solid var(--color-primary);
}

@media (min-width: 861px) {
    .vq--child:not(.vq--inline) {
        display: grid;
        grid-template-columns: minmax(150px, 0.32fr) minmax(0, 1fr);
        align-items: center;
        column-gap: var(--space-4);
    }

    .vq--child:not(.vq--inline) .vq__head {
        margin-bottom: 0;
    }

    .vq--child .vq__title {
        font-size: var(--text-sm);
    }

    .vq--child .vq__error {
        grid-column: 1 / -1;
    }

    .vq--child.vq--inline {
        padding-block: 0.45rem;
    }
}

.vq__error:empty {
    display: none;
}

.vq__error {
    margin-top: var(--space-2);
    color: #d93025;
    font-size: var(--text-sm);
    font-weight: 500;
}

:root[data-theme="dark"] .vq__error,
:root[data-theme="dark"] .vfield__error {
    color: #ff8a80;
}

.vq.has-error .vopts,
.vq.has-error .vcomps,
.vq.has-error .vrange {
    animation: nudge 360ms var(--ease-out);
}

.vq--inline.has-error {
    border-color: color-mix(in srgb, #d93025 50%, var(--color-border));
}

@keyframes nudge {
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Karty odpowiedzi: na szerokim ekranie wszystkie opcje obok siebie */
.vopts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-2);
}

.vopts--n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vopts--n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.vopts--n5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.vopts--n6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.vopts--compact {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.vopt {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    min-height: 56px;
    padding: 0.8rem 2rem 0.8rem 0.85rem;
    border-radius: var(--radius-md);
}

.vopt__icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--color-surface-2);
    color: var(--color-muted);
    transition: background-color var(--duration) ease, color var(--duration) ease;
}

.vopt__icon svg {
    width: 18px;
    height: 18px;
}

.vopt--positive .vopt__icon { color: var(--color-green); }
.vopt--warning .vopt__icon { color: #c77700; }
.vopt--negative .vopt__icon { color: #d93025; }
.vopt--unknown .vopt__icon { color: var(--color-soft); }

:root[data-theme="dark"] .vopt--warning .vopt__icon { color: #ffb340; }
:root[data-theme="dark"] .vopt--negative .vopt__icon { color: #ff6b5e; }

.vopt:has(input:checked) .vopt__icon {
    background: var(--color-primary);
    color: #fff;
}

.vopt__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.vopt__label {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.25;
}

.vopt__desc {
    color: var(--color-muted);
    font-size: var(--text-xs);
    line-height: 1.4;
}

/* Krótkie odpowiedzi (np. części do wyboru) – poziome „pigułki” */
.vopts--compact .vopt {
    flex-direction: row;
    align-items: center;
    min-height: 46px;
    padding: 0.4rem 2rem 0.4rem 0.5rem;
}

.vopts--compact .vopt__icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.vopts--compact .vopt__icon svg {
    width: 16px;
    height: 16px;
}

.vopts--compact .vopt__check {
    top: 50%;
    margin-top: -10px;
}

/* Pytanie zależne z krótkimi odpowiedziami – „pigułki” w jednym rzędzie */
.vopts--chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.vopts--chips .vopt {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 0.95rem 0 0.7rem;
    border-radius: var(--radius-pill);
}

.vopts--chips .vopt__icon {
    width: auto;
    height: auto;
    background: none !important;
}

.vopts--chips .vopt__icon svg {
    width: 16px;
    height: 16px;
}

.vopts--chips .vopt:has(input:checked) .vopt__icon {
    color: var(--color-primary-text);
}

.vopts--chips .vopt__label {
    font-size: var(--text-sm);
}

.vopts--chips .vopt__check {
    display: none;
}

/* Pytanie zależne z opisami – zwarte karty obok siebie */
.vopts--row {
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
}

.vopts--row .vopt {
    flex-direction: row;
    align-items: flex-start;
    min-height: 0;
    padding: 0.6rem 2rem 0.6rem 0.6rem;
}

.vopts--row .vopt__icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
}

.vopts--row .vopt__icon svg {
    width: 16px;
    height: 16px;
}

.vopts--row .vopt__label {
    font-size: var(--text-sm);
}

.vopts--row .vopt__desc {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Pole tekstowe w jednym wierszu z pytaniem */
.vq--text.vq--inline {
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
}

.vfield--inline .vfield__input {
    min-height: 42px;
    font-size: var(--text-sm);
}

.vfield--inline .vfield__counter {
    display: none;
}

/* Przełącznik w wierszu (Tak / Nie / Nie wiem) */
.vopts--inline {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
    padding: 3px;
    border-radius: var(--radius-pill);
    background: var(--color-surface-2);
}

.vopts--inline .vopt {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 0.9rem;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    box-shadow: none;
}

.vopts--inline .vopt__icon {
    width: auto;
    height: auto;
    background: none !important;
}

.vopts--inline .vopt__icon svg {
    width: 16px;
    height: 16px;
}

.vopts--inline .vopt__label {
    font-size: var(--text-sm);
    white-space: nowrap;
}

.vopts--inline .vopt__check {
    display: none;
}

.vopts--inline .vopt:has(input:checked) {
    background: var(--color-surface);
    box-shadow: var(--shadow-sm), 0 0 0 1px var(--color-border);
}

.vopts--inline .vopt:has(input:checked) .vopt__icon {
    color: var(--color-primary-text);
}

.vopts--inline .vopt--negative:has(input:checked) .vopt__icon { color: #d93025; }
.vopts--inline .vopt--positive:has(input:checked) .vopt__icon { color: var(--color-green); }

/* ---------- Kondycja baterii ---------- */
.vrange {
    --battery: var(--color-border-strong);
    --fill: 0%;
    display: grid;
    gap: var(--space-4);
    width: min(100%, 620px);
    margin-inline: auto;
    padding: clamp(1rem, 0.6rem + 1.5vh, 1.75rem) clamp(1rem, 0.6rem + 2vw, 2rem);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, var(--color-surface-2), var(--color-surface));
}

.vrange__display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-5);
}

.vrange__readout {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.vrange__value {
    font-size: clamp(2.75rem, 2rem + 3vw, 4.25rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.05em;
    font-variant-numeric: tabular-nums;
    color: var(--color-soft);
    transition: color var(--duration) ease;
}

.vrange.is-set .vrange__value {
    color: var(--color-text);
}

.vrange.is-unknown .vrange__value {
    font-size: clamp(1.6rem, 1.3rem + 1.5vw, 2.25rem);
}

.vrange__unit {
    margin-left: 2px;
    color: var(--battery);
    font-size: 0.5em;
    font-weight: 700;
    transition: color 200ms linear;
}

.vrange__hint {
    max-width: 280px;
    margin-top: var(--space-2);
    color: var(--color-muted);
    font-size: var(--text-sm);
    line-height: 1.4;
}

/* Ikona baterii: kolor i liczba pasków zależą od wartości (ustawiane w valuation.js) */
.vbattery {
    flex-shrink: 0;
    width: clamp(84px, 70px + 3vw, 112px);
    filter: drop-shadow(0 6px 18px color-mix(in srgb, var(--battery) 35%, transparent));
    transition: filter 200ms linear;
}

.vbattery svg {
    width: 100%;
    height: auto;
    overflow: visible;
}

.vbattery__body {
    fill: color-mix(in srgb, var(--battery) 8%, var(--color-surface));
    stroke: var(--battery);
    stroke-width: 2.5;
    transition: stroke 200ms linear, fill 200ms linear;
}

.vbattery__cap {
    fill: var(--battery);
    transition: fill 200ms linear;
}

.vbattery__bar {
    fill: var(--battery);
    opacity: 0.12;
    transform-box: fill-box;
    transform-origin: center bottom;
    transition: opacity 220ms ease, transform 260ms var(--ease-out), fill 200ms linear;
}

.vrange__control {
    padding-inline: 4px;
}

.vrange__input {
    width: 100%;
    height: 40px;
    margin: 0;
    background: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    touch-action: pan-y;
}

.vrange__input:focus {
    outline: none;
}

.vrange__input::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 8px;
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--battery) 55%, var(--color-surface)) 0%,
        var(--battery) var(--fill),
        var(--color-border) var(--fill));
}

.vrange__input::-moz-range-track {
    height: 8px;
    border-radius: 8px;
    background: var(--color-border);
}

.vrange__input::-moz-range-progress {
    height: 8px;
    border-radius: 8px;
    background: var(--battery);
}

.vrange__input::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
    margin-top: -10px;
    border: 3px solid var(--battery);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--battery) 18%, transparent), 0 4px 12px rgb(var(--color-shadow) / 0.25);
    -webkit-appearance: none;
    appearance: none;
    transition: transform 200ms var(--ease-out), box-shadow 200ms ease, border-color 200ms linear;
}

.vrange__input::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border: 3px solid var(--battery);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--battery) 18%, transparent);
}

.vrange.is-dragging .vrange__input::-webkit-slider-thumb {
    transform: scale(1.15);
    box-shadow: 0 0 0 10px color-mix(in srgb, var(--battery) 22%, transparent), 0 6px 16px rgb(var(--color-shadow) / 0.3);
}

.vrange__input:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 4px var(--color-surface), 0 0 0 7px var(--color-focus);
}

.vrange__input:focus-visible::-moz-range-thumb {
    box-shadow: 0 0 0 4px var(--color-surface), 0 0 0 7px var(--color-focus);
}

.vrange__scale {
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
    color: var(--color-soft);
    font-size: var(--text-xs);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* „Nie wiem” i pola wyboru */
.vtoggle,
.vcheck {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    cursor: pointer;
}

.vtoggle {
    justify-self: center;
    align-items: center;
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border);
    width: 100%;
    justify-content: center;
}

.vtoggle__box,
.vcheck__box {
    display: inline-flex;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--color-border-strong);
    border-radius: 7px;
    background: var(--color-surface);
    color: transparent;
    transition: background-color var(--duration) ease, border-color var(--duration) ease, color var(--duration) ease;
}

.vtoggle__box svg,
.vcheck__box svg,
.vcheck__box .icon {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
}

.vtoggle:has(input:checked) .vtoggle__box,
.vcheck:has(input:checked) .vcheck__box {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
}

.vtoggle__text {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 var(--space-2);
    font-size: var(--text-sm);
}

.vtoggle__text span {
    color: var(--color-soft);
    font-size: var(--text-xs);
}

/* ---------- Podzespoły (macierz) ---------- */
.vcomps {
    display: grid;
    gap: var(--space-2);
}

.vcomps__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.vcomps__legend {
    display: flex;
    gap: var(--space-3);
}

.vcomps__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--color-muted);
    font-size: var(--text-xs);
    font-weight: 600;
}

.vcomps__legend-item svg {
    width: 14px;
    height: 14px;
}

.vcomps__legend-item--positive { color: var(--color-green); }
.vcomps__legend-item--negative { color: #d93025; }
:root[data-theme="dark"] .vcomps__legend-item--negative { color: #ff6b5e; }

.vcomps__all {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 36px;
    padding: 0 var(--space-4);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    color: var(--color-green);
    font-size: var(--text-sm);
    font-weight: 600;
    transition: border-color var(--duration) ease;
}

.vcomps__all svg {
    width: 16px;
    height: 16px;
}

.vcomps__all:hover {
    border-color: var(--color-green);
}

.vcomps__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px var(--space-3);
}

.vcomp {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    min-height: 50px;
    padding: 4px 4px 4px 0.6rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color var(--duration) ease, background-color var(--duration) ease;
}

.vcomp[data-tone="positive"] {
    border-color: color-mix(in srgb, var(--color-green) 35%, var(--color-border));
}

.vcomp[data-tone="negative"] {
    border-color: color-mix(in srgb, #d93025 45%, var(--color-border));
    background: color-mix(in srgb, #d93025 5%, var(--color-surface));
}

.vcomp__info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.vcomp__icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--color-surface-2);
}

.vcomp__icon svg {
    width: 16px;
    height: 16px;
}

.vcomp__name {
    overflow: hidden;
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.25;
    text-overflow: ellipsis;
}

.vcomp__opt {
    margin-left: 6px;
    color: var(--color-soft);
    font-size: 0.6875rem;
    font-weight: 500;
}

.vseg {
    display: inline-flex;
    flex-shrink: 0;
    gap: 2px;
    padding: 3px;
    border-radius: var(--radius-pill);
    background: var(--color-surface-2);
}

.vseg__option {
    display: inline-flex;
    width: 40px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-pill);
    color: var(--color-soft);
    cursor: pointer;
    transition: background-color var(--duration) ease, color var(--duration) ease, box-shadow var(--duration) ease;
}

.vseg__icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.25;
}

.vseg__option:hover {
    color: var(--color-text);
}

.vseg__option:has(input:checked) {
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: var(--shadow-sm), 0 0 0 1px var(--color-border);
}

.vseg__option--positive:has(input:checked) { background: var(--color-green); color: #fff; box-shadow: none; }
.vseg__option--negative:has(input:checked) { background: #d93025; color: #fff; box-shadow: none; }

/* ---------- Pola tekstowe ---------- */
.vfield {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.vfield__label {
    font-size: var(--text-sm);
    font-weight: 600;
}

.vfield__input {
    width: 100%;
    min-height: 48px;
    padding: 0 var(--space-4);
    border: 1.5px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: var(--text-base);
    transition: border-color var(--duration) ease, box-shadow var(--duration) ease;
}

.vfield__input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px var(--color-primary-soft);
}

.vfield__input--mono {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.06em;
}

.vfield__textarea {
    min-height: 64px;
    padding-block: var(--space-2);
    resize: vertical;
    line-height: 1.5;
}

.has-error .vfield__input,
.vfield__input[aria-invalid="true"] {
    border-color: #d93025;
}

.vfield__hint,
.vfield__counter {
    color: var(--color-soft);
    font-size: var(--text-xs);
    line-height: 1.5;
}

.vfield__counter {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.vfield__error {
    color: #d93025;
    font-size: var(--text-sm);
    font-weight: 500;
}

.vfield__error:empty {
    display: none;
}

.vfield__info {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    margin-top: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    background: var(--color-primary-soft);
    color: var(--color-text);
    font-size: var(--text-sm);
    line-height: 1.5;
}

.vfield__info .icon {
    margin-top: 2px;
    color: var(--color-primary-text);
}

/* ---------- Ładowanie i błędy ---------- */
.vloading {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-6) 0;
    color: var(--color-muted);
}

.vspinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid var(--color-primary-soft);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 800ms linear infinite;
}

.vspinner--lg {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.valert {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 1px solid color-mix(in srgb, #d93025 30%, var(--color-border));
    border-radius: var(--radius-md);
    background: color-mix(in srgb, #d93025 6%, var(--color-surface));
}

.valert p {
    flex: 1;
    min-width: 200px;
    font-size: var(--text-sm);
}

.valert__icon {
    color: #d93025;
}

/* ---------- Podsumowanie (dwie kolumny) ---------- */
.vsummary {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: start;
    gap: var(--space-5);
}

.vsummary:has(> .vprice--loading),
.vsummary:has(> .valert) {
    grid-template-columns: minmax(0, 1fr);
}

.vsummary__main {
    display: grid;
    gap: var(--space-3);
}

.vprice {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding: clamp(1.25rem, 0.9rem + 1.5vh, 2rem) 1.5rem;
    border: 1px solid var(--color-panel-border);
    border-radius: var(--radius-xl);
    background: var(--color-panel);
    color: var(--color-panel-text);
    text-align: center;
    animation: price-in 700ms var(--ease-out) both;
}

.vprice::before {
    content: "";
    position: absolute;
    top: -60%;
    left: 50%;
    z-index: -1;
    width: 120%;
    aspect-ratio: 2 / 1;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(10, 124, 240, 0.45), transparent);
    transform: translateX(-50%);
}

@keyframes price-in {
    from {
        opacity: 0;
        transform: translate3d(0, 12px, 0) scale(0.98);
    }
}

.vprice--loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-10);
    border-color: var(--color-border);
    background: var(--color-surface-2);
    color: var(--color-muted);
    animation: none;
}

.vprice--loading::before {
    display: none;
}

.vprice__device {
    color: var(--color-panel-muted);
    font-size: var(--text-sm);
    font-weight: 500;
}

.vprice__label {
    margin-top: var(--space-3);
    color: #9fcbff;
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.vprice--loading .vprice__label {
    margin-top: 0;
    color: var(--color-muted);
    letter-spacing: 0;
    text-transform: none;
}

.vprice__amount {
    display: block;
    margin-top: var(--space-1);
    font-size: clamp(2.6rem, 1.8rem + 3.5vw, 4.25rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.05em;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(180deg, #fff 30%, #b9dcff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.vprice__note {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    max-width: 420px;
    margin: var(--space-3) auto 0;
    color: var(--color-panel-muted);
    font-size: var(--text-sm);
    line-height: 1.45;
}

.vprice__note .vicon svg {
    width: 16px;
    height: 16px;
    margin-top: 2px;
}

.vprice__review-icon {
    justify-content: center;
    margin-top: var(--space-3);
    color: #9fcbff;
}

.vprice__review-icon svg {
    width: 38px;
    height: 38px;
}

.vprice__review-title {
    margin-top: var(--space-2);
    font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.75rem);
    font-weight: 750;
    letter-spacing: -0.03em;
}

.vprice__reasons {
    display: inline-grid;
    gap: var(--space-1);
    margin-top: var(--space-3);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.06);
    color: #e6e6eb;
    font-size: var(--text-sm);
    text-align: left;
    list-style: disc inside;
}

.vprice__demo {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-3);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-pill);
    background: rgba(255, 204, 0, 0.14);
    color: #ffd76a;
    font-size: var(--text-xs);
    font-weight: 600;
}

.vprice__demo .vicon svg {
    width: 14px;
    height: 14px;
}

.vsummary__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
}

.vsummary__actions .btn {
    min-height: 48px;
    white-space: normal;
}

.vbreakdown {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.vbreakdown summary {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 44px;
    padding: 0 var(--space-4);
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 600;
    list-style: none;
}

.vbreakdown summary .vicon svg {
    width: 16px;
    height: 16px;
}

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

.vbreakdown summary::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-left: auto;
    border-right: 2px solid var(--color-soft);
    border-bottom: 2px solid var(--color-soft);
    transform: rotate(45deg);
    transition: transform var(--duration) var(--ease-out);
}

.vbreakdown[open] summary::after {
    transform: rotate(-135deg);
}

.vbreakdown__list {
    display: grid;
    gap: var(--space-1);
    padding: 0 var(--space-4) var(--space-3);
}

.vbreakdown__list li {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    font-size: var(--text-sm);
}

.vbreakdown__list li span {
    color: var(--color-muted);
}

.vbreakdown__list strong {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.vanswers {
    padding: 0 var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface-2);
}

.vanswers[open] {
    padding-bottom: var(--space-2);
}

.vanswers__title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 48px;
    cursor: pointer;
    font-size: var(--text-base);
    font-weight: 700;
    list-style: none;
}

.vanswers__title::-webkit-details-marker {
    display: none;
}

.vanswers__title::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-left: auto;
    border-right: 2px solid var(--color-soft);
    border-bottom: 2px solid var(--color-soft);
    transform: rotate(45deg);
    transition: transform var(--duration) var(--ease-out);
}

.vanswers[open] .vanswers__title::after {
    transform: rotate(-135deg);
}

.vanswers__count {
    padding: 0 0.5rem;
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    color: var(--color-muted);
    font-size: var(--text-xs);
    font-weight: 600;
}

.vanswers__list {
    display: grid;
}

.vanswers__row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    min-height: 40px;
    padding-block: 4px;
    border-bottom: 1px solid var(--color-border);
    font-size: var(--text-sm);
}

.vanswers__row:last-child {
    border-bottom: 0;
}

.vanswers__row dt {
    color: var(--color-soft);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.vanswers__row dd {
    font-weight: 500;
    line-height: 1.35;
}

.vanswers__row.is-negative dd {
    color: #d93025;
}

:root[data-theme="dark"] .vanswers__row.is-negative dd {
    color: #ff6b5e;
}

.vanswers__edit {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--color-primary-text);
    transition: background-color var(--duration) ease;
}

.vanswers__edit:hover {
    background: var(--color-primary-soft);
}

.vanswers__edit .vicon svg {
    width: 15px;
    height: 15px;
}

/* ---------- Okno dialogowe ---------- */
.vdialog {
    width: min(720px, calc(100% - 2rem));
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    margin: auto;
    padding: 0;
    /* clip zamiast hidden: okna nie da się przewinąć programowo (np. przy fokusie pola), więc treść nie „ucieka”. */
    overflow: hidden;
    overflow: clip;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: 0 40px 100px -20px rgb(0 0 0 / 0.45);
}

.vdialog[open] {
    display: flex;
    flex-direction: column;
    animation: dialog-in 380ms var(--ease-out);
}

.vdialog::backdrop {
    background: rgb(10 10 14 / 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: backdrop-in 300ms ease;
}

@keyframes dialog-in {
    from {
        opacity: 0;
        transform: translate3d(0, 24px, 0) scale(0.98);
    }
}

@keyframes backdrop-in {
    from { opacity: 0; }
}

.vdialog--small {
    width: min(460px, calc(100% - 2rem));
}

.vdialog__panel {
    width: 100%;
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    padding: var(--space-8);
    overscroll-behavior: contain;
}

/*
 * Okno formularza: stały nagłówek, przewijana treść i stała stopka z przyciskami.
 * Panel wypełnia okno (flex), a jedynym elementem przewijanym jest .vform__body.
 */
.vdialog--form .vdialog__panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    max-height: none;
    overflow: hidden;
    padding: 0;
}

.vdialog--form .vdialog__header {
    flex-shrink: 0;
    margin: 0;
    padding: var(--space-6) var(--space-8) var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.vdialog--form .vform {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    gap: 0;
}

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

.vform__body {
    display: grid;
    flex: 1 1 auto;
    gap: var(--space-6);
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--space-6) var(--space-8);
    scroll-padding-block: var(--space-6);
}

.vdialog--form .vsuccess {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: var(--space-8);
}

.vdialog__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.vdialog__title {
    font-size: clamp(1.4rem, 1.15rem + 1vw, 1.875rem);
    letter-spacing: -0.035em;
}

.vdialog__lead {
    margin-top: var(--space-2);
    color: var(--color-muted);
}

.vdialog__close {
    display: inline-flex;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    background: var(--color-surface);
    color: var(--color-text);
    transition: background-color var(--duration) ease, transform var(--duration-fast) ease;
}

.vdialog__close:hover {
    background: var(--color-surface-2);
}

.vdialog__close:active {
    transform: scale(0.92);
}

.vconfirm__icon {
    display: inline-flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-4);
    border-radius: 50%;
    background: var(--color-demo-bg);
    color: var(--color-demo-text);
}

.vconfirm__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

/* Formularz zgłoszenia */
.vform {
    display: grid;
    gap: var(--space-6);
}

.vform__device {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    background: var(--color-surface-2);
}

.vform__device-icon {
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--color-surface);
    color: var(--color-primary-text);
}

.vform__device-name {
    font-weight: 600;
}

.vform__device-price {
    color: var(--color-muted);
    font-size: var(--text-sm);
}

.vform__alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, #d93025 8%, var(--color-surface));
    color: #b3261e;
    font-size: var(--text-sm);
    font-weight: 500;
}

:root[data-theme="dark"] .vform__alert {
    color: #ff8a80;
}

.vform__group {
    display: grid;
    gap: var(--space-3);
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.vform__legend {
    margin-bottom: var(--space-3);
    padding: 0;
    font-size: var(--text-base);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.vform__optional {
    margin-left: var(--space-1);
    color: var(--color-soft);
    font-size: var(--text-xs);
    font-weight: 500;
}

.vform__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
}

.vfield--wide {
    grid-column: 1 / -1;
}

.vform__link {
    justify-self: start;
    padding: var(--space-1) 0;
    border: 0;
    background: none;
    color: var(--color-primary-text);
    font-size: var(--text-sm);
    font-weight: 600;
}

.vchoice-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

.vchoice {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-md);
}

/*
 * Ukryte pola wyboru leżą wewnątrz swojej etykiety (position: relative na .vcheck/.vchoice).
 * Wcześniej .vcheck nie był pozycjonowany, więc checkbox zgody był ustawiany względem całego okna
 * – poza przewijanym obszarem. Kliknięcie (fokus) przewijało wtedy okno z overflow: hidden
 * i jego zawartość była ucinana.
 */
.vchoice input,
.vcheck input {
    position: absolute;
    top: 0;
    left: 0;
    width: 22px;
    height: 22px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.vcheck {
    position: relative;
}

.vcheck__text {
    min-width: 0;
    overflow-wrap: anywhere;
}

.vchoice__icon {
    display: inline-flex;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--color-surface-2);
    color: var(--color-primary-text);
}

.vchoice__text {
    display: flex;
    flex-direction: column;
    font-size: var(--text-sm);
}

.vchoice__text span {
    color: var(--color-soft);
}

.vcheck__text {
    font-size: var(--text-sm);
    line-height: 1.5;
}

.vcheck__text a {
    color: var(--color-primary-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.vform__consents {
    padding-top: var(--space-5);
    border-top: 1px solid var(--color-border);
}

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

.vform__footer {
    position: relative;
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-8);
    padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
}

.vform__progress {
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 3px;
    overflow: hidden;
    border-radius: 3px;
    background: var(--color-surface-2);
}

.vform__progress-bar {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-2));
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 150ms linear;
}

.btn__spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.btn.is-loading .btn__spinner {
    display: inline-block;
}

/* Upload zdjęć */
.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-8) var(--space-6);
    border: 2px dashed var(--color-border-strong);
    border-radius: var(--radius-lg);
    background: var(--color-surface-2);
    text-align: center;
    transition: border-color var(--duration) ease, background-color var(--duration) ease, transform var(--duration) var(--ease-out);
}

.dropzone.is-dragging {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
    transform: scale(1.01);
}

.dropzone.is-full {
    opacity: 0.55;
    pointer-events: none;
}

.dropzone__icon {
    display: inline-flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-surface);
    color: var(--color-primary-text);
    box-shadow: var(--shadow-sm);
}

.dropzone__title {
    font-weight: 600;
}

.dropzone__hint {
    margin-bottom: var(--space-2);
    color: var(--color-soft);
    font-size: var(--text-xs);
}

.dropzone label.btn {
    cursor: pointer;
}

.dropzone:has(input:focus-visible) label.btn {
    outline: 2px solid var(--color-focus);
    outline-offset: 3px;
}

.photo-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: var(--space-3);
}

.photo-list:empty {
    display: none;
}

.photo-list__item {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    background: var(--color-surface-2);
    animation: price-in 400ms var(--ease-out) both;
}

.photo-list__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-list__size {
    position: absolute;
    left: 6px;
    bottom: 6px;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.6875rem;
}

.photo-list__remove {
    position: absolute;
    top: 6px;
    right: 6px;
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    transition: background-color var(--duration) ease;
}

.photo-list__remove:hover {
    background: #d93025;
}

.photo-list__remove svg {
    width: 16px;
    height: 16px;
}

/* Potwierdzenie */
.vsuccess {
    padding: var(--space-6) 0 var(--space-2);
    text-align: center;
    outline: none;
}

.vsuccess__icon {
    display: inline-flex;
    width: 72px;
    height: 72px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(140deg, #34c76f, #16803f);
    color: #fff;
    box-shadow: 0 12px 30px -10px rgba(22, 128, 63, 0.7);
    animation: success-pop 600ms var(--ease-out) both;
}

.vsuccess__icon .icon {
    width: 34px;
    height: 34px;
    stroke-width: 2.5;
}

@keyframes success-pop {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
}

.vsuccess__title {
    margin-top: var(--space-5);
    font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
    letter-spacing: -0.035em;
}

.vsuccess__lead {
    margin-top: var(--space-4);
    color: var(--color-muted);
}

.vsuccess__ref {
    display: inline-block;
    margin-top: var(--space-2);
    padding: var(--space-2) var(--space-5);
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    user-select: all;
}

.vsuccess__text {
    max-width: 480px;
    margin: var(--space-5) auto 0;
    color: var(--color-muted);
}

.vsuccess__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-8);
}

/* ==========================================================================
   Dopasowanie do wysokości ekranu (laptopy 768–900 px wysokości)
   ========================================================================== */
@media (min-width: 961px) and (max-height: 860px) {
    .valuator__head {
        padding-block: 0.6rem 0.6rem;
    }

    .valuator__head-row {
        margin-bottom: 0.45rem;
    }

    .valuator__main {
        padding-block: 0.8rem 0.75rem;
    }

    .vstep__header {
        margin-bottom: var(--space-3);
    }

    .vopt {
        padding-block: 0.6rem;
    }

    .vopt__icon {
        width: 30px;
        height: 30px;
    }

    .vcomp {
        min-height: 46px;
    }

    .vseg__option {
        height: 34px;
    }

    .valuator__nav {
        margin-top: var(--space-3);
        padding-top: var(--space-3);
    }

    .valuator-steps__item {
        min-height: 30px;
    }

    .valuator-steps__item:not(:last-child)::after {
        top: 26px;
        height: 6px;
    }

    .valuator-aside__note {
        display: none;
    }
}

@media (min-width: 961px) and (max-height: 860px) {
    .vquestions {
        gap: var(--space-2);
    }

    .vq--inline {
        padding-block: 0.45rem;
    }

    .vopts--inline .vopt {
        min-height: 36px;
    }

    .vopts--chips .vopt {
        min-height: 36px;
    }

    .vstep__lead {
        margin-top: 0.15rem;
    }
}

@media (min-width: 961px) and (max-height: 720px) {
    .vstep__lead,
    .vopt__desc {
        font-size: 0.6875rem;
    }

    .vquestions {
        gap: var(--space-2);
    }
}

/* ==========================================================================
   Responsywność (szerokość)
   ========================================================================== */
@media (max-width: 1100px) {
    .valuator__layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .valuator__aside {
        display: none;
    }

    .vopts--n5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .vsummary {
        grid-template-columns: minmax(0, 1fr);
    }

    .vcomps__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .vopts--n4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .valuator-page {
        padding-bottom: var(--space-6);
    }

    .valuator {
        min-height: calc(100vh - var(--header-height) - 2 * var(--vgap));
        min-height: calc(100dvh - var(--header-height) - 2 * var(--vgap));
        margin-inline: calc(-1 * var(--gutter) + 6px);
        border-radius: var(--radius-lg);
    }

    .valuator__head {
        padding: 0.6rem 0.9rem 0.55rem;
    }

    .valuator__title {
        font-size: var(--text-sm);
    }

    .valuator__title-icon {
        width: 24px;
        height: 24px;
    }

    .valuator__meta {
        font-size: var(--text-xs);
    }

    .valuator__main {
        padding: 0.85rem 0.9rem 0;
    }

    .vstep__header {
        margin-bottom: var(--space-3);
    }

    .vstep__title {
        font-size: 1.25rem;
    }

    /* Nawigacja przyklejona do dołu ekranu – zawsze w zasięgu kciuka */
    .valuator__nav {
        position: sticky;
        bottom: 0;
        z-index: 5;
        margin: var(--space-3) -0.9rem 0;
        padding: 0.6rem 0.9rem calc(0.6rem + env(safe-area-inset-bottom));
        background: color-mix(in srgb, var(--color-surface) 94%, transparent);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }

    .valuator__nav .btn {
        flex: 1;
        min-height: 50px;
        padding-inline: var(--space-4);
    }

    .vbrands {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--space-2);
    }

    .vbrand {
        padding: 0.55rem 2rem 0.55rem 0.55rem;
        column-gap: var(--space-2);
    }

    .vbrand__icon,
    .vbrand__logo {
        width: 36px;
        height: 36px;
    }

    .vmodels__bar {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-2);
    }

    .vsearch {
        flex: none;
    }

    .vseries__tab {
        min-height: 34px;
        padding: 0 0.7rem;
        font-size: var(--text-xs);
    }

    .vmodel-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .vmodel {
        min-height: 50px;
    }

    .vmodel__name {
        font-size: var(--text-sm);
    }

    .vstorage {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .vstorage__option {
        min-height: 68px;
    }

    /* Karty odpowiedzi jako zwarte wiersze */
    .vopts,
    .vopts--n3,
    .vopts--n4,
    .vopts--n5,
    .vopts--n6 {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }

    .vopts--compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .vopt {
        flex-direction: row;
        align-items: center;
        min-height: 52px;
        padding: 0.45rem 2rem 0.45rem 0.55rem;
    }

    .vopt__check {
        top: 50%;
        margin-top: -10px;
    }

    .vq--inline {
        grid-template-columns: minmax(0, 1fr);
        row-gap: var(--space-2);
        padding: 0.6rem;
    }

    /* Szerokość przycisku zależy od treści – długie odpowiedzi nie nachodzą na sąsiednie */
    .vopts--inline {
        display: flex;
        flex-wrap: wrap;
        border-radius: var(--radius-lg);
    }

    .vopts--inline .vopt {
        flex: 1 1 auto;
        justify-content: center;
        padding: 0.35rem 0.6rem;
        border-radius: calc(var(--radius-lg) - 3px);
    }

    .vopts--inline .vopt__label {
        white-space: normal;
        text-align: center;
        line-height: 1.2;
    }

    .vopts--row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .vopts--row .vopt {
        padding: 0.5rem 1.6rem 0.5rem 0.5rem;
    }

    .vopts--row .vopt__icon {
        display: none;
    }

    .vrange {
        gap: var(--space-3);
        padding: var(--space-4);
    }

    .vrange__display {
        gap: var(--space-4);
    }

    .vcomps__legend {
        display: none;
    }

    .vcomps__grid {
        gap: 4px;
    }

    .vcomp {
        min-height: 44px;
        padding: 3px 3px 3px 0.5rem;
    }

    .vcomp__icon {
        width: 28px;
        height: 28px;
    }

    .vseg {
        padding: 2px;
    }

    .vq--text.vq--inline {
        grid-template-columns: minmax(0, 1fr);
    }

    .vopts--row .vopt__desc {
        -webkit-line-clamp: 2;
    }

    .vseg__option {
        width: 42px;
        height: 34px;
    }

    .vsummary__actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .vanswers__row {
        grid-template-columns: 74px minmax(0, 1fr) auto;
        gap: var(--space-2);
    }

    /* Okno zgłoszenia na pełny ekran */
    .vdialog {
        width: 100%;
        max-width: none;
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        margin: 0;
        border-radius: 0;
    }

    .vdialog--small {
        height: auto;
        margin: auto;
        width: calc(100% - 2rem);
        border-radius: var(--radius-lg);
    }

    .vdialog__panel {
        max-height: 100dvh;
        padding: var(--space-5);
    }

    .vform__grid,
    .vchoice-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .vdialog--form .vdialog__header {
        padding: calc(var(--space-4) + env(safe-area-inset-top, 0px)) var(--space-5) var(--space-4);
    }

    .vdialog--form .vdialog__lead {
        font-size: var(--text-sm);
    }

    .vform__body {
        padding: var(--space-5);
    }

    .vdialog--form .vsuccess {
        padding: var(--space-6) var(--space-5);
    }

    .vform__footer {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
        padding: var(--space-3) var(--space-5);
        padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
    }

    .vform__footer .btn {
        width: 100%;
        padding-inline: var(--space-3);
    }
}

/* Niskie telefony (np. 360×740): ciaśniejszy nagłówek i mniejsze odstępy – treść bez zmian */
@media (max-width: 640px) and (max-height: 780px) {
    .valuator__head-row {
        margin-bottom: 0.4rem;
    }

    .valuator__title {
        font-size: var(--text-xs);
    }

    .vstep__header {
        margin-bottom: var(--space-2);
    }

    .vstep__title {
        font-size: 1.125rem;
    }

    .vstep__lead {
        font-size: var(--text-xs);
    }

    .vbrand {
        padding-block: 0.4rem;
    }

    .vbrand__icon,
    .vbrand__logo {
        width: 30px;
        height: 30px;
    }

    .vmodels {
        margin-top: var(--space-3);
    }

    .vmodel {
        min-height: 46px;
    }

    .vseries-row {
        margin-bottom: var(--space-2);
    }

    .vcomp {
        min-height: 42px;
    }

    .vseg__option {
        height: 32px;
    }

    .vcomps__all {
        min-height: 32px;
    }

    .vprice {
        padding: var(--space-4);
    }

    .vprice__amount {
        font-size: 2.5rem;
    }

    .vprice__note {
        margin-top: var(--space-2);
        font-size: var(--text-xs);
    }

    .vsummary__main {
        gap: var(--space-2);
    }

    .vsummary__actions .btn {
        min-height: 44px;
    }

    .vbreakdown summary,
    .vanswers__title {
        min-height: 42px;
    }

    .valuator__nav .btn {
        min-height: 46px;
    }

    .vq--inline {
        padding: 0.5rem;
    }

    .vopts--inline .vopt {
        min-height: 36px;
    }
}

@media (max-width: 360px) {
    .vseg__option {
        width: 38px;
    }

    .vseries__tab {
        padding: 0 0.6rem;
    }
}

@media (max-width: 330px) {
    .vbrands,
    .vmodel-grid,
    .vopts--compact {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .vstep,
    .vq,
    .vmodels__inner,
    .vprice,
    .vdialog[open],
    .photo-list__item,
    .vsuccess__icon,
    .vbattery,
    .vbattery__bar,
    .vbattery__body,
    .vrange__input::-webkit-slider-thumb {
        animation: none !important;
        transition: none !important;
    }

    .vspinner,
    .btn__spinner {
        animation-duration: 1.6s !important;
        animation-iteration-count: infinite !important;
    }
}

/* Znacznik zaznaczenia w zwartych kartach z opisem – w rogu, nie na tekście */
.vopts--row .vopt__check {
    top: 8px;
    margin-top: 0;
}

/* ==========================================================================
   Komputery (≥ 961 px): kalkulator skupu i serwisu jako zwarte okno wyśrodkowane w obszarze
   roboczym – nie wypełnia całego ekranu. Telefony i tablety zachowują układ z reguł powyżej.
   ========================================================================== */
@media (min-width: 961px) {
    .valuator-page {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: calc(100vh - var(--header-height));
        min-height: calc(100dvh - var(--header-height));
        padding-block: clamp(1rem, 3vh, 2.5rem) clamp(2rem, 6vh, 4.5rem);
    }

    .valuator {
        width: 100%;
        max-width: 1040px;
        min-height: min(calc(100dvh - var(--header-height) - 2 * var(--vgap)), 44rem);
    }

    .vstorage__option {
        min-height: 64px;
    }

    .vstorage__value {
        font-size: 1.2rem;
    }

    .vstep__title {
        font-size: clamp(1.25rem, 1rem + 0.45vw, 1.5rem);
    }

    .valuator__nav .btn {
        min-height: 44px;
        padding-inline: 1.25rem;
    }

    .vdialog {
        width: min(640px, calc(100% - 2rem));
    }

    .vdialog--small {
        width: min(440px, calc(100% - 2rem));
    }
}
