/* CW Winixu Affiliate Manager - public UI, intentionally scoped. */
.cwwa-unit,
.cwwa-unit * { box-sizing: border-box; }
.cwwa-unit {
    --cwwa-ink: #231f24;
    --cwwa-muted: #726a6d;
    --cwwa-border: #efdfdf;
    --cwwa-accent: #951f2b;
    margin: 27px 0;
    padding: 18px 21px;
    border: 1px solid var(--cwwa-border);
    border-radius: 17px;
    background: linear-gradient(128deg, #fff 0%, #fff9f8 100%);
    color: var(--cwwa-ink);
    box-shadow: 0 10px 32px rgba(70, 33, 87, .045);
    font: 400 15px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    width: 100%;
    max-width: 100%;
    clear: both;
}
.cwwa-disclosure {
    display: block;
    margin: 0 0 9px;
    color: #776b70;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .075em;
    line-height: 1.4;
    text-transform: uppercase;
}
.cwwa-unit-body { display: flex; gap: 18px; align-items: center; justify-content: space-between; }
.cwwa-unit-info { flex: 1 1 62%; min-width: 0; }
.cwwa-unit .cwwa-title {
    display: block;
    font-weight: 750;
    letter-spacing: -.024em;
    line-height: 1.3;
    font-size: 17px;
    color: #281b1f;
    margin-bottom: 5px;
}
.cwwa-unit .cwwa-description { display: block; line-height: 1.53; color: #6c6064; font-size: 13px; }
.cwwa-unit .cwwa-cta {
    display: inline-flex;
    flex: none;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 11px 15px;
    min-height: 43px;
    max-width: 270px;
    border-radius: 10px;
    background: #951f2b;
    color: #fff !important;
    font: 700 13px/1.28 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: center;
    text-decoration: none !important;
    border: 1px solid transparent;
    outline-offset: 3px;
    box-shadow: 0 7px 14px rgba(109, 40, 217, .13);
    transition: background .15s ease, transform .15s ease;
}
.cwwa-unit .cwwa-cta:visited { color: #fff !important; }
.cwwa-unit .cwwa-cta:hover { background: #741720; transform: translateY(-1px); }
.cwwa-unit .cwwa-cta:focus-visible { outline: 2px solid #951f2b; }
.cwwa-arrow { font-size: 17px; line-height: 1; }
.cwwa-unit--text { background: #fff8f7; padding: 11px 15px; border-radius: 11px; box-shadow: none; }
.cwwa-unit--text .cwwa-disclosure { margin-bottom: 5px; font-size: 9px; }
.cwwa-unit--text .cwwa-unit-body { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
.cwwa-unit--text .cwwa-unit-text { font-size: 13px; color: #625357; }
.cwwa-unit--text .cwwa-cta { display: inline; background: transparent; border: 0; box-shadow: none; color: #951f2b !important; padding: 0; min-height: 0; font-size: 13px; text-align: left; }
.cwwa-unit--text .cwwa-cta:visited { color: #951f2b !important; }
.cwwa-unit--text .cwwa-cta:hover { color: #741720 !important; background: transparent; text-decoration: underline !important; transform: none; }
.cwwa-unit--button { background: transparent; box-shadow: none; }
.cwwa-unit--sidebar .cwwa-unit-body { flex-direction: column; align-items: stretch; }
.cwwa-unit--sidebar .cwwa-cta { max-width: 100%; }
@media (max-width: 590px) {
    .cwwa-unit { margin: 21px 0; padding: 15px 16px; border-radius: 14px; }
    .cwwa-unit-body { flex-direction: column; align-items: stretch; gap: 12px; }
    .cwwa-unit .cwwa-title { font-size: 16px; }
    .cwwa-unit .cwwa-description { font-size: 13px; }
    .cwwa-unit .cwwa-cta { max-width: 100%; width: 100%; min-height: 44px; }
    .cwwa-unit--text .cwwa-unit-body { display: block; }
    .cwwa-unit--text .cwwa-cta { display: inline; width: auto; }
}
/* Optional mobile dock: not enabled by default. */
.cwwa-sticky { display: none; }
@media (max-width: 680px) {
    .cwwa-sticky:not([hidden]) {
        display: block;
        position: fixed;
        left: 9px;
        right: 9px;
        bottom: max(9px, env(safe-area-inset-bottom));
        z-index: 9998;
        box-shadow: 0 10px 38px rgba(21, 17, 38, .25);
        border-radius: 12px;
        background: #fff;
        padding-right: 25px;
        max-width: 680px;
    }
    .cwwa-sticky .cwwa-unit { margin: 0; border: 1px solid #ead9dd; }
    .cwwa-sticky .cwwa-disclosure { font-size: 9px; }
    .cwwa-sticky .cwwa-dismiss { position: absolute; right: 6px; top: 7px; border: 0; background: #f8ecee; color: #432b2f; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; width: 26px; height: 26px; z-index: 2; }
}
/* Nonmodal desktop promotion. External iframe stays unloaded until an explicit click. */
.cwwa-popover[hidden], .cwwa-sticky[hidden] { display: none !important; }
.cwwa-popover { display: none; }
@media (min-width: 900px) {
    .cwwa-popover:not([hidden]) {
        box-sizing: border-box;
        display: block;
        width: min(360px, calc(100vw - 34px));
        max-height: min(580px, calc(100vh - 42px));
        overflow: auto;
        position: fixed;
        right: 22px;
        bottom: 22px;
        z-index: 9999;
        border: 1px solid #efdfe2;
        border-radius: 18px;
        background: #fff;
        box-shadow: 0 20px 75px rgba(34, 20, 48, .18);
        font: 400 13px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }
    .cwwa-popup-top { display: flex; gap: 7px; align-items: center; color: #685c62; padding: 13px 15px 0; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
    .cwwa-popup-dot { width: 6px; height: 6px; border-radius: 50%; background: #af3644; flex: none; }
    .cwwa-popup-close { margin-left: auto; flex: none; border: 0; background: #f8ecee; color: #3b3153; display: grid; place-items: center; border-radius: 50%; width: 26px; height: 26px; font-size: 21px; cursor: pointer; }
    .cwwa-popover .cwwa-unit--popup { box-shadow: none; border: 0; border-radius: 0; background: #fff; margin: 0; padding: 14px 16px 17px; }
    .cwwa-popover .cwwa-unit--popup .cwwa-disclosure { display: none; }
    .cwwa-popover .cwwa-unit--popup .cwwa-unit-body { flex-direction: column; align-items: stretch; gap: 11px; }
    .cwwa-popover .cwwa-unit--popup .cwwa-title { font-size: 15px; }
    .cwwa-popover .cwwa-unit--popup .cwwa-cta { max-width: 100%; }
    .cwwa-preview { border-top: 1px solid #f0dfe1; padding: 12px 16px 16px; }
    .cwwa-preview p { margin: 0 0 10px; font-size: 12px; line-height: 1.4; color: #6c6064; }
    .cwwa-preview-button { cursor: pointer; display: block; padding: 9px 12px; background: #fff1f2; border: 1px solid #ecd4d8; border-radius: 9px; color: #951f2b; font: 700 12px system-ui, sans-serif; }
    .cwwa-preview iframe { display: block; margin-top: 10px; width: 100%; height: 220px; border: 0; background: #100b19; border-radius: 9px; }
}
@media (prefers-reduced-motion: reduce) {
    .cwwa-unit .cwwa-cta { transition: none; }
}

/* v1.1.0: placement into Winixu's custom category/search grids and homepage. */
.cwwa-archive-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    margin: 15px 0 24px;
    align-items: stretch;
}
.cwwa-archive-row .cwwa-unit { margin: 0; min-width: 0; }
.cwwa-archive-row .cwwa-unit .cwwa-unit-body { display: flex; align-items: baseline; }
.cwwa-archive-row .cwwa-unit .cwwa-unit-text { flex: 1; }
.cwwa-archive-row--home { max-width: 1160px; margin: 20px auto; }
@media (max-width: 640px) {
    .cwwa-archive-row { grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 10px 0 18px; }
    .cwwa-archive-row .cwwa-unit { padding: 13px 15px; }
}

/* v1.2.0 - stronger isolation from the Winixu FluentSnippets button rules. */
body .cwwa-popover.cwwa-popover {
    position: fixed !important;
    right: 22px !important;
    bottom: 22px !important;
    left: auto !important;
    top: auto !important;
    isolation: isolate;
}
body .cwwa-popover .cwwa-popup-top {
    position: relative !important;
    box-sizing: border-box !important;
    min-height: 48px;
    padding: 12px 53px 5px 16px !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px;
}
body .cwwa-popover .cwwa-popup-head-label { min-width: 0; font-size: 10px; line-height: 1.35; }
body .cwwa-popover .cwwa-popup-top > button.cwwa-popup-close {
    -webkit-appearance: none !important;
    appearance: none !important;
    all: unset;
    box-sizing: border-box !important;
    position: absolute !important;
    top: 8px !important;
    right: 10px !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    max-width: 34px !important;
    border: 1px solid #eadde0 !important;
    border-radius: 10px !important;
    background: #fbf1f2 !important;
    color: #542d34 !important;
    box-shadow: none !important;
    text-decoration: none !important;
    cursor: pointer !important;
    line-height: 1 !important;
    font: inherit !important;
    z-index: 4 !important;
}
body .cwwa-popover .cwwa-popup-top > button.cwwa-popup-close:hover { background: #f6dfe3 !important; }
body .cwwa-popover .cwwa-popup-top > button.cwwa-popup-close:focus-visible { outline: 3px solid #ad4050 !important; outline-offset: 2px !important; }
body .cwwa-popover .cwwa-popup-top > button.cwwa-popup-close svg { display:block !important; height: 16px !important; width: 16px !important; pointer-events:none; }
/* Allow the alternate placements to use the same editorial width and rhythm. */
.cwwa-unit[data-cwwa-slot] { overflow: visible; }
.cwwa-unit--html .cwwa-html-content { line-height: 1.6; font-size: 15px; }
.cwwa-unit--html .cwwa-html-content > :first-child { margin-top: 0; }
.cwwa-unit--html .cwwa-html-content > :last-child { margin-bottom: 0; }
.cwwa-unit--html .cwwa-html-content img { max-width:100%; height:auto; border-radius:10px; }
.cwwa-unit--html .cwwa-html-content a { color:#951f2b; text-underline-offset:3px; }
.cwwa-archive-row > .cwwa-unit--html { grid-column: auto; }
@media (max-width: 899px) {
  body .cwwa-popover.cwwa-popover { display: none !important; }
}
