/* ============================================================
   AP SYNAPSE CANVAS — MAKE BEAUTIFUL V1
   ============================================================ */

#apCanvasMakeBeautiful {
    appearance: none;
    border: 1px solid rgba(224, 180, 82, 0.44);
    border-radius: 12px;
    background:
        linear-gradient(
            135deg,
            rgba(237, 196, 98, 0.19),
            rgba(151, 108, 35, 0.11)
        );
    color: #f3d58f;
    min-height: 38px;
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.015em;
    cursor: pointer;
    white-space: nowrap;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.06),
        0 8px 28px rgba(196, 145, 43, .08);
    transition:
        transform .18s ease,
        border-color .18s ease,
        background .18s ease,
        box-shadow .18s ease;
}

#apCanvasMakeBeautiful:hover {
    transform: translateY(-1px);
    border-color: rgba(240, 198, 97, .74);
    background:
        linear-gradient(
            135deg,
            rgba(237, 196, 98, .27),
            rgba(151, 108, 35, .15)
        );
    box-shadow:
        0 10px 32px rgba(211, 161, 55, .13);
}

#apCanvasMakeBeautiful:active {
    transform: translateY(0);
}

#apCanvasMakeBeautiful .ap-cmb-spark {
    color: #efc96f;
    filter: drop-shadow(
        0 0 8px rgba(239,201,111,.32)
    );
}

#apCanvasMakeBeautiful.ap-cmb-floating {
    position: absolute;
    top: 76px;
    right: 24px;
    z-index: 24;
}

.ap-cmb-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        rgba(4, 5, 7, .76);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    animation:
        ap-cmb-fade-in .18s ease both;
}

.ap-cmb-panel {
    width: min(760px, 94vw);
    max-height: min(780px, 90vh);
    overflow: auto;
    border-radius: 24px;
    border: 1px solid rgba(217, 174, 82, .24);
    background:
        radial-gradient(
            circle at 85% 0%,
            rgba(204, 155, 54, .12),
            transparent 33%
        ),
        linear-gradient(
            160deg,
            rgba(20, 20, 21, .985),
            rgba(9, 10, 12, .992)
        );
    box-shadow:
        0 32px 120px rgba(0,0,0,.58),
        inset 0 1px 0 rgba(255,255,255,.055);
    color: rgba(255,255,255,.92);
}

.ap-cmb-header {
    padding: 24px 24px 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    border-bottom:
        1px solid rgba(255,255,255,.065);
}

.ap-cmb-eyebrow {
    margin: 0 0 7px;
    color: #d9b66a;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.ap-cmb-title {
    margin: 0;
    color: #fff;
    font-size: clamp(21px, 3vw, 30px);
    font-weight: 720;
    letter-spacing: -.025em;
}

.ap-cmb-subtitle {
    margin: 8px 0 0;
    max-width: 590px;
    color: rgba(255,255,255,.54);
    font-size: 13px;
    line-height: 1.55;
}

.ap-cmb-close {
    appearance: none;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 11px;
    border: 1px solid rgba(255,255,255,.09);
    background: rgba(255,255,255,.045);
    color: rgba(255,255,255,.72);
    font-size: 21px;
    cursor: pointer;
}

.ap-cmb-body {
    padding: 22px 24px 24px;
}

.ap-cmb-label {
    display: block;
    margin: 0 0 9px;
    color: rgba(255,255,255,.68);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
}

.ap-cmb-styles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.ap-cmb-style {
    appearance: none;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 999px;
    background: rgba(255,255,255,.035);
    color: rgba(255,255,255,.62);
    min-height: 34px;
    padding: 0 13px;
    font: inherit;
    font-size: 11px;
    font-weight: 650;
    cursor: pointer;
    transition:
        border-color .16s ease,
        color .16s ease,
        background .16s ease;
}

.ap-cmb-style:hover {
    color: rgba(255,255,255,.88);
    border-color: rgba(255,255,255,.17);
}

.ap-cmb-style.is-active {
    color: #f3d58f;
    border-color: rgba(225, 180, 80, .48);
    background: rgba(211, 162, 61, .11);
}

.ap-cmb-prompt {
    width: 100%;
    min-height: 94px;
    resize: vertical;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 15px;
    outline: none;
    padding: 14px 15px;
    background: rgba(255,255,255,.035);
    color: rgba(255,255,255,.92);
    font: inherit;
    font-size: 13px;
    line-height: 1.5;
    transition:
        border-color .16s ease,
        box-shadow .16s ease;
}

.ap-cmb-prompt::placeholder {
    color: rgba(255,255,255,.31);
}

.ap-cmb-prompt:focus {
    border-color: rgba(225, 180, 80, .42);
    box-shadow:
        0 0 0 3px rgba(211, 162, 61, .07);
}

.ap-cmb-actions {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    flex-wrap: wrap;
}

.ap-cmb-btn {
    appearance: none;
    min-height: 40px;
    border-radius: 12px;
    padding: 0 16px;
    border: 1px solid rgba(255,255,255,.09);
    background: rgba(255,255,255,.04);
    color: rgba(255,255,255,.76);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.ap-cmb-btn.primary {
    border-color: rgba(229, 186, 91, .58);
    background:
        linear-gradient(
            135deg,
            #e5bc63,
            #b9822d
        );
    color: #15110a;
    box-shadow:
        0 9px 32px rgba(206, 153, 47, .18);
}

.ap-cmb-btn:disabled {
    opacity: .5;
    cursor: wait;
}

.ap-cmb-progress {
    display: none;
    margin-top: 18px;
    border-radius: 15px;
    padding: 15px;
    border: 1px solid rgba(229,186,91,.13);
    background: rgba(214,166,61,.045);
}

.ap-cmb-progress.is-visible {
    display: block;
}

.ap-cmb-progress-title {
    color: #efd08d;
    font-size: 12px;
    font-weight: 750;
}

.ap-cmb-progress-sub {
    margin-top: 5px;
    color: rgba(255,255,255,.43);
    font-size: 11px;
}

.ap-cmb-shimmer {
    height: 3px;
    margin-top: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.06);
}

.ap-cmb-shimmer::after {
    content: "";
    display: block;
    width: 32%;
    height: 100%;
    border-radius: inherit;
    background:
        linear-gradient(
            90deg,
            transparent,
            #e9bd5d,
            transparent
        );
    animation:
        ap-cmb-loading 1.15s ease-in-out infinite;
}

.ap-cmb-result-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);
    gap: 14px;
    margin-top: 18px;
}

.ap-cmb-preview-card {
    min-width: 0;
    border-radius: 17px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.075);
    background: rgba(0,0,0,.24);
}

.ap-cmb-preview-head {
    min-height: 38px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: rgba(255,255,255,.56);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.ap-cmb-preview-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background:
        linear-gradient(
            45deg,
            #111 25%,
            #151515 25%,
            #151515 50%,
            #111 50%,
            #111 75%,
            #151515 75%
        );
    background-size: 18px 18px;
}

.ap-cmb-error {
    display: none;
    margin-top: 15px;
    color: #ffb5b5;
    border: 1px solid rgba(255, 85, 85, .17);
    background: rgba(255, 65, 65, .055);
    border-radius: 12px;
    padding: 11px 13px;
    font-size: 11px;
    line-height: 1.45;
}

.ap-cmb-error.is-visible {
    display: block;
}

@keyframes ap-cmb-loading {
    from {
        transform: translateX(-120%);
    }
    to {
        transform: translateX(330%);
    }
}

@keyframes ap-cmb-fade-in {
    from {
        opacity: 0;
        transform: scale(.995);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 720px) {
    #apCanvasMakeBeautiful {
        min-height: 34px;
        padding: 0 11px;
        font-size: 10px;
    }

    #apCanvasMakeBeautiful.ap-cmb-floating {
        top: 66px;
        right: 12px;
    }

    .ap-cmb-overlay {
        padding: 10px;
    }

    .ap-cmb-panel {
        border-radius: 19px;
        width: min(100%, 94vw);
        max-height: 92vh;
    }

    .ap-cmb-header,
    .ap-cmb-body {
        padding-left: 17px;
        padding-right: 17px;
    }

    .ap-cmb-result-grid {
        grid-template-columns: 1fr;
    }
}
/* AP_CANVAS_RESULT_VISIBILITY_FIX_V13 */
.ap-cmb-result-grid[hidden] {
    display: none !important;
}
/* ============================================================
   AP_CANVAS_VISIBLE_BUTTON_V171
   Always-visible premium Canvas AI action.
   ============================================================ */

#canvasPage #apCanvasMakeBeautiful.ap-cmb-visible-action {
    position: absolute !important;
    z-index: 120 !important;

    width: auto !important;
    min-width: 160px !important;
    height: 44px !important;
    min-height: 44px !important;

    padding: 0 18px !important;
    margin: 0 !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;

    flex: 0 0 auto !important;
    overflow: visible !important;

    border:
        1px solid
        rgba(255, 220, 136, .78) !important;

    border-radius: 14px !important;

    background:
        linear-gradient(
            135deg,
            #f2cc72 0%,
            #dda947 58%,
            #c4862e 100%
        ) !important;

    color: #171107 !important;

    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    letter-spacing: .012em !important;
    white-space: nowrap !important;

    box-shadow:
        0 16px 42px rgba(0,0,0,.30),
        0 6px 22px rgba(216,162,57,.26),
        inset 0 1px 0 rgba(255,255,255,.36) !important;

    cursor: pointer !important;

    transform: translateZ(0);
    transition:
        transform .18s ease,
        filter .18s ease,
        box-shadow .18s ease !important;
}

#canvasPage #apCanvasMakeBeautiful.ap-cmb-visible-action:hover {
    transform:
        translateY(-2px)
        translateZ(0) !important;

    filter:
        brightness(1.06);

    box-shadow:
        0 19px 48px rgba(0,0,0,.34),
        0 8px 26px rgba(216,162,57,.32),
        inset 0 1px 0 rgba(255,255,255,.42) !important;
}

#canvasPage #apCanvasMakeBeautiful.ap-cmb-visible-action:active {
    transform:
        translateY(0)
        translateZ(0) !important;
}

#canvasPage #apCanvasMakeBeautiful.ap-cmb-visible-action .ap-cmb-spark {
    color: #211708 !important;
    font-size: 15px !important;
    filter: none !important;
}

@media (max-width: 720px) {
    #canvasPage #apCanvasMakeBeautiful.ap-cmb-visible-action {
        min-width: 136px !important;
        height: 40px !important;
        min-height: 40px !important;
        padding: 0 13px !important;
        border-radius: 12px !important;
        font-size: 10.5px !important;
    }

    #canvasPage #apCanvasMakeBeautiful.ap-cmb-visible-action .ap-cmb-spark {
        font-size: 13px !important;
    }
}