/* Gemeinsame Split-Screen-Shell (Druckdaten-Upload & Bindungs-Kalkulator) */
/* :has(.flow-shell) wirkt sofort ohne JS – body.flow-shell-page bleibt Fallback */
body.flow-shell-page .site-foot,
body:has(.flow-shell) .site-foot { display: none !important; }
body.flow-shell-page,
body:has(.flow-shell) {
    overflow: hidden;
    height: 100dvh;
}
body.flow-shell-page #inhalt,
body:has(.flow-shell) #inhalt {
    height: calc(100dvh - var(--pc-chrome, 116px));
    min-height: 0;
    overflow: hidden;
}

.flow-shell {
    --uf-ink: #212121;
    --uf-muted: #6f6f6f;
    --uf-line: #e8e8e8;
    --uf-soft: #f7f7f7;
    --uf-radius: 12px;
    --uf-radius-sm: 6px;
    --uf-pad: clamp(1.5rem, 3.5vw, 2.5rem);
    --uf-h: calc(100dvh - var(--pc-chrome, 116px));
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: var(--uf-h);
    max-height: var(--uf-h);
    overflow: hidden;
    background: #fff;
}
.flow-shell__aside,
.flow-shell__panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    height: 100%;
    max-height: 100%;
}
.flow-shell__aside {
    background: #212121;
    color: #fff;
    position: sticky;
    top: 0;
    align-self: start;
    height: var(--uf-h);
    max-height: var(--uf-h);
    overflow: hidden;
}
.flow-shell__preview {
    flex: 1;
    min-height: 0;
    height: 100%;
    overflow: auto;
    display: grid;
    place-items: center;
    padding: var(--uf-pad);
    padding-bottom: calc(var(--uf-pad) + 2rem);
}
.flow-shell__preview-empty,
.flow-shell__preview-stage {
    width: min(100%, 280px);
    display: grid;
    justify-items: center;
    gap: 1rem;
    text-align: center;
    margin-bottom: 1rem;
}
.flow-shell__preview-empty[hidden],
.flow-shell__preview-stage[hidden] { display: none !important; }
.flow-shell__preview-stack {
    position: relative;
    width: 148px;
    height: 190px;
    margin: 0 auto .25rem;
}
.flow-shell__preview-sheet {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 112px;
    aspect-ratio: 210 / 297;
    background: #fff;
    border-radius: 2px;
    box-shadow: 0 10px 28px rgba(0,0,0,.28);
    transform-origin: 50% 70%;
}
.flow-shell__preview-sheet.is-back {
    background: #e8e8e8;
    transform: translate(-62%, -42%) rotate(-14deg);
}
.flow-shell__preview-sheet.is-mid {
    background: #f4f4f4;
    transform: translate(-50%, -50%) rotate(-4deg);
}
.flow-shell__preview-sheet.is-front {
    transform: translate(-38%, -58%) rotate(8deg);
}
.flow-shell__preview-empty p,
.flow-shell__preview-meta strong {
    margin: 0;
    font-family: neue-haas-grotesk-display, "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -.02em;
}
.flow-shell__preview-empty small,
.flow-shell__preview-meta span {
    color: rgba(255,255,255,.62);
    font-size: .84rem;
    line-height: 1.45;
}
.flow-shell__preview-pages { width: 100%; }
.flow-shell__preview-pages canvas,
.flow-shell__preview-pages img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 3px;
    box-shadow: 0 16px 40px rgba(0,0,0,.35);
    background: #fff;
}
.flow-shell__preview-pages.is-bw canvas,
.flow-shell__preview-pages.is-bw img {
    filter: grayscale(1) contrast(1.05);
}

.flow-shell__panel {
    background: #fff;
    color: var(--uf-ink);
    overflow: hidden;
}
.flow-shell__panel-top {
    padding: var(--uf-pad) var(--uf-pad) 0;
    display: grid;
    gap: .85rem;
}
.flow-shell__track {
    display: grid;
    gap: .4rem;
}
.flow-shell__track span {
    height: 2px;
    background: #e8e8e8;
}
.flow-shell__track span.is-on,
.flow-shell__track span.is-done { background: var(--uf-ink); }
.flow-shell__panel-head { margin: 0; }
.flow-shell__panel-head[hidden] { display: none !important; }
.flow-shell__panel-head h2 {
    margin: 0;
    font-family: neue-haas-grotesk-display, "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 900;
    font-size: clamp(1.45rem, 2.3vw, 1.8rem);
    letter-spacing: -.03em;
    line-height: 1.1;
}
.flow-shell__panel-head p {
    margin: .45rem 0 0;
    font-size: .9rem;
    line-height: 1.45;
    color: var(--uf-muted);
    max-width: 32rem;
}
.flow-shell__panel-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1.15rem var(--uf-pad) var(--uf-pad);
}
.flow-shell__nav {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem var(--uf-pad);
    border-top: 1px solid var(--uf-line);
    background: #fff;
}
.flow-shell__nav .btn-ghost,
.flow-shell__nav .btn-next,
.flow-shell__nav .pcb-submit {
    appearance: none;
    border: 1px solid var(--uf-ink);
    font: inherit;
    font-weight: 700;
    font-size: .88rem;
    padding: .75rem 1.25rem;
    border-radius: var(--uf-radius-sm);
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}
.flow-shell__nav .btn-ghost { background: #fff; color: var(--uf-ink); }
.flow-shell__nav .btn-ghost:hover { background: var(--uf-soft); }
.flow-shell__nav .btn-next,
.flow-shell__nav .pcb-submit {
    background: var(--uf-ink);
    color: #fff;
    margin-left: auto;
}
.flow-shell__nav .btn-next:hover,
.flow-shell__nav .pcb-submit:hover { background: #fff; color: var(--uf-ink); }
.flow-shell__nav .btn-ghost[hidden],
.flow-shell__nav .btn-next[hidden],
.flow-shell__nav .pcb-submit[hidden] { display: none !important; }
.flow-shell__price {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    min-width: 0;
    cursor: pointer;
    user-select: none;
}
.flow-shell__price span {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #9a9a9a;
}
.flow-shell__price strong {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--uf-ink);
}
.flow-shell__progress {
    font-size: .78rem;
    font-weight: 600;
    color: #b3b3b3;
    white-space: nowrap;
}

.flow-shell .uf-chips,
.flow-shell .uf-format {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}
.flow-shell .uf-chips label,
.flow-shell .uf-format label,
.flow-shell .pcb-options > label,
.flow-shell .pcb-sub-options-grid > label {
    appearance: none;
    margin: 0 !important;
    cursor: pointer;
    min-width: 3.4rem;
    padding: .55rem .75rem;
    border-radius: 999px;
    border: 1px solid #e2e2e2;
    background: #fafafa;
    text-align: center;
    font-size: .84rem;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--uf-ink);
    line-height: 1.15;
    transition: background .14s ease, border-color .14s ease, color .14s ease, transform .14s ease;
}
.flow-shell .uf-chips label:hover,
.flow-shell .pcb-options > label:hover,
.flow-shell .pcb-sub-options-grid > label:hover {
    border-color: #c8c8c8;
    background: #fff;
    transform: translateY(-1px);
}
.flow-shell .uf-chips label.pcb-selected,
.flow-shell .uf-chips label:has(input:checked),
.flow-shell .pcb-options > label.pcb-selected,
.flow-shell .pcb-options > label:has(input:checked),
.flow-shell .pcb-sub-options-grid > label.pcb-selected,
.flow-shell .pcb-sub-options-grid > label:has(input:checked) {
    background: var(--uf-ink) !important;
    border-color: var(--uf-ink) !important;
    color: #fff !important;
}
.flow-shell .uf-chips input,
.flow-shell .pcb-options > label > input,
.flow-shell .pcb-sub-options-grid > label > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 960px) {
    body.flow-shell-page,
    body:has(.flow-shell) {
        overflow: auto;
        height: auto;
    }
    body.flow-shell-page #inhalt,
    body:has(.flow-shell) #inhalt {
        height: auto;
        overflow: visible;
    }
    .flow-shell {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
        overflow: visible;
    }
    .flow-shell__aside {
        position: relative;
        height: auto;
        max-height: none;
        min-height: 34vh;
    }
    .flow-shell__preview {
        height: auto;
        min-height: 34vh;
        padding: 1.5rem 1.25rem 2rem;
    }
    .flow-shell__panel {
        height: auto;
        max-height: none;
        overflow: visible;
    }
    .flow-shell__panel-scroll { overflow: visible; }
}

/* Exemplare / Mengen – eigene −/+ statt Browser-Spinbuttons */
.pc-qty-stepper {
    display: inline-flex;
    align-items: stretch;
    width: 100%;
    max-width: 11.5rem;
    border: 1px solid var(--uf-line, #e8e8e8);
    border-radius: var(--uf-radius-sm, 6px);
    background: #fff;
    overflow: hidden;
}

.pc-qty-stepper__btn {
    flex: 0 0 2.65rem;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 0;
    border: 0;
    background: var(--uf-soft, #f7f7f7);
    color: var(--uf-ink, #212121);
    font: inherit;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.pc-qty-stepper__btn:hover {
    background: #ececec;
}

.pc-qty-stepper__btn:active {
    background: #e0e0e0;
}

.pc-qty-stepper__btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pc-qty-stepper__input {
    flex: 1 1 auto;
    min-width: 2.5rem;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0.75rem 0.35rem;
    border: 0;
    border-left: 1px solid var(--uf-line, #e8e8e8);
    border-right: 1px solid var(--uf-line, #e8e8e8);
    border-radius: 0;
    background: #fff;
    text-align: center;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--uf-ink, #212121);
    -moz-appearance: textfield;
    appearance: textfield;
}

.pc-qty-stepper__input::-webkit-outer-spin-button,
.pc-qty-stepper__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pc-qty-stepper__input:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--uf-ink, #212121) 12%, transparent);
}

.pcb-media-qty .pc-qty-stepper {
    max-width: 7.5rem;
    justify-self: end;
}
