:root {
    --rrp-ink: #03295d;
    --rrp-line: #e3d4d6;
    --rrp-bg: #f7f2f2;
    --rrp-accent: #03295d;
    --rrp-rose: #c9959a;
    --rrp-rose-soft: #f3e4e5;
}

.rrp-app,
.rrp-app * {
    box-sizing: border-box;
}

.rrp-app {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--rrp-bg);
    color: var(--rrp-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
}

body.rrp-standalone {
    margin: 0;
}

.rrp-app.is-busy {
    cursor: progress;
}

.rrp-app.is-busy .rrp-btn {
    pointer-events: none;
    opacity: 0.6;
}

/* ------------------------------------------------------- ekran startowy */

.rrp-intro {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    overflow-y: auto;
    background: var(--rrp-bg);
}

.rrp-intro[hidden] {
    display: none;
}

.rrp-intro-inner {
    width: 100%;
    max-width: 940px;
    margin: auto;
    text-align: center;
}

.rrp-intro-kicker {
    margin: 0 0 6px;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #6f6a61;
}

.rrp-intro-inner h2 {
    margin: 0 0 8px;
    font-size: 28px;
    line-height: 1.2;
}

.rrp-intro-lead {
    margin: 0 auto 28px;
    max-width: 560px;
    color: #6f6a61;
}

.rrp-assessment {
    display: grid;
    grid-template-columns: minmax(210px, 0.72fr) minmax(0, 1.5fr);
    gap: 12px;
    margin-bottom: 18px;
    text-align: left;
}

.rrp-assessment-question {
    padding: 16px;
    border: 1px solid var(--rrp-line);
    border-radius: 8px;
    background: #fff;
}

.rrp-assessment-question h3 {
    margin: 0 0 12px;
    font-size: 15px;
}

.rrp-assessment-question p {
    margin: 0;
    color: #6f6a61;
    font-size: 12px;
}

.rrp-assessment-dimensions {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    align-items: end;
}

.rrp-assessment-dimensions .rrp-field {
    margin: 0;
}

.rrp-assessment-times {
    padding-bottom: 9px;
    font-size: 20px;
    color: #6f6a61;
}

.rrp-assessment-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.rrp-assessment-option {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 8px;
    border: 1px solid var(--rrp-line);
    border-radius: 6px;
    background: #fff;
    color: var(--rrp-ink);
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.rrp-assessment-option:hover,
.rrp-assessment-option.is-selected {
    border-color: var(--rrp-accent);
}

.rrp-assessment-option.is-selected {
    box-shadow: 0 0 0 2px var(--rrp-rose-soft);
}

.rrp-assessment-option strong {
    font-size: 12px;
    line-height: 1.3;
}

.rrp-wall-illustration {
    display: block;
    aspect-ratio: 1.3;
    border: 1px solid #cfc8bd;
    background-color: #f8f7f2;
}

.rrp-wall-full {
    background: repeating-linear-gradient(135deg, #c9959a 0 8px, #f3e4e5 8px 16px);
}

.rrp-wall-half {
    background: repeating-linear-gradient(135deg, #c9959a 0 8px, #f3e4e5 8px 16px) top / 100% 50% no-repeat, #f8f7f2;
}

.rrp-wall-two {
    background: linear-gradient(to bottom, #c9959a 0 47%, #fff 47% 53%, #7d9ab2 53% 100%);
}

.rrp-wall-paneling {
    background: linear-gradient(to bottom, #f8f7f2 0 55%, #d8e1d5 55% 100%);
    position: relative;
}

.rrp-wall-paneling::after {
    content: "";
    position: absolute;
    inset: 58% 8% 8%;
    border: 2px solid rgba(3, 41, 93, 0.4);
    background: repeating-linear-gradient(90deg, transparent 0 18%, rgba(3, 41, 93, 0.3) 18% 20%);
}

.rrp-assessment-color {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.rrp-assessment-ral-options {
    display: grid;
    grid-template-columns: minmax(140px, 0.5fr) minmax(220px, 1fr);
    flex: 1 1 380px;
    gap: 8px;
    align-items: center;
}

.rrp-assessment-ral-options > input {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid var(--rrp-line);
    border-radius: 6px;
    background: #fff;
    font: inherit;
}

.rrp-assessment-ral-options .rrp-ral-grid {
    grid-column: 1 / -1;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    width: 100%;
    max-height: 152px;
    margin: 0;
}

.rrp-assessment-switch {
    flex: 0 0 auto;
    cursor: pointer;
}

.rrp-assessment-switch input {
    position: absolute;
    opacity: 0;
}

.rrp-assessment-switch span {
    display: block;
    width: 46px;
    height: 26px;
    border-radius: 13px;
    background: #c9c4bc;
    padding: 3px;
    transition: background .15s ease;
}

.rrp-assessment-switch span::after {
    content: "";
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform .15s ease;
}

.rrp-assessment-switch input:checked + span {
    background: var(--rrp-accent);
}

.rrp-assessment-switch input:checked + span::after {
    transform: translateX(20px);
}

.rrp-assessment-switch input:focus-visible + span {
    outline: 2px solid var(--rrp-accent);
    outline-offset: 2px;
}

.rrp-intro-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.rrp-intro-cta {
    padding: 10px 24px;
}

@media (max-width: 860px) {
    .rrp-assessment {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .rrp-intro {
        align-items: flex-start;
        padding: 18px 14px;
    }

    .rrp-intro-inner {
        margin: 0 auto;
    }

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

    .rrp-assessment-color {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .rrp-assessment-ral-options {
        flex-basis: 100%;
        grid-template-columns: 1fr;
    }

    .rrp-intro-inner h2 {
        font-size: 22px;
    }
}

/* ------------------------------------------------------------------ topbar */

.rrp-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: #fff;
    border-bottom: 2px solid var(--rrp-rose);
}

.rrp-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rrp-name {
    border: 1px solid var(--rrp-line);
    border-radius: 6px;
    padding: 6px 10px;
    min-width: 220px;
    font: inherit;
}

.rrp-topbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.rrp-topbar-sep {
    width: 1px;
    height: 22px;
    background: var(--rrp-line);
}

/* ------------------------------------------------------------------ uklad */

.rrp-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr) 300px;
    /* Jeden wiersz o wysokosci kontenera - kolumny przewijaja sie same, zamiast rozpychac plannera. */
    grid-template-rows: minmax(0, 1fr);
    gap: 16px;
    padding: 16px;
    flex: 1;
    min-height: 0;
}

@media (max-width: 1200px) {
    .rrp-layout {
        grid-template-columns: 300px minmax(0, 1fr);
        grid-template-rows: auto;
    }

    .rrp-summary {
        grid-column: 1 / -1;
    }

    .rrp-canvas {
        min-height: 420px;
    }

}

@media (max-width: 1100px) {
    .rrp-layout {
        grid-template-columns: 1fr;
    }
}

.rrp-sidebar {
    background: #fff;
    border: 1px solid var(--rrp-line);
    border-radius: 10px;
    padding: 14px;
    overflow-y: auto;
    min-height: 0;
    max-height: calc(100vh - 110px);
}

/* Wycena to prawa kolumna plannera, przewijana niezaleznie od sceny. */
.rrp-summary {
    background: #fff;
    border: 1px solid var(--rrp-line);
    border-radius: 10px;
    padding: 14px;
    overflow-y: auto;
    min-height: 0;
    max-height: calc(100vh - 110px);
}

.rrp-summary-inner {
    margin: 0;
}

.rrp-stage {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.rrp-stage-info {
    margin-left: auto;
    font-weight: 600;
}

.rrp-canvas {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Szare tlo, zeby biala sciana byla widoczna jako osobny obszar. */
    background: #e8eaed;
    border: 1px solid var(--rrp-line);
    border-radius: 10px;
    padding: 12px;
    overflow: auto;
}

/* Stage ma dokladnie wymiary sciany, wiec cien rysujemy na kontenerze, nie w Konvie. */
.rrp-canvas .konvajs-content {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.rrp-planner-step {
    border-bottom: 1px solid var(--rrp-line);
}

.rrp-planner-step > summary {
    padding: 14px 0;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: 0;
    color: var(--rrp-ink);
    overflow-wrap: anywhere;
}

.rrp-planner-step > summary:focus-visible {
    outline: 2px solid var(--rrp-accent);
    outline-offset: 2px;
}

.rrp-planner-step-body {
    padding: 4px 0 16px;
}

.rrp-planner-step .rrp-item-editor:not([hidden]) {
    margin-top: 16px;
}

/* ------------------------------------------------------------------ pola */

.rrp-field {
    display: block;
    margin-bottom: 10px;
}

.rrp-field > span {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.rrp-field input,
.rrp-field select {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid var(--rrp-line);
    border-radius: 6px;
    font: inherit;
    background: #fff;
}

.rrp-field input[type="color"] {
    height: 38px;
    padding: 2px;
}

.rrp-fonts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.rrp-font {
    border: 1px solid var(--rrp-line);
    border-radius: 8px;
    background: #fff;
    padding: 10px 6px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1.3;
    /* Motyw nadaje przyciskom wersaliki i pogrubienie - podglad musi pokazac prawdziwy kroj. */
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rrp-font:hover {
    border-color: var(--rrp-accent);
}

.rrp-font.is-active {
    border-color: var(--rrp-accent);
    box-shadow: 0 0 0 2px var(--rrp-rose-soft);
}

.rrp-ral {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -4px 0 8px;
    font-size: 13px;
    line-height: 1.35;
}

.rrp-ral-search {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.rrp-ral-search input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 7px 9px;
    border: 1px solid var(--rrp-line);
    border-radius: 6px;
    font: inherit;
}

.rrp-ral-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    max-height: 232px;
    overflow-y: auto;
    padding: 6px;
    margin-bottom: 10px;
    border: 1px solid var(--rrp-line);
    border-radius: 8px;
    background: #fff;
}

.rrp-ral-tile {
    position: relative;
    height: 46px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, .18);
    border-radius: 6px;
    cursor: pointer;
    overflow: hidden;
}

.rrp-ral-tile:hover {
    transform: scale(1.04);
}

.rrp-ral-tile.is-selected {
    outline: 2px solid var(--rrp-accent);
    outline-offset: 1px;
}

.rrp-ral-tile-code {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1px 0 2px;
    font-size: 10px;
    line-height: 1.2;
    letter-spacing: .2px;
    color: #fff;
    background: rgba(0, 0, 0, .45);
}

.rrp-ral-chip {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid var(--rrp-line);
}

.rrp-ral-text {
    font-weight: 600;
}

.rrp-ral.is-approx .rrp-ral-text {
    font-weight: 400;
    color: #8a5a00;
}

.rrp-note {
    margin: 0 0 12px;
    padding: 8px 10px;
    border-left: 3px solid #d9a441;
    background: #fdf6e7;
    border-radius: 0 6px 6px 0;
    font-size: 12px;
    line-height: 1.45;
    color: #6b5324;
}

.rrp-field-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rrp-field-check input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.rrp-field-check > span {
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
    font-size: 13px;
}

/* ------------------------------------------------------------ sekcje zwijane */

.rrp-acc {
    margin-bottom: 10px;
    border: 1px solid var(--rrp-line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.rrp-acc > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--rrp-rose-soft);
    color: var(--rrp-accent);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    list-style: none;
}

.rrp-acc > summary::-webkit-details-marker {
    display: none;
}

.rrp-acc > summary::before {
    content: "";
    width: 0;
    height: 0;
    border-left: 6px solid var(--rrp-accent);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: transform .15s ease;
}

.rrp-acc[open] > summary::before {
    transform: rotate(90deg);
}

.rrp-acc-body {
    padding: 12px;
    border-top: 1px solid var(--rrp-line);
}

.rrp-acc-body > *:last-child {
    margin-bottom: 0;
}

.rrp-subhead {
    margin: 18px 0 8px;
    padding-top: 12px;
    border-top: 1px solid var(--rrp-line);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.rrp-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
}

.rrp-row > .rrp-field {
    flex: 1 1 100px;
}

.rrp-hint {
    font-size: 12px;
    color: #6f6a61;
    margin: 6px 0;
}

.rrp-hint.is-error {
    color: #a3261f;
}

.rrp-item-editor h3 {
    margin: 0 0 6px;
    font-size: 15px;
}

.rrp-item {
    border: 1px solid #e0dcd3;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 6px;
}

.rrp-item[open] {
    border-color: var(--rrp-accent);
}

.rrp-item-summary {
    display: block;
    padding: 8px 10px;
    cursor: pointer;
    list-style: none;
}

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

.rrp-item-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--rrp-accent);
}

.rrp-item-sub {
    display: block;
    font-size: 11px;
    color: #6f6a61;
}

.rrp-item-body {
    padding: 0 10px 10px;
}

.rrp-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.rrp-item-actions .rrp-btn {
    flex: 1 1 auto;
    justify-content: center;
    padding: 6px 10px;
    font-size: 12px;
    text-transform: none;
    letter-spacing: normal;
}

/* ------------------------------------------------------------------ przyciski */

.rrp-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--rrp-line);
    border-radius: 6px;
    background: #fff;
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-decoration: none;
}

.rrp-btn:hover {
    border-color: var(--rrp-rose);
}

.rrp-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.rrp-btn-primary {
    background: var(--rrp-accent);
    border-color: var(--rrp-accent);
    color: #fff;
}

.rrp-btn-primary:hover {
    background: var(--rrp-rose);
    border-color: var(--rrp-rose);
    color: var(--rrp-accent);
}

.rrp-btn-block {
    width: 100%;
    justify-content: center;
    margin-top: 12px;
    padding: 11px 12px;
    font-weight: 600;
}

.rrp-btn-ghost {
    background: transparent;
}

/* ------------------------------------------------------------------ katalog */

.rrp-search {
    margin-bottom: 10px;
}

.rrp-search input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--rrp-line);
    border-radius: 6px;
    font: inherit;
}

.rrp-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.rrp-picker {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
}

.rrp-picker-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--rrp-line);
    border-radius: 8px;
    font: inherit;
}

.rrp-picker-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rrp-chip {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid var(--rrp-line);
    border-radius: 999px;
    background: #fff;
    padding: 6px 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: inherit;
    cursor: pointer;
}

.rrp-chip.is-active {
    background: var(--rrp-accent);
    border-color: var(--rrp-accent);
    color: #fff;
}

.rrp-chip-clear {
    color: #6f6a61;
}

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

.rrp-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--rrp-line);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    font: inherit;
}

.rrp-card:hover {
    border-color: var(--rrp-accent);
}

.rrp-card img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 4px;
}

.rrp-card-name {
    font-weight: 600;
    font-size: 13px;
}

.rrp-card-price {
    font-size: 12px;
    color: #6f6a61;
}

.rrp-badge {
    align-self: flex-start;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    background: var(--rrp-rose-soft);
    color: var(--rrp-accent);
}

.rrp-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 10px 0;
    font-size: 12px;
}

/* Nakladki tapet leza na scenie - kazda w prawym gornym rogu swojego pasa sciany. */
.rrp-scene-wrap {
    position: relative;
    line-height: 0;
    flex: none;
}

.rrp-wp-badges {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.rrp-wp-badge {
    position: absolute;
    right: 8px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: calc(100% - 16px);
    padding: 3px 4px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--rrp-line);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
    line-height: 1.2;
    pointer-events: auto;
}

.rrp-wp-badge.is-empty {
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
}

/* Motyw sklepu rozpycha pola i przyciski - w plakietce musza byc jednej, niskiej wysokosci. */
.rrp-wp-badge select,
.rrp-wp-badge .rrp-btn,
.rrp-wp-badge .rrp-wp-remove {
    height: 26px;
    min-height: 0;
    margin: 0;
    font-size: 12px;
    line-height: 1.2;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: none;
}

.rrp-wp-badge select {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 150px;
    padding: 0 4px;
    border: 1px solid var(--rrp-line);
    border-radius: 6px;
    font-family: inherit;
    background: #fff;
}

.rrp-wp-note {
    flex: none;
    font-size: 12px;
    color: #6f6a61;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rrp-wp-crop,
.rrp-wp-pick {
    flex: none;
    padding: 0 8px;
}

.rrp-wp-remove {
    flex: none;
    width: 22px;
    padding: 0;
    border: 0;
    background: none;
    color: #6f6a61;
    font-size: 17px;
    cursor: pointer;
}

.rrp-wp-remove:hover {
    color: var(--rrp-accent);
    background: none;
}

@media (max-width: 700px) {
    .rrp-wp-note {
        display: none;
    }

    .rrp-wp-badge {
        gap: 6px;
        padding: 4px 6px;
    }
}

/* ------------------------------------------------------------------ wycena */

.rrp-summary h2 {
    margin: 0 0 10px;
    font-size: 16px;
}

.rrp-quote-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rrp-quote-list li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--rrp-line);
}

.rrp-quote-list small {
    display: block;
    color: #6f6a61;
    font-size: 11px;
}

.rrp-total {
    margin-top: 10px;
    font-size: 15px;
    padding-top: 10px;
    border-top: 2px solid var(--rrp-rose);
}

.rrp-messages {
    margin-top: 12px;
    font-size: 13px;
}

.rrp-messages.is-error {
    color: #a3261f;
}

.rrp-messages.is-success {
    color: #2c6b3f;
}

/* ------------------------------------------------------------------ modal */

.rrp-modal {
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 18, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 10000;
}

.rrp-modal[hidden] {
    display: none;
}

body.rrp-modal-open {
    overflow: hidden;
}

/* Pływający przełącznik języka (TranslatePress) ma z-index 9999999 i zasłania przyciski modala. */
body.rrp-modal-open #trp-floater-ls {
    display: none;
}

.rrp-modal-box {
    background: #fff;
    border-radius: 12px;
    width: min(840px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.rrp-modal.is-wide .rrp-modal-box {
    width: min(1320px, 100%);
    height: 92vh;
    max-height: 92vh;
}

.rrp-modal.is-wide .rrp-modal-body {
    flex: 1;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.rrp-modal-box header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--rrp-line);
}

.rrp-modal-box h3 {
    margin: 0;
    font-size: 16px;
}

.rrp-modal-body {
    padding: 16px;
    overflow: auto;
}

.rrp-modal.is-auth .rrp-modal-box {
    width: min(440px, 100%);
    height: auto;
    max-height: calc(100dvh - 32px);
    border-radius: 8px;
}

.rrp-auth {
    color: var(--rrp-ink);
    overflow-wrap: anywhere;
}

.rrp-auth-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 6px;
    margin-bottom: 20px;
}

.rrp-auth-tabs .rrp-btn[aria-pressed="true"] {
    background: var(--rrp-accent);
    border-color: var(--rrp-accent);
    color: #fff;
}

.rrp-auth .rrp-btn,
.rrp-auth .rrp-field > span {
    text-transform: none;
    letter-spacing: 0;
    white-space: normal;
    margin: 0;
}

.rrp-auth .rrp-field > span {
    margin-bottom: 6px;
    font-size: 13px;
}

.rrp-auth .rrp-field input {
    min-width: 0;
    height: 44px;
    margin: 0;
    font-size: 16px;
}

.rrp-auth .rrp-field > .rrp-auth-password {
    display: flex;
    position: relative;
}

.rrp-auth-password input {
    padding-right: 48px;
}

.rrp-auth-password .rrp-btn {
    position: absolute;
    right: 2px;
    top: 2px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    min-height: 0;
    padding: 0;
    border: 0;
}

.rrp-auth-password svg {
    width: 18px;
    height: 18px;
}

.rrp-auth .rrp-field-check {
    margin: 14px 0;
}

.rrp-auth-privacy,
.rrp-auth-feedback {
    font-size: 13px;
    line-height: 1.5;
    margin: 14px 0;
}

.rrp-auth-privacy a {
    text-decoration: underline;
}

.rrp-auth-feedback {
    color: #a3261f;
}

.rrp-auth-feedback.is-success {
    color: #2c6b3f;
}

.rrp-auth .rrp-auth-switch {
    display: block;
    margin: 12px auto 0;
}

.rrp-auth .rrp-btn:focus-visible,
.rrp-auth input:focus-visible {
    outline: 2px solid var(--rrp-accent);
    outline-offset: 2px;
}

.rrp-sizes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
}

.rrp-size {
    padding: 10px;
    border: 1px solid var(--rrp-line);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
}

.rrp-size small {
    display: block;
    font-weight: 400;
    font-size: 11px;
    color: #6f6a61;
}

.rrp-projects {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rrp-projects li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--rrp-line);
}

.rrp-projects small {
    display: block;
    color: #6f6a61;
    font-size: 12px;
}

.rrp-crop {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

/* ------------------------------------------------------------------ studio wydruku */

.rrp-studio {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.rrp-studio-steps {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--rrp-line);
    background: #fff;
    overflow-x: auto;
}

.rrp-studio-step {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--rrp-line);
    border-radius: 999px;
    background: #fff;
    padding: 6px 14px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.rrp-studio-step .rrp-step-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--rrp-rose-soft);
    font-size: 11px;
}

.rrp-studio-step .rrp-step-value {
    color: #6f6a61;
    font-size: 12px;
}

.rrp-studio-step.is-done {
    border-color: var(--rrp-rose);
}

.rrp-studio-step.is-active {
    background: var(--rrp-accent);
    border-color: var(--rrp-accent);
    color: #fff;
}

.rrp-studio-step.is-active .rrp-step-index,
.rrp-studio-step.is-active .rrp-step-value {
    color: #fff;
    background: transparent;
}

.rrp-studio-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.rrp-studio-choice {
    padding: 18px;
}

.rrp-studio-choice h3 {
    margin: 0 0 12px;
}

.rrp-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}

.rrp-tile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    text-align: center;
    border: 1px solid var(--rrp-line);
    border-radius: 12px;
    background: #fff;
    padding: 12px;
    cursor: pointer;
    font: inherit;
}

.rrp-tile:hover:not([disabled]) {
    border-color: var(--rrp-accent);
}

.rrp-tile.is-active {
    border-color: var(--rrp-accent);
    box-shadow: 0 0 0 2px var(--rrp-rose-soft);
}

.rrp-tile[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

.rrp-tile img,
.rrp-tile .rrp-tile-blank {
    width: 100%;
    height: 110px;
    object-fit: contain;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rrp-bg);
    border-radius: 8px;
    font-size: 24px;
    text-transform: uppercase;
    color: var(--rrp-rose);
}

.rrp-tile-name {
    font-weight: 600;
}

.rrp-tile small {
    color: #6f6a61;
    font-size: 12px;
}

.rrp-tile-price {
    font-size: 12px;
    color: var(--rrp-accent);
}

.rrp-studio-edit {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    height: 100%;
    min-height: 0;
}

.rrp-studio-stage {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: center;
    justify-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 0;
    padding: 14px;
    background: var(--rrp-bg);
}

.rrp-studio-summary {
    margin: 0;
    font-size: 13px;
    text-align: center;
}

.rrp-studio-summary small {
    display: block;
    color: #6f6a61;
    font-size: 11px;
}

.rrp-studio-canvas {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

.rrp-studio-side {
    border-left: 1px solid var(--rrp-line);
    padding: 14px;
    overflow-y: auto;
    min-height: 0;
}

.rrp-studio-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.rrp-studio-group {
    border: 1px solid var(--rrp-line);
    background: #fff;
    border-radius: 999px;
    padding: 5px 11px;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.rrp-studio-categories {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 10px 0;
}

.rrp-studio-category {
    border: 1px solid rgba(20, 56, 82, 0.22);
    background: #fff;
    color: #143852;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
}

.rrp-studio-category.is-active {
    background: #143852;
    color: #fff;
    border-color: #143852;
}

.rrp-studio-group.is-active {
    background: var(--rrp-accent);
    border-color: var(--rrp-accent);
    color: #fff;
}

.rrp-studio-assets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 6px;
}

.rrp-studio-asset {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    border: 1px solid var(--rrp-line);
    border-radius: 8px;
    background: #fff;
    padding: 6px;
    cursor: pointer;
    font: inherit;
    font-size: 10px;
    line-height: 1.2;
    text-align: center;
}

.rrp-studio-asset:hover {
    border-color: var(--rrp-accent);
}

.rrp-studio-asset img {
    width: 100%;
    height: 64px;
    object-fit: contain;
}

.rrp-studio-asset span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rrp-studio-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.rrp-studio-layers {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.rrp-studio-layer {
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--rrp-line);
    border-radius: 6px;
    padding: 4px 6px;
    margin-bottom: 6px;
}

.rrp-studio-layer.is-active {
    border-color: var(--rrp-accent);
    background: var(--rrp-rose-soft);
}

.rrp-studio-layer-name {
    flex: 1;
    border: 0;
    background: none;
    text-align: left;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    padding: 2px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rrp-studio-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--rrp-line);
    background: #fff;
}

.rrp-studio-note {
    margin-right: auto;
    font-size: 13px;
    color: #6f6a61;
}

.rrp-studio-note.is-error {
    color: #a3261f;
}

/* Galeria grafik zawsze jako nakladka - w waskim panelu bocznym nie da sie nawigowac. */
.rrp-studio-library {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: none;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px 18px;
    background: #fff;
    overflow-y: auto;
}

.rrp-studio-library.is-open {
    display: flex;
}

.rrp-library-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: sticky;
    top: -12px;
    margin: -12px -14px 0;
    padding: 12px 14px;
    background: #fff;
    border-bottom: 1px solid var(--rrp-line);
}

.rrp-library-head .rrp-subhead {
    margin: 0;
    padding-top: 0;
    border-top: 0;
}

.rrp-library-close {
    border: 0;
    background: none;
    padding: 0;
    width: 32px;
    height: 32px;
    font-size: 26px;
    line-height: 1;
    color: #6f6a61;
    cursor: pointer;
}

.rrp-studio-picks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Flatsome daje przyciskom wersaliki i duze odstepy - w panelu studia to za duzo miejsca. */
.rrp-studio-picks .rrp-btn,
.rrp-studio-tools .rrp-btn {
    padding: 6px 10px;
    font-size: 12px;
}

.rrp-studio-picks .rrp-btn,
.rrp-studio-tools .rrp-btn,
.rrp-studio-layer-name {
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
}

.rrp-studio-tools {
    margin-top: 6px;
}

@media (min-width: 901px) {
    .rrp-studio-library {
        inset: 8vh 14vw;
        border: 1px solid var(--rrp-line);
        border-radius: 12px;
        box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
    }
}

/* Formularz elementu musi zmiescic sie w waskim panelu studia. */
.rrp-studio-form .rrp-field {
    margin-bottom: 8px;
}

.rrp-studio-form .rrp-field > span {
    font-size: 10px;
    font-weight: 600;
    color: #6f6a61;
    margin-bottom: 2px;
}

.rrp-studio-form .rrp-field input {
    padding: 5px 8px;
    font-size: 13px;
}

.rrp-studio-form .rrp-field input[type="color"] {
    height: 30px;
}

.rrp-birth-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 8px;
}

.rrp-birth-form .rrp-field-wide {
    grid-column: 1 / -1;
}

@media (max-width: 900px) {
    .rrp-modal.is-studio {
        align-items: flex-start;
        padding: 0;
        height: 100dvh;
        overflow-y: auto;
        overscroll-behavior-y: contain;
    }

    .rrp-modal.is-studio.is-wide .rrp-modal-box {
        width: 100%;
        height: auto;
        min-height: 100%;
        max-height: none;
        border-radius: 0;
        overflow: visible;
        padding-top: env(safe-area-inset-top, 0px);
    }

    .rrp-modal.is-studio .rrp-modal-body {
        flex: none;
        overflow: visible;
    }

    .rrp-studio {
        height: auto;
    }

    .rrp-studio-body {
        flex: none;
        overflow: visible;
    }

    .rrp-studio-steps {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 1fr;
        overflow: visible;
    }

    .rrp-studio-step {
        display: grid;
        grid-template-columns: 20px minmax(0, 1fr);
        gap: 4px 8px;
        min-width: 0;
        margin: 0;
        padding: 8px;
        border-radius: 6px;
        white-space: normal;
        text-align: left;
        text-transform: none;
        letter-spacing: 0;
        overflow-wrap: anywhere;
    }

    .rrp-studio-step .rrp-step-index {
        grid-row: 1 / span 2;
    }

    .rrp-studio-step .rrp-step-value {
        grid-column: 2;
    }

    .rrp-studio-step .rrp-step-value:empty {
        display: none;
    }

    .rrp-studio-edit {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto;
        height: auto;
        overflow: visible;
    }

    .rrp-studio-stage {
        grid-template-rows: auto auto;
    }

    .rrp-studio-canvas {
        height: clamp(220px, 52svh, 520px);
    }

    .rrp-studio-actions {
        position: sticky;
        bottom: 0;
        z-index: 2;
        padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    }

    .rrp-studio-side {
        border-left: 0;
        border-top: 1px solid var(--rrp-line);
        overflow: visible;
    }

    .rrp-studio-assets {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* Na telefonie modal zajmuje caly ekran - w ramce 20 px studio bylo nie do obslugi. */
@media (max-width: 700px) {
    .rrp-modal {
        padding: 0;
        height: 100dvh;
    }

    .rrp-modal-box,
    .rrp-modal.is-wide .rrp-modal-box {
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
    }

    .rrp-studio-steps {
        padding: 10px 12px;
    }

    .rrp-studio-actions {
        padding: 10px 12px max(12px, env(safe-area-inset-bottom, 0px));
    }

    .rrp-studio-note {
        font-size: 12px;
    }
}

/* Na telefonie pasek narzedzi zjadal cale pierwsze ekrany - kompaktujemy go. */
@media (max-width: 700px) {
    .rrp-topbar {
        gap: 8px;
        padding: 8px 12px;
    }

    .rrp-brand {
        flex: 1 1 100%;
        gap: 8px;
    }

    .rrp-brand strong {
        display: none;
    }

    .rrp-name {
        flex: 1;
        min-width: 0;
        padding: 5px 8px;
        font-size: 13px;
    }

    .rrp-topbar-actions {
        flex: 1 1 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    /* Akcje wydruku sa w panelu "Wybrany wydruk" - w pasku zostaja tylko projekty. */
    .rrp-topbar-actions [data-action="edit-item"],
    .rrp-topbar-actions [data-action="duplicate-item"],
    .rrp-topbar-actions [data-action="remove-item"],
    .rrp-topbar-actions [data-action="align"] {
        display: none;
    }

    .rrp-topbar-actions .rrp-btn {
        justify-content: center;
        padding: 5px 3px;
        font-size: 10px;
        line-height: 1.15;
        text-align: center;
    }

    .rrp-topbar-sep {
        display: none;
    }

    .rrp-stage-info {
        font-size: 13px;
    }

    .rrp-layout {
        gap: 10px;
        padding: 10px;
    }

    .rrp-sidebar,
    .rrp-summary {
        max-height: none;
        padding: 10px;
    }

    .rrp-canvas {
        min-height: 300px;
        padding: 8px;
    }
}

/* ------------------------------------------------- strona z konfiguratorem */

.rrp-page {
    max-width: none;
    width: 100%;
    margin: 0 auto;
    color: var(--rrp-ink);
    line-height: 1.65;
}

/* Planner potrzebuje calej szerokosci okna, nawet gdy motyw zweza tresc strony. */
.rrp-page .rrp-app {
    /* Caly planner musi miescic sie w ekranie - inaczej scena wychodzi poza widok. */
    height: min(80vh, 820px);
    min-height: 480px;
    /* Uchwyt w prawym dolnym rogu - uzytkownik moze powiekszyc scene. */
    resize: vertical;
    margin: 24px calc(50% - 50vw) 36px;
    max-width: none;
    border: 1px solid var(--rrp-line);
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    overflow: hidden;
}

@media (max-width: 1200px) {
    .rrp-page .rrp-app {
        height: auto;
        min-height: 0;
        resize: none;
    }
}

@media (max-width: 1100px) {
    .rrp-layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto;
    }

    .rrp-sidebar,
    .rrp-summary {
        min-width: 0;
        max-height: none;
        overflow: visible;
        overflow-wrap: anywhere;
    }

    .rrp-canvas {
        flex: none;
        height: 420px;
        min-height: 0;
    }
}

.rrp-page > *:not(.rrp-app) {
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
}

.rrp-page-title {
    margin: 0 0 16px;
    font-size: 34px;
    line-height: 1.2;
    color: var(--rrp-accent);
}

.rrp-page h2 {
    margin: 36px 0 12px;
    font-size: 26px;
    line-height: 1.25;
    color: var(--rrp-accent);
}
.rrp-page h3 {
    margin: 0 0 8px;
    font-size: 17px;
    color: var(--rrp-accent);
}

.rrp-page p {
    margin: 0 0 14px;
}

.rrp-page-lead {
    font-size: 18px;
    line-height: 1.6;
    padding-left: 14px;
    border-left: 4px solid var(--rrp-rose);
}

.rrp-page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.rrp-page-card {
    padding: 18px;
    border: 1px solid var(--rrp-line);
    border-top: 3px solid var(--rrp-rose);
    border-radius: 10px;
    background: #fff;
}

.rrp-page-card p:last-child {
    margin-bottom: 0;
}

.rrp-page-steps,
.rrp-page-list {
    margin: 0 0 14px;
    padding-left: 22px;
}

.rrp-page-steps li,
.rrp-page-list li {
    margin-bottom: 8px;
}

.rrp-page-steps li::marker {
    color: var(--rrp-rose);
    font-weight: 700;
}

.rrp-faq h3 {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--rrp-line);
}

.rrp-faq h3:first-child {
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
}
