/* Product configurator. Uses theme colours if set. */
.po-app {
    --po-accent: var(--wp--preset--color--primary, #054e9e);
    --po-accent-2: var(--wp--preset--color--secondary, #0011a4);
    --po-ink: var(--wp--preset--color--accent-3, #032448);
    --po-tint: var(--wp--preset--color--accent-2, #e7eff9);
    --po-line: var(--wp--preset--color--accent-6, #dbe3ee);
    --po-muted: var(--wp--preset--color--accent-4, #5b6478);
    --po-surface: var(--wp--preset--color--accent-5, #f4f7fb);
    --po-up: var(--po-muted); /* surcharges neutral, not as a warning */
    --po-down: var(--po-muted); /* cheaper options neutral too: no nudge towards a lower price */
    --po-ok: #15803d; /* check marks and the saving of a larger print run */
    --po-error: #b3261e;
    --po-top: calc(var(--ms-header-h, 110px) + 1rem);
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(19rem, 23rem); gap: 1.5rem 2rem; align-items: start;
}
.po-app__main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; min-width: 0; }
.po-step { min-width: 0; }
.po-select, .po-input { max-width: 100%; }
.po-visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden; clip-path: inset(50%); white-space: nowrap; opacity: 0; }

/* Step cards */
.po-step { background: #fff; border: 1px solid var(--po-line); border-radius: 16px; padding: 1.1rem 1.25rem 1.25rem; }
.po-step[hidden] { display: none; }
.po-step__head { display: flex; align-items: center; gap: .75rem; }
.po-step__num {
    flex: none; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
    background: var(--po-accent); color: #fff; font-weight: 800; font-size: .85rem;
}
.po-step__title { margin: 0 !important; font-size: 1.05rem !important; font-weight: 700; color: var(--po-ink); }
.po-step__current {
    margin-left: auto; font-size: .82rem; font-weight: 600; color: var(--po-accent); background: var(--po-tint);
    border-radius: 999px; padding: .25rem .7rem; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.po-step__current:empty { display: none; }
.po-step__edit {
    flex: none; font: inherit; font-size: .82rem; font-weight: 600; color: var(--po-accent); background: none; border: 0;
    padding: .25rem; cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.po-step__current:empty + .po-step__edit { margin-left: auto; }
.po-step.is-collapsed { padding-bottom: 1.1rem; }
.po-app--guide .po-step { transition: border-color .2s, box-shadow .2s; }
.po-step.is-next { border-color: var(--po-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--primary, #054e9e) 12%, transparent), 0 14px 32px color-mix(in srgb, var(--wp--preset--color--accent-3, #032448) 10%, transparent); }
.po-step.is-next .po-step__num { animation: po-ring 1.6s ease-out 2; }
.po-app--guide .po-step[data-done] .po-step__num {
    font-size: 0;
    background: var(--po-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 12.5l4.2 4.2 8.8-9.2'/%3E%3C/svg%3E") center / 1.2rem no-repeat;
}
.po-guide {
    display: flex; align-items: center; gap: .9rem; margin-top: .9rem; padding: .75rem .8rem .75rem .9rem;
    background: linear-gradient(90deg, var(--po-tint), #fff); border: 1px solid var(--po-line); border-left: 4px solid var(--po-accent);
    border-radius: 12px; animation: po-in .3s ease-out;
}
.po-guide__icon { flex: none; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--po-accent); display: grid; place-items: center; }
.po-guide__icon::before {
    content: ""; width: .5rem; height: .5rem; margin-top: -.25rem;
    border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.po-guide__body { flex: 1; min-width: 0; display: grid; gap: .1rem; }
.po-guide__label { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--po-accent); }
.po-guide__text { font-size: .92rem; font-weight: 600; line-height: 1.4; color: var(--po-ink); }
.po-guide__next {
    flex: none; font: inherit; font-size: .9rem; font-weight: 700; color: #fff; background: var(--po-accent);
    border: 0; border-radius: 999px; padding: .6rem 1.2rem; cursor: pointer; display: inline-flex; align-items: center; gap: .45rem;
    box-shadow: 0 6px 14px color-mix(in srgb, var(--wp--preset--color--primary, #054e9e) 25%, transparent); transition: background .15s, transform .15s;
}
.po-guide__next::after { content: "→"; font-weight: 800; }
.po-guide__next:hover, .po-guide__next:focus-visible { background: var(--po-accent-2); transform: translateX(2px); }
.po-intro {
    position: relative; background: #fff; border: 1px solid var(--po-line); border-radius: 16px;
    padding: 1.1rem 1.25rem 1.15rem; color: var(--po-ink);
}
.po-intro__title { margin: 0 0 .85rem !important; font-size: 1.05rem; font-weight: 800; }
.po-intro__steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.po-intro__step { display: flex; align-items: flex-start; gap: .65rem; }
.po-intro__num {
    flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center;
    background: var(--po-tint); color: var(--po-accent); font-weight: 800; font-size: .85rem;
}
.po-intro__txt { display: grid; gap: .1rem; min-width: 0; }
.po-intro__txt strong { font-size: .92rem; }
.po-intro__txt small { font-size: .8rem; line-height: 1.4; color: var(--po-muted); }
.po-intro__close {
    position: absolute; top: .35rem; right: .35rem; width: 2.5rem; height: 2.5rem; border: 0; background: none; cursor: pointer;
    font-size: 1.4rem; line-height: 1; color: var(--po-muted); padding: 0; border-radius: 10px;
}
.po-intro__close:hover { background: var(--po-surface); color: var(--po-ink); }
.po-progress { display: flex; align-items: center; gap: .75rem; margin-top: 1rem; }
.po-progress__track { flex: 1; height: 6px; border-radius: 999px; background: var(--po-tint); overflow: hidden; }
.po-progress__bar { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--po-accent); transition: width .4s ease; }
.po-progress__text { flex: none; font-size: .8rem; font-weight: 600; color: var(--po-muted); }
.po-app__main > .po-progress { margin: 0; padding: 0 .25rem; }
.po-side.is-ready { border-color: var(--po-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--primary, #054e9e) 12%, transparent), 0 16px 40px color-mix(in srgb, var(--wp--preset--color--accent-3, #032448) 10%, transparent); }
.po-ready {
    margin: 0; display: flex; align-items: center; gap: .55rem; font-size: .88rem; font-weight: 700; color: var(--po-ok);
    background: #ecfdf3; border-radius: 10px; padding: .6rem .8rem; animation: po-in .3s ease-out;
}
.po-ready::before {
    content: ""; flex: none; width: .4rem; height: .75rem; margin: -.15rem .25rem 0 .2rem;
    border: solid var(--po-ok); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.po-nudge { animation: po-nudge .9s ease-in-out 3; }
@keyframes po-nudge {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 color-mix(in srgb, var(--wp--preset--color--primary, #054e9e) 45%, transparent); }
    40% { transform: scale(1.05); box-shadow: 0 0 0 10px color-mix(in srgb, var(--wp--preset--color--primary, #054e9e) 0%, transparent); }
    70% { transform: scale(.99); }
}
@keyframes po-ring {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--wp--preset--color--primary, #054e9e) 45%, transparent); }
    100% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--wp--preset--color--primary, #054e9e) 0%, transparent); }
}
@keyframes po-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .po-nudge, .po-step.is-next .po-step__num, .po-guide, .po-ready { animation: none; }
}
.po-step.is-collapsed .po-step__head { cursor: pointer; flex-wrap: wrap; row-gap: .7rem; }
.po-step.is-collapsed .po-step__edit { margin-left: auto; }
.po-step.is-collapsed .po-step__current {
    flex: 0 1 auto; max-width: 100%; margin-left: 0; white-space: normal;
    display: flex; align-items: center; gap: .55rem; font-size: .95rem; font-weight: 700; color: var(--po-ink);
    background: var(--po-tint); border: 1px solid var(--po-accent); box-shadow: inset 0 0 0 1px var(--po-accent);
    border-radius: 10px; padding: .55rem .9rem;
}
.po-step.is-collapsed .po-step__current::before {
    content: ""; flex: none; width: .45rem; height: .8rem; margin: -.2rem .1rem 0 .1rem;
    border: solid var(--po-accent); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.po-step.is-collapsed .po-step__desc, .po-step.is-collapsed .po-step__body { display: none; }
.po-step__desc { margin: .5rem 0 0 2.75rem; font-size: .84rem; line-height: 1.5; color: var(--po-muted); white-space: pre-line; }
.po-step__body { margin-top: .9rem; display: grid; gap: .75rem; }

/* Tiles with price impact */
.po-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .55rem; }
.po-tiles--compact { grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); }
.po-tile {
    position: relative; display: grid; gap: .2rem; align-content: center; text-align: left; box-sizing: border-box; min-height: 3.6rem;
    font: inherit; color: inherit; cursor: pointer; background: #fff;
    border: 1.5px solid var(--po-line); border-radius: 12px; padding: .6rem .8rem .6rem 2.3rem;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.po-tile::before {
    content: ""; position: absolute; left: .8rem; top: 50%; width: 1rem; height: 1rem; margin-top: -.5rem;
    border: 2px solid var(--po-line); border-radius: 50%; box-sizing: border-box; background: #fff; transition: border .15s;
}
.po-tile:hover { border-color: var(--po-accent); box-shadow: 0 4px 14px color-mix(in srgb, var(--wp--preset--color--primary, #054e9e) 10%, transparent); }
.po-tile.is-selected { border-color: var(--po-accent); background: var(--po-tint); box-shadow: inset 0 0 0 1px var(--po-accent); }
.po-tile.is-selected::before { border: 5px solid var(--po-accent); }
.po-tile[hidden] { display: none; }
.po-tile__name { font-size: .9rem; font-weight: 600; line-height: 1.3; }
.po-tile__delta { font-size: .78rem; font-weight: 600; color: var(--po-muted); font-variant-numeric: tabular-nums; min-height: 1em; }
.po-tile__delta.is-up { color: var(--po-up); }
.po-tile__delta.is-down { color: var(--po-down); }
.po-tile.is-selected .po-tile__delta { color: var(--po-accent); }
.po-tile:focus-visible, .po-kind:focus-visible, .po-qty__btn:focus-visible, .po-breaks tr:focus-visible { outline: 2px solid var(--po-accent); outline-offset: 2px; }

/* Paper: kind tabs, then weights */
.po-kinds { display: flex; flex-wrap: wrap; gap: .4rem; }
.po-kind {
    font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; color: var(--po-ink);
    background: var(--po-surface); border: 1.5px solid transparent; border-radius: 999px; padding: .4rem .9rem;
}
.po-kind:hover { border-color: var(--po-line); }
.po-kind.is-active { background: var(--po-ink); color: #fff; }
.po-kind.has-choice:not(.is-active)::after { content: " •"; color: var(--po-accent); }
.po-kind[hidden] { display: none; }

/* Plain controls */
.po-select, .po-input {
    width: 100%; box-sizing: border-box; font: inherit; color: inherit; background-color: #fff;
    border: 1.5px solid var(--po-line); border-radius: 12px; padding: .75rem 1rem; min-height: 48px;
}
.po-select:not(.po-visually-hidden) {
    appearance: none; padding-right: 2.6rem; cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 1.2rem) 50%, calc(100% - .85rem) 50%; background-size: .35rem .35rem; background-repeat: no-repeat;
}
.po-select:focus, .po-input:focus { outline: 2px solid var(--po-accent); outline-offset: 1px; border-color: var(--po-accent); }

/* Print run: stepper + price breaks */
.po-qty { display: inline-flex; align-items: center; gap: .4rem; }
.po-qty input { width: 8.5rem; text-align: center; font: inherit; font-size: 1.15rem; font-weight: 800; border: 1.5px solid var(--po-line); border-radius: 12px; padding: .6rem .5rem; min-height: 48px; box-sizing: border-box; }
.po-qty input:focus { outline: 2px solid var(--po-accent); border-color: var(--po-accent); }
.po-qty select { min-width: 10rem; }
.po-qty__btn { width: 48px; height: 48px; border-radius: 12px; border: 1.5px solid var(--po-line); background: #fff; font-size: 1.3rem; font-weight: 700; cursor: pointer; color: var(--po-ink); }
.po-qty__btn:hover { border-color: var(--po-accent); color: var(--po-accent); }
.po-qty__unit { font-weight: 600; color: var(--po-muted); margin-right: .25rem; }
/* stepper: [ - | 100 Stück | + ] as one control */
.po-qty--stepper { width: max-content; max-width: 100%; gap: 0; border: 1.5px solid var(--po-line); border-radius: 12px; background: #fff; overflow: hidden; }
.po-qty--stepper:focus-within { border-color: var(--po-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--po-accent) 18%, transparent); }
.po-qty--stepper .po-qty__btn { border: 0; border-radius: 0; background: var(--po-tint); color: var(--po-accent); }
.po-qty--stepper .po-qty__btn:hover { background: var(--po-accent); color: #fff; }
.po-qty__field { display: flex; align-items: center; gap: .35rem; padding: 0 .9rem; border-left: 1.5px solid var(--po-line); border-right: 1.5px solid var(--po-line); cursor: text; }
.po-qty--stepper .po-qty__field input { width: 5.5rem; border: 0; border-radius: 0; padding: 0; text-align: right; min-height: 48px; }
.po-qty--stepper .po-qty__field input:focus { outline: none; }
.po-qty--stepper .po-qty__unit { margin: 0; }
.po-breaks { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; font-variant-numeric: tabular-nums; }
.po-breaks th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--po-muted); font-weight: 700; padding: .4rem .75rem; border-bottom: 1px solid var(--po-line); }
.po-breaks td { padding: .55rem .75rem; border-bottom: 1px solid var(--po-line); }
.po-breaks td:first-child { font-weight: 700; }
.po-breaks tbody tr { cursor: pointer; transition: background .1s; }
.po-breaks tbody tr:hover { background: var(--po-surface); }
.po-breaks tbody tr.is-selected { background: var(--po-tint); }
.po-breaks tbody tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--po-accent); }
.po-breaks__save { color: var(--po-ok); font-weight: 700; text-align: right; }

/* Upload */
.po-drop {
    display: grid; gap: .25rem; justify-items: center; text-align: center; cursor: pointer;
    border: 2px dashed var(--po-line); border-radius: 14px; background: var(--po-surface); padding: 1.5rem 1rem;
    transition: border-color .15s, background .15s;
}
.po-drop:hover, .po-drop.is-over { border-color: var(--po-accent); background: var(--po-tint); }
.po-drop:focus-within { outline: 2px solid var(--po-accent); outline-offset: 2px; }
.po-drop__input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.po-drop__title { font-weight: 700; color: var(--po-accent); }
.po-drop__title::before { content: "⬆"; display: block; font-size: 1.4rem; line-height: 1; margin-bottom: .35rem; }
.po-drop__hint { font-size: .8rem; color: var(--po-muted); }
.po-files { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .35rem; }
.po-file { display: flex; align-items: center; gap: .6rem; font-size: .88rem; background: var(--po-surface); border-radius: 8px; padding: .45rem .7rem; }
.po-file::before { content: "✓"; color: var(--po-ok); font-weight: 800; }
.po-remove { margin-left: auto; font: inherit; font-size: .8rem; cursor: pointer; background: none; border: 0; color: var(--po-error); text-decoration: underline; padding: 0; }
.po-upload-status { font-size: .85rem; color: var(--po-muted); }

/* Summary */
.po-app__side { position: sticky; top: var(--po-top); }
.po-side { background: #fff; border: 1px solid var(--po-line); border-radius: 18px; box-shadow: 0 16px 40px color-mix(in srgb, var(--wp--preset--color--accent-3, #032448) 10%, transparent); padding: 1.25rem 1.35rem 1.4rem; display: grid; gap: 1rem; }
.po-side__title { margin: 0 !important; font-size: 1.05rem !important; }
.po-side__list { margin: 0; display: grid; grid-template-columns: fit-content(45%) minmax(0, 1fr); gap: .35rem .9rem; font-size: .84rem; max-height: 40vh; overflow-y: auto; }
.po-side__list dt { color: var(--po-muted); margin: 0; }
.po-side__list dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: break-word; hyphens: auto; }
.po-price { border-top: 1px solid var(--po-line); padding-top: 1rem; transition: opacity .15s; min-height: 5.5rem; }
.po-app.is-loading .po-price, .po-app.is-loading .po-tile__delta, .po-app.is-loading .po-breaks td { opacity: .5; }
.po-price__label { font-size: .8rem; font-weight: 700; color: var(--po-muted); text-transform: uppercase; letter-spacing: .05em; }
.po-total { font-size: 2.1rem; font-weight: 800; color: var(--po-ink); letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.po-price__lines { display: grid; grid-template-columns: 1fr auto; gap: .15rem 1rem; margin: .4rem 0 0; font-size: .84rem; color: var(--po-muted); }
.po-price__lines dt, .po-price__lines dd { margin: 0; }
.po-price__lines dt { white-space: nowrap; }
.po-price__lines dd { text-align: right; font-variant-numeric: tabular-nums; }
.po-errors { color: var(--po-error); margin: 0; padding-left: 1.2em; font-size: .88rem; }
.po-side__actions .single_add_to_cart_button {
    width: 100%; justify-content: center; font-size: 1.05rem !important; padding: 1rem 1.5rem !important; font-weight: 800 !important;
    border-radius: 999px !important; background: var(--po-accent) !important; color: #fff !important; border: 0 !important; cursor: pointer;
}
.po-side__actions .single_add_to_cart_button:hover:not(:disabled) { background: var(--po-accent-2) !important; }
.po-side__actions .single_add_to_cart_button:disabled { opacity: .5; cursor: not-allowed; }
.po-side__notes { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; font-size: .8rem; color: var(--po-muted); }
.po-side__notes li::before { content: "✓"; color: var(--po-ok); font-weight: 800; margin-right: .45rem; }

/* Phone bar */
.po-bar { display: none; }
@media (max-width: 1000px) {
    .po-app { grid-template-columns: minmax(0, 1fr); padding-bottom: 4.5rem; }
    .po-app__side { position: static; }
    .po-bar {
        display: flex; align-items: center; justify-content: space-between; gap: 1rem;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom));
        background: #fff; border-top: 1px solid var(--po-line); box-shadow: 0 -8px 24px color-mix(in srgb, var(--wp--preset--color--accent-3, #032448) 12%, transparent);
    }
    .po-bar__price { display: grid; line-height: 1.15; min-width: 0; }
    .po-bar__gross { font-size: 1.25rem; font-weight: 800; color: var(--po-ink); white-space: nowrap; }
    .po-bar__net { font-size: .85rem; font-weight: 700; color: var(--po-accent); white-space: nowrap; }
    .po-bar__btn { flex: none; white-space: nowrap; font: inherit; font-weight: 700; border: 0; border-radius: 999px; padding: .75rem 1.3rem; background: var(--po-accent); color: #fff; cursor: pointer; }
}
@media (max-width: 600px) {
    .po-step { padding: 1rem; }
    .po-step__desc { margin-left: 0; }
    .po-step__current { display: none; }
    .po-step.is-collapsed .po-step__current { display: flex; order: 1; margin-left: 0; max-width: 100%; }
    .po-guide { flex-wrap: wrap; gap: .6rem .75rem; }
    .po-guide__icon { width: 1.8rem; height: 1.8rem; }
    .po-guide__next { width: 100%; justify-content: center; }
    .po-intro__steps { grid-template-columns: minmax(0, 1fr); gap: .6rem; }
    .po-tiles { grid-template-columns: 1fr 1fr; }
    .po-tile { padding-left: 2.1rem; }
    .po-breaks th:nth-child(2), .po-breaks td:nth-child(2) { display: none; }
}

.po-hidden-qty, form.cart .quantity:has(.po-hidden-qty) { display: none !important; }
form.cart:has(.po-configurator) { display: block !important; }

/* Prices in product lists (default configuration) */
.po-from { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .4rem; }
.po-from__qty { font-size: .85em; color: var(--wp--preset--color--accent-4, #5b6478); font-weight: 500; }
.po-from__price { font-weight: 700; }
.po-from__tax { font-size: max(.75em, 12px); color: var(--wp--preset--color--accent-4, #5b6478); }
.po-from--open { font-size: .9em; color: var(--wp--preset--color--accent-4, #5b6478); }

/* Data sheets & templates ([print_options_downloads]) */
.po-downloads { margin-top: 1.5rem; border: 1px solid var(--wp--preset--color--accent-6, #dbe3ee); border-radius: 14px; padding: 1.1rem 1.2rem; background: #fff; }
.po-downloads__title { font-size: 1rem !important; margin: 0 0 .75rem; }
.po-downloads__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .5rem; }
.po-dl {
    display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; border-radius: 10px; text-decoration: none !important;
    background: var(--wp--preset--color--accent-5, #f4f7fb); color: inherit !important; transition: background .15s;
}
.po-dl:hover { background: var(--wp--preset--color--accent-2, #e7eff9); }
.po-dl__type {
    flex: none; width: 2.6rem; height: 2.6rem; border-radius: 8px; display: grid; place-items: center;
    font-size: .68rem; font-weight: 800; letter-spacing: .03em; color: #fff; background: var(--wp--preset--color--accent-4, #5b6478);
}
.po-dl__type[data-ext="pdf"] { background: #c62828; }
.po-dl__type[data-ext="eps"], .po-dl__type[data-ext="ai"] { background: #e07b00; }
.po-dl__type[data-ext="indd"], .po-dl__type[data-ext="idml"] { background: #c2185b; }
.po-dl__type[data-ext="psd"] { background: #1565c0; }
.po-dl__type[data-ext="docx"], .po-dl__type[data-ext="doc"] { background: #2b579a; }
.po-dl__type[data-ext="pptx"], .po-dl__type[data-ext="ppt"] { background: #c43e1c; }
.po-dl__type[data-ext="xlsx"], .po-dl__type[data-ext="xls"] { background: #217346; }
.po-dl__text { display: grid; min-width: 0; }
.po-dl__label { font-weight: 700; font-size: .88rem; }
.po-dl__meta { font-size: .76rem; color: var(--wp--preset--color--accent-4, #5b6478); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.po-dl__icon { margin-left: auto; font-weight: 800; color: var(--wp--preset--color--primary, #054e9e); }

/* Price breaks: note when another option applies; keep text clear of the selection bar */
.po-breaks td, .po-breaks th { padding-left: .75rem !important; padding-right: .75rem !important; }
.po-breaks__note { display: block; font-size: .72rem; font-weight: 500; color: var(--po-muted); line-height: 1.3; }

/* Fixed value (only one possibility) */
.po-fixed { margin: 0; justify-self: start; display: inline-flex; align-items: center; gap: .5rem; background: var(--po-tint); color: var(--po-ink); font-weight: 600; border-radius: 10px; padding: .55rem .9rem; font-size: .9rem; }
.po-fixed::before { content: "✓"; color: var(--po-accent); font-weight: 800; }

/* Grouped fields ("1. Beilage" … "5. Beilage") */
.po-group-row { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: .5rem 1rem; align-items: start; }
.po-group-row[hidden] { display: none; }
.po-group-row__label { font-weight: 600; font-size: .9rem; padding-top: .8rem; }
.po-group-row__control { display: grid; gap: .5rem; min-width: 0; }
.po-sub-label { font-size: .8rem; font-weight: 600; color: var(--po-muted); margin-bottom: -.35rem; }
.po-sub-label[hidden] { display: none; }
@media (max-width: 600px) {
    .po-group-row { grid-template-columns: minmax(0, 1fr); }
    .po-group-row__label { padding-top: 0; }
}

/* Narrow screens: nothing wider than its card (long words, price table) */
.po-tiles { grid-template-columns: repeat(auto-fill, minmax(min(12.5rem, 100%), 1fr)); } /* room for long German words ("Rechnungsadresse") */
.po-tiles--compact { grid-template-columns: repeat(auto-fill, minmax(min(8rem, 100%), 1fr)); }
.po-tile { min-width: 0; }
.po-tile__name { overflow-wrap: anywhere; hyphens: manual; } /* never run over the tile border */
.po-breaks { table-layout: fixed; }
.po-breaks th:last-child, .po-breaks td:last-child { width: 4.5rem; white-space: nowrap; }
.po-breaks td { overflow-wrap: break-word; }
@media (max-width: 600px) {
    .po-tiles, .po-tiles--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .po-breaks th, .po-breaks td { padding-left: .5rem !important; padding-right: .5rem !important; }
    .po-breaks th:last-child, .po-breaks td:last-child { width: 3.4rem; }
}
.po-step__body { grid-template-columns: minmax(0, 1fr); }
.po-qty { max-width: 100%; }
@media (max-width: 600px) {
    .po-qty input { width: 6.5rem; }
    .po-qty__btn { width: 44px; height: 44px; flex: none; }
    .po-qty--stepper .po-qty__field input { width: 4.5rem; }
}
@media (max-width: 600px) {
    /* phones: long option names as full-width list, short paper weights stay in pairs */
    .po-tiles { grid-template-columns: minmax(0, 1fr); }
    .po-tiles--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .po-tile { min-height: 3rem; }
}

/* Mailing inserts ("1. Beilage: Flyer", configured in a dialog) */
.po-insert { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .75rem; padding: .7rem .85rem; border-radius: 12px; background: var(--po-surface); }
.po-insert[hidden] { display: none; }
.po-insert--todo { background: #fff7e6; box-shadow: inset 0 0 0 2px #f5a524; }
.po-insert__todo { display: grid; gap: .15rem; flex: 1 1 16rem; font-size: .85rem; color: #7a4a00; padding-left: 1.9rem; position: relative; }
.po-insert__todo::before { content: "!"; position: absolute; left: 0; top: .05rem; width: 1.35rem; height: 1.35rem; border-radius: 50%; background: #f5a524; color: #fff; font-weight: 800; display: grid; place-items: center; font-size: .85rem; }
.po-insert__todo strong { font-size: .95rem; color: #5c3700; }
.po-side__list dd.is-todo { color: #9a5b00; font-weight: 700; }
.po-insert__done { display: grid; gap: .1rem; font-size: .84rem; min-width: 0; }
.po-insert__done strong { color: var(--po-ok); }
.po-insert__done span { color: var(--po-muted); overflow-wrap: anywhere; }
.po-insert__price { font-weight: 700; color: var(--po-ink) !important; }
.po-insert__start, .po-insert__edit, .po-apply, .po-cancel { font: inherit; font-weight: 700; border-radius: 999px; cursor: pointer; padding: .55rem 1.1rem; }
.po-insert__start, .po-apply { background: var(--po-accent); color: #fff; border: 0; }
.po-insert__start:hover, .po-apply:hover:not(:disabled) { background: var(--po-accent-2); }
.po-insert__edit, .po-cancel { background: #fff; color: var(--po-accent); border: 1.5px solid var(--po-line); }
.po-apply:disabled { opacity: .5; cursor: not-allowed; }
.po-weight-info { margin: 0; font-size: .84rem; color: var(--po-muted); background: var(--po-surface); border-radius: 10px; padding: .6rem .8rem; }
.po-weight-info:empty { display: none; }

.po-insert-dialog { width: min(1100px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); border: 0; border-radius: 18px; padding: 0; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); background: var(--wp--preset--color--accent-5, #f4f7fb); }
.po-insert-dialog::backdrop { background: rgba(3, 20, 45, .55); }
.po-insert-dialog__head { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 1.25rem; background: #fff; border-bottom: 1px solid var(--wp--preset--color--accent-6, #dbe3ee); }
.po-insert-dialog__head h2 { margin: 0; font-size: 1.1rem; }
.po-insert-dialog__close { font-size: 1.6rem; line-height: 1; width: 2.4rem; height: 2.4rem; border: 0; border-radius: 50%; background: var(--wp--preset--color--accent-5, #f4f7fb); cursor: pointer; }
.po-insert-dialog__body { padding: 1.25rem; }
.po-app--embedded { grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem); }
.po-app--embedded .po-app__side { top: 5rem; }
.po-side__actions { display: grid; gap: .5rem; }
@media (max-width: 800px) {
    .po-app--embedded { grid-template-columns: minmax(0, 1fr); padding-bottom: 0; }
    /* phones: only price + buttons stick, the steps already show the config */
    .po-app--embedded .po-app__side { position: sticky; bottom: 0; top: auto; }
    .po-app--embedded .po-side { gap: .5rem; padding: .75rem 1rem; border-radius: 16px 16px 0 0; }
    .po-app--embedded .po-side__title, .po-app--embedded .po-side__list, .po-app--embedded .po-price__lines, .po-app--embedded .po-side__notes { display: none; }
    .po-app--embedded .po-price { border: 0; padding: 0; min-height: 0; display: flex; justify-content: space-between; align-items: baseline; }
    .po-app--embedded .po-total { font-size: 1.4rem; }
    .po-app--embedded .po-side__actions { grid-template-columns: 1fr auto; }
    .po-insert-dialog { width: 100vw; max-width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; }
    .po-insert-dialog__body { padding: .75rem; }
}

/* Address list (mailings) */
.po-address { display: grid; gap: .5rem; padding: .85rem 1rem; border-radius: 12px; background: var(--po-tint); font-size: .88rem; }
.po-address p { margin: 0; }
.po-address__template { justify-self: start; font-weight: 700; color: var(--po-accent); text-decoration: underline; }
.po-address__template::before { content: "⬇ "; text-decoration: none; }

/* Format tiles: outline in the format's proportions, portrait/landscape at a glance */
.po-tile--shape { padding-right: 3rem; }
.po-tile__icon { position: absolute; right: .75rem; top: 50%; width: 28px; height: 28px; margin-top: -14px; display: grid; place-items: center; }
.po-tile__shape { display: block; box-sizing: border-box; border: 2px solid var(--po-line); border-radius: 2px; background: #fff; transition: border-color .15s; }
.po-tile:hover .po-tile__shape, .po-tile.is-selected .po-tile__shape { border-color: var(--po-accent); }
.po-tile.is-selected .po-tile__shape { background: #fff; box-shadow: 0 0 0 2px var(--po-tint); }
@media (max-width: 600px) {
    /* Formats in pairs: the outline says most of it, the name may wrap. */
    .po-tiles:has(> .po-tile--shape) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* outline above the name, radio dot beside it, name gets full width */
    .po-tile--shape { padding: .6rem .6rem .6rem .6rem; align-content: start; }
    .po-tile--shape::before { left: auto; right: .6rem; top: 1.2rem; }
    .po-tile--shape .po-tile__icon { position: static; order: -1; margin: 0 0 .15rem; width: 28px; height: 28px; place-items: center start; }
    .po-tile--shape .po-tile__name { font-size: .84rem; }
}

/* Technical data table ([print_options_specs]) */
.po-specs { width: 100%; border-collapse: collapse; font-size: .92rem; }
.po-specs th, .po-specs td { text-align: left; vertical-align: top; padding: .85rem .5rem; border: 0 !important; border-bottom: 1px solid var(--po-line, #dbe3ee) !important; background: none !important; }
.po-specs th { width: 13rem; font-weight: 700; color: var(--po-ink, #032448); }
.po-specs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.po-specs li { background: var(--po-surface, #eef3fa); border-radius: 999px; padding: .2rem .7rem; font-size: .84rem; }
@media (max-width: 600px) {
    .po-specs tr { display: grid; padding: .75rem 0; border-bottom: 1px solid var(--po-line, #dbe3ee); }
    .po-specs th, .po-specs td { width: auto; padding: .2rem 0; border: 0 !important; }
}

/* End format (derived from format and fold, not a choice) */
.po-endformat { display: flex; align-items: center; gap: .6rem; margin: .9rem 0 0; padding: .65rem .85rem; border-radius: 10px; background: var(--po-surface, #eef3fa); font-size: .88rem; color: var(--po-muted, #5b6478); }
.po-endformat strong { color: var(--po-ink, #032448); }
.po-endformat__icon { flex: none; width: 24px; height: 24px; display: grid; place-items: center; }
.po-endformat__shape { display: block; box-sizing: border-box; border: 2px solid var(--po-accent, #054e9e); border-radius: 2px; background: #fff; }

/* Gross and net shown equally (most customers are businesses) */
.po-totals { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .35rem 1.4rem; margin-top: .15rem; }
.po-totals__item { display: grid; gap: .05rem; }
.po-totals .po-total { font-size: 1.75rem; }
.po-totals__tax { font-size: .8rem; font-weight: 700; color: var(--po-muted); }
.po-totals__item--net .po-total { color: var(--po-accent); }
.po-breaks__net { font-weight: 600; color: var(--po-accent); }
.po-app--embedded .po-totals .po-total { font-size: 1.3rem; }
@media (max-width: 600px) {
    /* five columns do not fit: the unit price is also in the summary */
    .po-breaks th:nth-child(2), .po-breaks td:nth-child(2) { display: none; }
}

/* Unit price in the summary: two clear lines, gross and net */
.po-unit { display: grid; gap: .3rem; margin-top: .7rem; padding: .65rem .8rem; background: var(--po-surface); border-radius: 10px; }
.po-unit__row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-size: .92rem; color: var(--po-ink); }
.po-unit__row strong { font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.po-unit__row--net strong { color: var(--po-accent); }
.po-app--embedded .po-unit { display: none; }

/* Option tiles: short title, details (sizes, remarks) in a smaller line; wide tiles for long texts */
.po-tile__detail { display: block; font-size: .78rem; font-weight: 500; line-height: 1.35; color: var(--po-muted); margin-top: .1rem; }
.po-tiles--wide { grid-template-columns: repeat(auto-fill, minmax(min(15.5rem, 100%), 1fr)); }
@media (max-width: 600px) {
    .po-tiles--wide { grid-template-columns: minmax(0, 1fr); }
}
/* hidden must win over display:grid/flex of the side parts */
.po-side [hidden] { display: none !important; }
.po-side__list[hidden] + .po-price { border-top: 0; padding-top: 0; }

/* colour options: swatch instead of the hex code */
.po-tile__swatch { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--wp--preset--color--accent-3, #032448) 18%, transparent); flex: none; }
.po-tile--colour { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.po-tile--colour .po-tile__delta { flex-basis: 100%; }
.po-tile--colour .po-tile__delta:empty { display: none; }
/* sizes and other one-word options: several per row */
.po-tiles.po-tiles--mini { grid-template-columns: repeat(auto-fill, minmax(4.75rem, 1fr)); }
.po-tiles--mini .po-tile { text-align: center; padding-left: .75rem; padding-right: .75rem; }
.po-tiles--mini .po-tile::before { display: none; }
@media (max-width: 600px) {
    /* paper kinds: one swipeable row instead of six stacked chips */
    .po-kinds { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -1rem; padding: 0 1rem .15rem; }
    .po-kinds::-webkit-scrollbar { display: none; }
    .po-kind { flex: none; white-space: nowrap; }
}
.po-tile__delta:empty { display: none; }

/* insert supplied by the customer */
.po-own { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem .75rem; margin-top: .6rem; padding: .9rem 1rem; background: var(--po-surface); border: 1px solid var(--po-line); border-radius: 12px; }
.po-own[hidden], .po-own__size[hidden] { display: none; }
.po-own__title { grid-column: 1 / -1; margin: 0; font-weight: 700; font-size: .92rem; color: var(--po-ink); }
.po-own__field { display: grid; gap: .25rem; min-width: 0; font-size: .82rem; font-weight: 600; color: var(--po-muted); }
.po-own__field .po-input, .po-own__field .po-select { width: 100%; box-sizing: border-box; }
.po-own__wide, .po-own__size, .po-own__hint { grid-column: 1 / -1; }
.po-own__size { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.po-own__hint { margin: 0; font-size: .82rem; line-height: 1.45; color: var(--po-ink); background: #fff; border-left: 3px solid var(--po-accent); padding: .5rem .7rem; border-radius: 6px; }
@media (max-width: 600px) { .po-own { grid-template-columns: minmax(0, 1fr); } }
.po-printinfo { display: grid; gap: .2rem; }
