.kn-kreator,
.kn-kreator * {
    box-sizing: border-box;
}

.kn-kreator {
    --kn-akcent: #135fce;
    --kn-akcent-ciemny: #0b3f93;
    --kn-akcent-jasny: #e9f2ff;
    --kn-tekst: #12233f;
    --kn-tekst-drugi: #617089;
    --kn-linia: #d9e3ef;
    --kn-tlo: #edf3f9;
    width: min(1520px, calc(100vw - 24px));
    max-width: none;
    min-height: 760px;
    margin: 18px 0 36px 50%;
    overflow: hidden;
    color: var(--kn-tekst);
    background: #fff;
    border: 1px solid var(--kn-linia);
    border-radius: 16px;
    box-shadow: 0 22px 60px rgba(25, 54, 94, 0.13);
    transform: translateX(-50%);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
}

.kn-kreator a {
    color: inherit;
    text-decoration: none;
}

.kn-kreator button,
.kn-kreator input {
    margin: 0;
    font: inherit;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: none;
}

.kn-kreator button:focus-visible,
.kn-kreator a:focus-visible,
.kn-kreator input:focus-visible {
    outline: 3px solid rgba(19, 95, 206, 0.28);
    outline-offset: 2px;
}

.kn-kreator svg {
    display: block;
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.kn-uklad {
    display: grid;
    grid-template-columns: 320px minmax(480px, 1fr) 360px;
    min-height: 760px;
}

/* Lewa kolumna */

.kn-panel-lewy {
    display: flex;
    min-width: 0;
    padding: 20px 18px 18px;
    flex-direction: column;
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    border-right: 1px solid var(--kn-linia);
}

.kn-skroty {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.kn-skrot {
    display: flex;
    min-height: 56px;
    padding: 10px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: var(--kn-tekst);
    background: #fff;
    border: 1px solid #d7e2ef;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(32, 65, 108, .04);
    cursor: pointer;
    transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.kn-skrot:hover:not(:disabled) {
    color: var(--kn-akcent-ciemny);
    background: var(--kn-akcent-jasny);
    border-color: var(--kn-akcent);
}

.kn-skrot-maly {
    min-height: 40px;
    padding: 7px 9px;
    font-size: 13px;
}

.kn-skrot-maly svg {
    width: 18px;
    height: 18px;
}

.kn-skrot:disabled {
    color: #8a9296;
    cursor: not-allowed;
}

.kn-lista-narzedzi {
    display: grid;
    gap: 8px;
    margin-top: 36px;
}

.kn-narzedzie {
    position: relative;
    display: grid;
    grid-template-columns: 38px 1fr auto;
    min-height: 62px;
    padding: 11px 14px;
    align-items: center;
    gap: 10px;
    color: var(--kn-tekst);
    text-align: left;
    background: #fff;
    border: 1px solid #d8e2ed;
    border-radius: 11px;
    box-shadow: 0 4px 14px rgba(32, 65, 108, .035);
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease;
}

.kn-narzedzie svg {
    width: 28px;
    height: 28px;
}

.kn-narzedzie:hover:not(:disabled),
.kn-narzedzie.jest-aktywne {
    color: var(--kn-akcent-ciemny);
    background: var(--kn-akcent-jasny);
    border-color: var(--kn-akcent);
    box-shadow: 0 7px 20px rgba(19, 95, 206, .09);
}

.kn-narzedzie:disabled {
    opacity: 0.62;
    cursor: not-allowed;
}

.kn-narzedzie small {
    padding: 3px 6px;
    color: #7c5f10;
    background: #fff3c7;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.kn-elementy {
    display: flex;
    min-height: 36px;
    padding: 8px 12px;
    margin-top: auto;
    align-items: center;
    justify-content: space-between;
    color: #4e6380;
    background: #e8eff8;
    border-radius: 9px;
    font-size: 12px;
}

/* Środkowy podgląd */

.kn-podglad {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 760px;
    grid-template-rows: auto minmax(560px, 1fr) 68px;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.52) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, 0.52) 1px, transparent 1px),
        var(--kn-tlo);
    background-size: 30px 30px;
}

.kn-produkt-nazwa {
    position: relative;
    z-index: 3;
    display: flex;
    min-height: 54px;
    padding: 10px 20px;
    align-items: baseline;
    justify-content: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(207, 212, 214, 0.7);
    backdrop-filter: blur(6px);
}

.kn-produkt-nazwa span {
    color: var(--kn-tekst-drugi);
    font-size: 12px;
}

.kn-produkt-nazwa strong {
    overflow: hidden;
    max-width: 58ch;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kn-pole-produktu {
    position: relative;
    display: flex;
    min-height: 0;
    padding: 18px 28px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.kn-zdjecie-produktu {
    position: relative;
    z-index: 1;
    display: block;
    width: auto;
    max-width: 92%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    filter: drop-shadow(0 16px 18px rgba(34, 42, 46, 0.1));
    transition: opacity 140ms ease;
}

.kn-obszar-nadruku {
    position: absolute;
    z-index: 2;
    top: var(--kn-y, 22%);
    left: var(--kn-x, 35%);
    width: var(--kn-szer, 30%);
    height: var(--kn-wys, 48%);
    min-width: 72px;
    min-height: 96px;
    border: 2px dashed rgba(19, 95, 206, 0.72);
    border-radius: 8px;
    background: rgba(19, 95, 206, 0.035);
    pointer-events: none;
}

.kn-obszar-nadruku span {
    position: absolute;
    top: -21px;
    left: 50%;
    width: max-content;
    padding: 2px 6px;
    color: var(--kn-akcent-ciemny);
    background: rgba(255, 255, 255, 0.92);
    border-radius: 3px;
    transform: translateX(-50%);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.kn-widoki {
    position: relative;
    z-index: 3;
    display: flex;
    min-width: 0;
    padding: 10px 16px 16px;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.kn-widoki button {
    min-width: 72px;
    min-height: 40px;
    padding: 8px 12px;
    color: #525b60;
    background: #fff;
    border: 1px solid #d5e0ec;
    border-radius: 9px;
    box-shadow: 0 4px 12px rgba(30, 60, 100, .05);
    cursor: pointer;
    transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.kn-widoki button:hover,
.kn-widoki button.jest-aktywny {
    color: #fff;
    background: var(--kn-akcent);
    border-color: var(--kn-akcent);
}

/* Prawa kolumna */

.kn-panel-prawy {
    display: grid;
    min-width: 0;
    max-height: 920px;
    grid-template-columns: 54px minmax(0, 1fr);
    background: #fbfdff;
    border-left: 1px solid var(--kn-linia);
}

.kn-pasek-akcji {
    display: flex;
    padding: 12px 7px;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    background: #0f3c84;
    border-right: 1px solid var(--kn-linia);
}

.kn-pasek-akcji button {
    display: flex;
    width: 40px;
    height: 40px;
    padding: 0;
    align-items: center;
    justify-content: center;
    color: #dbe9ff;
    background: rgba(255, 255, 255, .09);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
}

.kn-pasek-akcji button:disabled {
    opacity: 0.47;
    cursor: not-allowed;
}

.kn-pasek-akcji svg {
    width: 20px;
    height: 20px;
}

.kn-ustawienia {
    min-width: 0;
    padding: 16px 14px 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.kn-karta {
    margin-bottom: 12px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #d8e3ef;
    border-radius: 11px;
    box-shadow: 0 6px 18px rgba(31, 62, 104, .05);
}

.kn-karta h2 {
    min-height: 32px;
    padding: 7px 10px;
    margin: 0;
    color: #254467;
    background: #edf3fa;
    border: 0;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.35;
}

.kn-karta > p {
    padding: 0 10px;
    margin: 10px 0 0;
    color: var(--kn-tekst-drugi);
    font-size: 11px;
}

.kn-karta-naglowek {
    display: flex;
    min-height: 32px;
    align-items: center;
    justify-content: space-between;
    background: #edf3fa;
}

.kn-karta-naglowek h2 {
    flex: 1;
}

.kn-karta-naglowek .kn-link {
    padding: 5px 9px;
    color: var(--kn-akcent-ciemny);
    background: transparent;
    border: 0;
    font-size: 10px;
    cursor: pointer;
}

.kn-kolor-wybrany {
    display: flex;
    padding: 10px 10px 0;
    align-items: center;
    gap: 5px;
    color: var(--kn-tekst-drugi);
    font-size: 11px;
}

.kn-kolor-wybrany strong {
    color: var(--kn-tekst);
}

.kn-kolory {
    display: flex;
    padding: 10px 11px 13px;
    flex-wrap: wrap;
    gap: 9px;
}

.kn-kolor {
    position: relative;
    width: 32px;
    height: 32px;
    padding: 0;
    background: var(--kn-kolor);
    border: 3px solid #fff;
    border-radius: 8px;
    box-shadow: 0 0 0 1px #aeb5b8;
    cursor: pointer;
}

.kn-kolor.bez-koloru {
    display: grid;
    place-items: center;
    color: #52627a;
    background:
        linear-gradient(135deg, #f8fafc 25%, #e2e8f0 25%, #e2e8f0 50%, #f8fafc 50%, #f8fafc 75%, #e2e8f0 75%);
    background-size: 8px 8px;
    font-size: 11px;
    font-weight: 800;
}

.kn-kolor:hover,
.kn-kolor.jest-aktywny {
    box-shadow: 0 0 0 2px var(--kn-akcent);
}

.kn-kolor.jest-aktywny::after {
    position: absolute;
    top: 6px;
    left: 10px;
    width: 7px;
    height: 12px;
    content: "";
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.85));
}

.kn-rozmiary {
    display: grid;
    padding: 11px 10px 13px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.kn-rozmiar {
    display: grid;
    min-width: 0;
    justify-items: center;
    gap: 4px;
}

.kn-rozmiar span {
    color: #555e62;
    font-size: 11px;
    font-weight: 700;
}

.kn-rozmiar input {
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 4px;
    color: var(--kn-tekst);
    background: #fff;
    border: 1px solid #c9d7e7;
    border-radius: 8px;
    text-align: center;
    appearance: textfield;
}

.kn-rozmiar.jest-niedostepny {
    opacity: .42;
}

.kn-rozmiar.jest-niedostepny input {
    cursor: not-allowed;
    background: #eef1f4;
}

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

.kn-podsumowanie {
    padding-bottom: 12px;
}

.kn-podsumowanie-wiersz {
    display: flex;
    padding: 9px 10px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid #eceeef;
    font-size: 11px;
}

.kn-podsumowanie-wiersz span {
    color: var(--kn-tekst-drugi);
}

.kn-podsumowanie-wiersz strong {
    text-align: right;
}

.kn-podsumowanie-razem {
    padding-top: 12px;
    padding-bottom: 12px;
    border-bottom: 0;
}

.kn-podsumowanie-razem strong {
    color: var(--kn-akcent-ciemny);
    font-size: 18px;
}

.kn-podsumowanie-nadruk strong {
    color: var(--kn-akcent);
}

.kn-przycisk-dalej {
    display: block;
    width: calc(100% - 20px);
    min-height: 44px;
    padding: 10px 12px;
    margin: 4px 10px 0;
    color: #fff;
    background: var(--kn-akcent);
    border: 1px solid var(--kn-akcent);
    border-radius: 9px;
    box-shadow: 0 8px 20px rgba(19, 95, 206, .2);
    font-weight: 750;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease;
}

.kn-przycisk-dalej:hover:not(:disabled) {
    background: var(--kn-akcent-ciemny);
    border-color: var(--kn-akcent-ciemny);
}

.kn-przycisk-dalej:disabled {
    opacity: 0.43;
    cursor: not-allowed;
}

.kn-pomoc {
    min-height: 30px;
    padding: 0 10px;
    margin: 7px 0 0;
    color: var(--kn-tekst-drugi);
    text-align: center;
    font-size: 10px;
}

.kn-brak-danych {
    padding-bottom: 10px !important;
}

.kn-przycisk-projektuj {
    text-align: center;
}

.kn-przycisk-na-produkcie {
    display: inline-block;
    margin-bottom: 14px;
}

.kn-komunikat {
    display: flex;
    width: min(980px, calc(100vw - 30px));
    margin: 24px auto;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

body.kn-dokument-popupu {
    min-width: 320px;
    min-height: 100dvh;
    margin: 0;
    overflow: auto;
    background: #edf3f9;
}

body.kn-dokument-popupu .kn-kreator {
    width: 100%;
    min-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: none;
}

body.kn-dokument-popupu .kn-uklad {
    min-height: 100dvh;
}

body.kn-dokument-popupu .kn-podglad {
    min-height: 100dvh;
}

body.kn-dokument-popupu .kn-panel-prawy {
    max-height: 100dvh;
}

@media (max-width: 1240px) {
    .kn-uklad {
        grid-template-columns: 270px minmax(420px, 1fr) 330px;
    }

    .kn-panel-lewy {
        padding-right: 12px;
        padding-left: 12px;
    }

    .kn-narzedzie {
        grid-template-columns: 32px 1fr auto;
        padding-right: 10px;
        padding-left: 10px;
    }

    .kn-narzedzie svg {
        width: 25px;
        height: 25px;
    }
}

@media (max-width: 980px) {
    .kn-kreator {
        width: calc(100vw - 16px);
        margin-top: 8px;
    }

    .kn-uklad {
        grid-template-columns: minmax(0, 1fr) 330px;
    }

    .kn-panel-lewy {
        display: grid;
        padding: 10px;
        grid-column: 1 / -1;
        grid-template-columns: 250px minmax(0, 1fr);
        gap: 10px;
        border-right: 0;
        border-bottom: 1px solid var(--kn-linia);
    }

    .kn-lista-narzedzi {
        display: flex;
        margin-top: 0;
        overflow-x: auto;
        gap: 7px;
    }

    .kn-narzedzie {
        display: flex;
        min-width: 120px;
        min-height: 48px;
        padding: 7px 10px;
        justify-content: flex-start;
    }

    .kn-narzedzie svg {
        width: 22px;
        height: 22px;
        flex: 0 0 auto;
    }

    .kn-narzedzie small,
    .kn-elementy {
        display: none;
    }

    .kn-skrot {
        min-height: 46px;
    }

    .kn-skrot-maly {
        min-height: 34px;
    }

    .kn-podglad {
        min-height: 650px;
        grid-template-rows: auto minmax(480px, 1fr) 66px;
    }

    .kn-panel-prawy {
        max-height: 720px;
    }
}

@media (max-width: 720px) {
    .kn-uklad {
        grid-template-columns: 1fr;
    }

    .kn-panel-lewy {
        grid-template-columns: 1fr;
    }

    .kn-skroty {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .kn-skrot,
    .kn-skrot-maly {
        min-height: 48px;
        padding: 5px;
        flex-direction: column;
        gap: 2px;
        font-size: 10px;
    }

    .kn-skrot svg,
    .kn-skrot-maly svg {
        width: 20px;
        height: 20px;
    }

    .kn-lista-narzedzi {
        padding-bottom: 3px;
    }

    .kn-narzedzie {
        min-width: 112px;
        flex-direction: column;
        justify-content: center;
        gap: 3px;
        font-size: 10px;
        text-align: center;
    }

    .kn-podglad {
        min-height: 520px;
        grid-template-rows: auto 390px 66px;
    }

    .kn-pole-produktu {
        padding: 12px 18px;
    }

    .kn-zdjecie-produktu {
        max-height: 370px;
    }

    .kn-widoki {
        justify-content: flex-start;
        overflow-x: auto;
    }

    .kn-panel-prawy {
        max-height: none;
        grid-template-columns: 48px minmax(0, 1fr);
        border-top: 1px solid var(--kn-linia);
        border-left: 0;
    }

    .kn-pasek-akcji {
        padding-right: 4px;
        padding-left: 4px;
    }
}

@media (max-width: 420px) {
    .kn-kreator {
        width: 100vw;
        margin-top: 0;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .kn-produkt-nazwa {
        display: block;
        padding: 8px 12px;
        text-align: center;
    }

    .kn-produkt-nazwa span {
        display: block;
    }

    .kn-podglad {
        grid-template-rows: auto 340px 62px;
    }

    .kn-zdjecie-produktu {
        max-width: 100%;
        max-height: 320px;
    }

    .kn-obszar-nadruku span {
        display: none;
    }

    .kn-widoki {
        padding-right: 9px;
        padding-left: 9px;
    }

    .kn-widoki button {
        min-width: 66px;
        padding-right: 8px;
        padding-left: 8px;
        font-size: 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kn-kreator *,
    .kn-kreator *::before,
    .kn-kreator *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
