.p2p-calendar-builder {
    width: min(1180px, calc(100% - 32px));
    margin: 36px auto 72px;
    color: #10233f;
}

.p2p-calendar-product .product_title,
.p2p-calendar-product .wp-block-post-title,
.p2p-calendar-product .wp-block-woocommerce-product-title,
.p2p-calendar-product .product_meta,
.p2p-calendar-product .woocommerce-product-details__short-description,
.p2p-calendar-product .wp-block-woocommerce-product-meta {
    display: none !important;
}

.p2p-calendar-intro {
    max-width: 720px;
    margin: 0 auto 28px;
    text-align: center;
}

.p2p-calendar-intro span {
    display: block;
    margin-bottom: 8px;
    color: #0878bc;
    font-weight: 700;
}

.p2p-calendar-intro h1 {
    margin: 0;
    color: #10233f;
    font-size: clamp(32px, 5vw, 54px);
    line-height: 1.04;
    letter-spacing: 0;
}

.p2p-calendar-intro p {
    max-width: 600px;
    margin: 14px auto 0;
    color: #4d6076;
    font-size: 18px;
    line-height: 1.5;
}

.p2p-calendar-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    gap: clamp(24px, 4vw, 54px);
    align-items: start;
}

.p2p-calendar-preview-column {
    min-width: 0;
}

.p2p-calendar-stage-shell {
    position: relative;
    width: min(100%, 620px);
    margin: 0 auto;
}

.p2p-calendar-stage {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #eef7fb;
    border: 1px solid #d3e3ee;
    box-shadow: 0 14px 34px rgba(26, 66, 97, 0.12);
}

.p2p-calendar-stage canvas {
    display: block;
    width: 100%;
    height: auto;
    touch-action: none;
    cursor: grab;
}

.p2p-calendar-stage canvas.is-dragging {
    cursor: grabbing;
}

.p2p-calendar-stage-message {
    position: absolute;
    right: 18px;
    bottom: 18px;
    left: 18px;
    margin: 0;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.94);
    color: #173252;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
}

.p2p-calendar-stage-arrow {
    position: absolute;
    z-index: 2;
    top: 50%;
    width: 50px;
    height: 50px;
    padding: 0;
    border: 1px solid #bad9e9;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 6px 16px rgba(26, 66, 97, 0.16);
    color: #0878bc;
    font-size: 31px;
    font-weight: 700;
    line-height: 1;
    transform: translateY(-50%);
}

.p2p-calendar-stage-arrow:hover,
.p2p-calendar-stage-arrow:focus-visible {
    border-color: #0878bc;
    background: #e9f7ff;
}

.p2p-calendar-stage-arrow:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.p2p-calendar-stage-arrow-previous {
    left: -66px;
}

.p2p-calendar-stage-arrow-next {
    right: -66px;
}

.p2p-calendar-template-status {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    width: min(100%, 620px);
    margin: 14px auto 0;
    color: #173252;
    text-align: center;
}

.p2p-calendar-template-status strong {
    overflow: hidden;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.p2p-calendar-template-status span {
    flex: 0 0 auto;
    color: #62758a;
    font-size: 13px;
    font-weight: 700;
}

.p2p-calendar-controls {
    border-top: 3px solid #ef7657;
    border-bottom: 1px solid #d8e5ee;
}

.p2p-calendar-step {
    padding: 20px 0;
    border-bottom: 1px solid #d8e5ee;
}

.p2p-calendar-step-title {
    margin: 0 0 12px;
    color: #10233f;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.25;
}

.p2p-calendar-format-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.p2p-calendar-format-options button {
    min-height: 80px;
    padding: 12px;
    border: 1px solid #c6dcea;
    border-radius: 6px;
    background: #fff;
    color: #10233f;
    text-align: left;
}

.p2p-calendar-format-options button.is-selected {
    border-color: #0878bc;
    box-shadow: inset 0 0 0 1px #0878bc;
    background: #eaf7ff;
}

.p2p-calendar-format-options strong,
.p2p-calendar-format-options span {
    display: block;
}

.p2p-calendar-format-options strong {
    margin-bottom: 5px;
    font-size: 16px;
}

.p2p-calendar-format-options span {
    color: #0878bc;
    font-size: 17px;
    font-weight: 800;
}

.p2p-calendar-upload {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 62px;
    padding: 12px 18px;
    border: 1px dashed #80b9d7;
    border-radius: 6px;
    background: #f6fbfe;
    color: #0878bc;
    font-weight: 800;
    text-align: center;
    cursor: pointer;
}

.p2p-calendar-upload input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.p2p-calendar-photo-status,
.p2p-calendar-crop-tools p:not(.p2p-calendar-step-title) {
    margin: 9px 0 0;
    color: #62758a;
    font-size: 14px;
    line-height: 1.45;
}

.p2p-calendar-crop-tools label {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
    color: #173252;
    font-weight: 700;
}

.p2p-calendar-crop-tools input[type="range"] {
    width: 100%;
    accent-color: #0878bc;
}

.p2p-calendar-crop-tools button {
    min-height: 42px;
    padding: 8px 14px;
    border: 1px solid #c6dcea;
    border-radius: 5px;
    background: #fff;
    color: #0878bc;
    font-weight: 700;
}

.p2p-calendar-editor-slot:empty {
    display: none;
}

.p2p-calendar-scale-control output {
    min-width: 48px;
    color: #075d94;
    font-size: 14px;
    font-weight: 800;
    text-align: right;
}

.p2p-calendar-crop-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.p2p-calendar-crop-actions .p2p-calendar-icon-button {
    width: 42px;
    min-width: 42px;
    padding: 0;
    font-size: 22px;
    line-height: 1;
}

.p2p-calendar-nudge-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #d8e5ee;
}

.p2p-calendar-nudge-controls > span {
    color: #173252;
    font-size: 14px;
    font-weight: 800;
}

.p2p-calendar-nudge-pad {
    display: grid;
    grid-template-columns: repeat(3, 42px);
    grid-template-areas:
        ". up ."
        "left down right";
    gap: 5px;
}

.p2p-calendar-nudge-pad button {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    font-size: 20px;
    line-height: 1;
}

.p2p-calendar-nudge-pad [data-calendar-nudge="up"] { grid-area: up; }
.p2p-calendar-nudge-pad [data-calendar-nudge="left"] { grid-area: left; }
.p2p-calendar-nudge-pad [data-calendar-nudge="down"] { grid-area: down; }
.p2p-calendar-nudge-pad [data-calendar-nudge="right"] { grid-area: right; }

@media (min-width: 761px) {
    .p2p-calendar-editor-slot-desktop .p2p-calendar-crop-tools {
        width: min(100%, 620px);
        margin: 18px auto 0;
        padding: 16px;
        border: 1px solid #d8e5ee;
        border-radius: 6px;
        background: #fff;
        box-shadow: 0 8px 20px rgba(26, 66, 97, 0.08);
    }
}

@media (min-width: 761px) and (max-width: 1020px) {
    .p2p-calendar-stage-arrow-previous {
        left: 10px;
    }

    .p2p-calendar-stage-arrow-next {
        right: 10px;
    }

    .p2p-calendar-stage-arrow {
        background: rgba(255, 255, 255, 0.94);
    }
}

.p2p-calendar-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 12px;
    padding: 20px 0;
    color: #10233f;
}

.p2p-calendar-summary strong,
.p2p-calendar-summary span {
    font-size: 20px;
}

.p2p-calendar-summary span {
    color: #0878bc;
    font-weight: 800;
}

.p2p-calendar-summary small {
    grid-column: 1 / -1;
    color: #62758a;
    font-size: 14px;
}

.p2p-calendar-cart-button {
    display: block;
    width: 100%;
    min-height: 58px;
    padding: 12px 20px;
    border: 0;
    border-radius: 6px;
    background: #0878bc;
    color: #fff;
    font-size: 18px;
    font-weight: 800;
}

.p2p-calendar-cart-button:hover,
.p2p-calendar-cart-button:focus-visible {
    background: #06669f;
}

.p2p-calendar-cart-button:disabled {
    background: #9ab6c7;
    cursor: not-allowed;
}

.p2p-calendar-cart-status {
    min-height: 22px;
    margin: 10px 0 0;
    color: #36536f;
    font-size: 14px;
    line-height: 1.4;
}

.p2p-calendar-unavailable {
    width: min(720px, calc(100% - 32px));
    margin: 48px auto;
    padding: 24px;
    border-left: 4px solid #ef7657;
    background: #fff;
    color: #10233f;
}

@media (max-width: 760px) {
    .p2p-calendar-builder {
        width: min(100% - 24px, 560px);
        margin: 18px auto 46px;
    }

    .p2p-calendar-intro {
        margin-bottom: 20px;
        text-align: left;
    }

    .p2p-calendar-intro h1 {
        font-size: 34px;
    }

    .p2p-calendar-intro p {
        margin-left: 0;
        font-size: 16px;
    }

    .p2p-calendar-layout {
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .p2p-calendar-preview-column {
        width: 100%;
    }

    .p2p-calendar-stage-shell {
        width: 100%;
    }

    .p2p-calendar-stage {
        width: 100%;
    }

    .p2p-calendar-stage-arrow {
        width: 44px;
        height: 44px;
        background: rgba(255, 255, 255, 0.94);
        font-size: 27px;
    }

    .p2p-calendar-stage-arrow-previous {
        left: 10px;
    }

    .p2p-calendar-stage-arrow-next {
        right: 10px;
    }

    .p2p-calendar-template-status {
        margin-top: 12px;
    }

    .p2p-calendar-template-status strong {
        font-size: 15px;
    }

    .p2p-calendar-controls {
        width: 100%;
    }

    .p2p-calendar-format-options {
        grid-template-columns: 1fr;
    }

    .p2p-calendar-format-options button {
        min-height: 68px;
    }

}

.p2p-calendar-source-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.p2p-calendar-source-tabs button {
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid #c6dcea;
    border-radius: 5px;
    background: #fff;
    color: #173252;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
}

.p2p-calendar-source-tabs button.is-selected {
    border-color: #0878bc;
    box-shadow: inset 0 0 0 1px #0878bc;
    background: #eaf7ff;
    color: #075d94;
}

.p2p-calendar-source-panel {
    min-width: 0;
}

.p2p-calendar-source-intro {
    margin: 0 0 12px;
    color: #4d6076;
    font-size: 14px;
    line-height: 1.45;
}

.p2p-calendar-source-search {
    display: grid;
    gap: 6px;
    margin: 0 0 12px;
    color: #173252;
    font-size: 14px;
    font-weight: 700;
}

.p2p-calendar-source-search input {
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid #c6dcea;
    border-radius: 5px;
    color: #10233f;
    font: inherit;
}

.p2p-calendar-source-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-height: 450px;
    overflow-y: auto;
    padding: 2px;
}

.p2p-calendar-source-card {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 7px;
    border: 1px solid #c6dcea;
    border-radius: 6px;
    background: #fff;
    color: #10233f;
    text-align: left;
}

.p2p-calendar-source-card:hover,
.p2p-calendar-source-card:focus-visible,
.p2p-calendar-source-card.is-selected {
    border-color: #0878bc;
    box-shadow: inset 0 0 0 1px #0878bc;
    background: #eaf7ff;
}

.p2p-calendar-source-card-preview {
    position: relative;
    overflow: hidden;
    border-radius: 3px;
    background: #f4f7fa;
}

.p2p-calendar-source-card-preview img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
}

.p2p-calendar-source-card--creator .p2p-calendar-source-card-preview::before {
    content: '';
    position: absolute;
    z-index: 1;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 42%),
        repeating-linear-gradient(-28deg, rgba(255, 255, 255, .18) 0 2px, rgba(255, 255, 255, 0) 2px 20px);
    pointer-events: none;
}

.p2p-calendar-source-card-watermark {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(-18deg);
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .78);
    color: #0078bf;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
    pointer-events: none;
    white-space: nowrap;
}

.p2p-calendar-source-card strong,
.p2p-calendar-source-card span,
.p2p-calendar-source-card small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.p2p-calendar-source-card strong {
    font-size: 14px;
    line-height: 1.25;
    white-space: nowrap;
}

.p2p-calendar-source-card-creator,
.p2p-calendar-source-card small {
    color: #4d6076;
    font-size: 12px;
    line-height: 1.3;
}

.p2p-calendar-source-card small {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.p2p-calendar-source-empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 14px;
    border: 1px dashed #c6dcea;
    color: #4d6076;
    font-size: 14px;
    line-height: 1.45;
}

.p2p-calendar-source-empty a {
    color: #0878bc;
    font-weight: 800;
}

.p2p-calendar-crop-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 420px) {
    .p2p-calendar-source-tabs {
        grid-template-columns: 1fr;
    }
}
