/* =====================================================================
   Clipart Element Extractor — Elevated Printables Theme
   Scoped to .cee-body so nothing leaks into the WordPress theme.
   ===================================================================== */


/* === DESIGN TOKENS === */

    .cee-body {
        --clr-primary: #C08166;
        --clr-primary-hover: #C0816625;
        --clr-primary-light: #C0816610;
        --clr-accent: #C08166;
        --surface: #FFFFFF;
        --surface-2: #FFFFFF;
        --surface-3: #FFFFFF;
        --txt: #313F4B;
        --txt-2: #313F4B;
        --txt-muted: #313F4B;
        --txt-subtle: #313F4B;
        --txt-primary: #313F4B;
        --border: #DDCEBA50;
        --radius: 0.5rem;
        --radius-md: 0.625rem;
        --radius-lg: 0.75rem;
        --radius-full: 9999px;
        --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
        --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
        --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.07), 0 4px 6px rgba(0, 0, 0, 0.04);
        --t: 160ms ease;
        --z-toast: 500;
    }


/* === BASE WRAPPER === */

    .cee-body {
        --paper: #FFFFFF;
        --card: #FFFFFF;
        --ink: var(--txt);
        --ink-soft: var(--txt-muted);
        --ink-faint: var(--txt-subtle);
        --sage-deep: #313F4B;
        --sage: var(--txt-primary);
        --sage-mid: var(--clr-primary-light);
        --sage-soft: var(--clr-primary-light);
        --sage-wash: #DDCEBA10;
        --line: #DDCEBA50;
        --line-strong: #DDCEBA;
        --clay: var(--clr-accent);
        --shadow: 0 1px 2px rgba(43, 45, 38, .05), 0 8px 24px rgba(43, 45, 38, .07);
        --radius: 14px;
        color: var(--txt);
        font-family: 'Poppins';
        font-size: 16px;
        line-height: 1.5;
        -webkit-font-smoothing: antialiased;
        border-radius: 12px;
        background: var(--surface-3);
        padding: 8px 0 24px;
    }

    .cee-body * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }

    .cee-wrap {
        max-width: 1400px;
        margin: 0 auto;
        padding: 28px 24px 64px;
    }


/* === DROP ZONE === */

    .cee-body .drop {
        background: var(--surface-2);
        border: 2px dashed var(--clr-primary);
        border-radius: var(--radius);
        padding: 52px 28px;
        text-align: center;
        cursor: pointer;
        transition: .18s ease;
        box-shadow: var(--shadow);
    }

    .cee-body .drop:hover {
        border-color: var(--clr-primary-hover);
        background: #fff;
    }

    .cee-body .drop.over {
        border-color: var(--clr-accent);
        background: var(--clr-primary-light);
        transform: scale(.997);
    }

    .cee-body .drop .ic {
        width: 62px;
        height: 62px;
        border-radius: 50%;
        margin: 0 auto 16px;
        background: var(--clr-primary-light);
        display: grid;
        place-items: center;
    }

    .cee-body .drop .ic svg {
        width: 30px;
        height: 30px;
    }

    .cee-body .drop h2 {
        font-family: 'Poppins';
        font-weight: 500;
        font-size: 21px;
        margin-bottom: 5px;
    }

    .cee-body .drop p {
        color: #313F4B;
        font-size: 16px;
    }

    .cee-body .drop .formats {
        margin-top: 14px;
        font-size: 16px;
        color: var(--txt-muted);
        letter-spacing: .05em;
    }


/* === WORKSPACE GRID (preview left, controls right) === */

    .cee-body .workspace {
        display: none;
        gap: 30px;
        grid-template-columns: minmax(0, 1fr) 380px;
        align-items: start;
    }

    .cee-body .stage-main {
        min-width: 0;
    }

    /* sticky side rail so controls stay visible while scrolling results */
    .cee-body .stage-side {
        position: sticky;
        top: 14px;
        align-self: start;
    }

    .cee-body .panel.controls {
        display: flex;
        flex-direction: column;
        max-height: calc(100vh - 28px);
    }

    .cee-body .panel.controls .panel-h {
        flex: none;
    }

    .cee-body .panel.controls .panel-b {
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    /* hide the explanatory hints to compact the rail */
    .cee-body .panel.controls.no-tips .hint {
        display: none;
    }

    .cee-body .panel.controls.no-tips .ctl {
        margin-bottom: 11px;
    }

    @media (max-width: 840px) {
        .cee-body .workspace {
            grid-template-columns: 1fr;
        }

        .cee-body .stage-side {
            position: static;
        }

        .cee-body .panel.controls {
            max-height: none;
        }

        .cee-body .panel.controls .panel-b {
            overflow: visible;
        }
    }


/* === PANELS (shared card style) === */

    .cee-body .panel {
        background: var(--surface-2);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
    }

    .cee-body .panel-h {
        padding: 13px 18px;
        border-bottom: 1px solid var(--border);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .cee-body .panel-h .t {
        font-family: 'Poppins';
        font-weight: 500;
        font-size: 18px;
    }

    .cee-body .panel-b {
        padding: 18px;
    }


/* === PREVIEW AREA === */

    .cee-body .preview-size,
    .cee-body .elem-size {
        display: flex;
        align-items: center;
        gap: 11px;
        margin-bottom: 12px;
    }

    .cee-body .ps-label {
        font-size: 16px;
        font-weight: 600;
        color: #313F4B;
        white-space: nowrap;
    }

    .cee-body .ps-val {
        font-size: 16px;
        font-weight: 600;
        color: #313F4B;
        font-variant-numeric: tabular-nums;
        min-width: 46px;
        text-align: right;
    }

    .cee-body .preview-wrap {
        position: relative;
        background: var(--clr-primary-light);
        border-radius: 10px;
        padding: 14px;
        min-height: 220px;
        overflow: auto;
        max-height: 76vh;
    }

    .cee-body #cee-previewCanvas {
        border-radius: 6px;
        display: block;
        margin: 0 auto;
        box-shadow: 0 2px 10px rgba(0, 0, 0, .1);
    }

    .cee-body #cee-previewCanvas.picking {
        cursor: crosshair;
    }

    .cee-body .stat {
        display: flex;
        gap: 18px;
        flex-wrap: wrap;
        margin-top: 14px;
        font-size: 16px;
        color: #313F4B;
    }

    .cee-body .stat b {
        color: #313F4B;
        font-weight: 600;
    }

    .cee-body .stat .sep {
        color: var(--border);
    }


/* === SLIDER CONTROLS === */

    .cee-body .ctl {
        margin-bottom: 17px;
    }

    .cee-body .ctl:last-child {
        margin-bottom: 4px;
    }

    .cee-body .ctl-top {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        margin-bottom: 7px;
    }

    .cee-body .ctl label {
        font-size: 16px;
        font-weight: 600;
        letter-spacing: .01em;
    }

    .cee-body .ctl .val {
        font-size: 16px;
        color: #313F4B;
        font-weight: 600;
        font-variant-numeric: tabular-nums;
    }

    .cee-body .ctl .hint {
        font-size: 16px;
        color: var(--txt-muted);
        margin-top: 5px;
        line-height: 1.45;
    }

    .cee-body input[type=range] {
        -webkit-appearance: none;
        appearance: none;
        width: 100%;
        height: 4px;
        border-radius: 3px;
        background: var(--clr-primary-light);
        outline: none;
        flex: 1;
    }

    .cee-body input[type=range]::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 17px;
        height: 17px;
        border-radius: 50%;
        background: var(--clr-primary);
        border: 3px solid var(--surface-2);
        cursor: pointer;
        box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
    }

    .cee-body input[type=range]::-moz-range-thumb {
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background: var(--clr-primary);
        border: 3px solid var(--surface-2);
        cursor: pointer;
    }

    .cee-body .ctl .chkrow {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 16px;
        cursor: pointer;
        user-select: none;
        margin: 2px 0 4px;
    }

    .cee-body .ctl .chkrow input {
        accent-color: #DDCEBA25;
        width: 16px;
        height: 16px;
        cursor: pointer;
    }


/* === BACKGROUND PICKER ROW === */

    .cee-body .bgrow {
        display: flex;
        align-items: center;
        gap: 9px;
    }

    .cee-body .swatch {
        width: 30px;
        height: 30px;
        border-radius: 8px;
        border: 1px solid var(--border);
        flex: none;
    }

    .cee-body .pickbtn {
        font-family: inherit;
        font-size: 16px;
        font-weight: 600;
        padding: 7px 11px;
        border-radius: 8px;
        border: 1px solid var(--border);
        background: #fff;
        color: #313F4B;
        cursor: pointer;
        transition: .15s;
    }

    .cee-body .pickbtn:hover {
        border-color: var(--clr-primary);
        color: var(--clr-primary);
    }

    .cee-body .pickbtn.active {
        background: var(--clr-primary);
        color: #fff;
        border-color: var(--clr-primary);
    }

    .cee-body .bgrow .name {
        font-size: 16px;
        color: #313F4B70;
    }

    .cee-body .divider {
        height: 1px;
        background: var(--border);
        margin: 4px 0 16px;
    }


/* === BUTTONS === */

    .cee-body .btn {
        font-family: inherit;
        font-weight: 600;
        font-size: 16px;
        border-radius: 10px;
        cursor: pointer;
        border: 1px solid transparent;
        padding: 11px 16px;
        transition: .15s ease;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
    }

    .cee-body .btn svg {
        width: 16px;
        height: 16px;
    }

    .cee-body .btn-primary {
        background: var(--clr-primary);
        color: #fff;
    }

    .cee-body .btn-primary:hover {
        background: var(--clr-primary-hover);
    }

    .cee-body .btn-primary:disabled {
        opacity: .45;
        cursor: not-allowed;
    }

    .cee-body .btn-ghost {
        background: #fff;
        border-color: var(--border);
        color: #313F4B;
    }

    .cee-body .btn-ghost:hover {
        border-color: var(--clr-primary);
        color: var(--clr-primary);
    }

    .cee-body .topbar-actions {
        display: flex;
        gap: 9px;
    }


/* === RESULTS GRID === */

    .cee-body .results {
        margin-top: 20px;
        display: none;
    }

    .cee-body .results-h {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        flex-wrap: wrap;
        margin-bottom: 14px;
    }

    .cee-body .results-h h3 {
        font-family: 'Poppins';
        font-weight: 500;
        font-size: 18px;
    }

    .cee-body .results-h .count {
        color: #313F4B;
        font-weight: 400;
        font-size: 16px;
    }

    .cee-body .grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(var(--cell, 240px), 1fr));
        gap: 13px;
    }


/* === RESULT CARDS === */

    .cee-body .cell {
        background: var(--surface-2);
        border: 1px solid var(--border);
        border-radius: 11px;
        overflow: hidden;
        transition: .16s ease;
        animation: cee-rise .4s ease both;
    }

    @keyframes cee-rise {
        from {
            opacity: 0;
            transform: translateY(8px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .cee-body .cell:hover {
        border-color: var(--clr-primary);
        box-shadow: var(--shadow);
        transform: translateY(-2px);
    }

    .cee-body .cell.off {
        opacity: .42;
    }

    .cee-body .cell.off:hover {
        transform: none;
    }

    /* checkerboard transparency preview */
    .cee-body .thumb {
        height: calc(var(--cell, 240px) * .8);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 11px;
        background-color: #fff;
        background-image:
            linear-gradient(45deg, #dcdcd6 25%, transparent 25%),
            linear-gradient(-45deg, #dcdcd6 25%, transparent 25%),
            linear-gradient(45deg, transparent 75%, #dcdcd6 75%),
            linear-gradient(-45deg, transparent 75%, #dcdcd6 75%);
        background-size: 14px 14px;
        background-position: 0 0, 0 7px, 7px -7px, -7px 0;
    }

    .cee-body .thumb img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    /* dark background toggle for previewing light-colored clipart */
    .cee-body .grid.dark-bg .thumb {
        background-color: #000;
        background-image: none;
    }

    .cee-body #cee-darkBgBtn.active {
        background: #111;
        border-color: #444;
        color: #fff;
    }

    .cee-body #cee-darkBgBtn.active:hover {
        background: #222;
        border-color: #888;
        color: #fff;
    }

    .cee-body .cell-f {
        padding: 8px 10px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-top: 1px solid var(--border);
    }

    .cee-body .cell-f .dim {
        font-size: 18px;
        color: var(--txt-muted);
        font-variant-numeric: tabular-nums;
    }

    .cee-body .cell-f .acts {
        display: flex;
        align-items: center;
        gap: 4px;
    }


/* === ICON BUTTONS (download, copy, etc.) === */

    .cee-body .iconbtn {
        width: 27px;
        height: 27px;
        border-radius: 7px;
        border: none;
        background: transparent;
        cursor: pointer;
        display: grid;
        place-items: center;
        color: var(--txt-muted);
        transition: .13s;
    }

    .cee-body .iconbtn:hover {
        background: var(--clr-primary-light);
        color: var(--clr-primary);
    }

    .cee-body .iconbtn svg {
        width: 16px;
        height: 16px;
    }

    .cee-body .chk {
        width: 16px;
        height: 16px;
        accent-color: var(--clr-primary);
        cursor: pointer;
    }


/* === PROCESSING OVERLAY === */

    .cee-body .overlay {
        position: absolute;
        inset: 0;
        background: rgba(244, 242, 234, .82);
        backdrop-filter: blur(2px);
        display: none;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 12px;
        border-radius: 10px;
        z-index: 5;
    }

    .cee-body .overlay.on {
        display: flex;
    }

    .cee-body .spinner {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        border: 3px solid var(--clr-primary-light);
        border-top-color: var(--clr-primary);
        animation: cee-spin .7s linear infinite;
    }

    @keyframes cee-spin {
        to {
            transform: rotate(360deg);
        }
    }

    .cee-body .overlay span {
        font-size: 12.5px;
        color: var(--clr-primary);
        font-weight: 600;
    }


/* === EMPTY STATE === */

    .cee-body .empty-note {
        text-align: center;
        padding: 30px 20px;
        color: var(--txt-muted);
        font-size: 16px;
        border: 1px dashed var(--border);
        border-radius: 11px;
    }


/* === FOOTER === */

    .cee-body .cee-foot {
        margin-top: 36px;
        text-align: center;
        font-size: 16px;
        color: var(--txt-muted);
        line-height: 1.7;
    }


/* === TOAST (fixed-position, lives outside .cee-body) === */

    .cee-toast {
        position: fixed;
        bottom: 22px;
        left: 50%;
        transform: translateX(-50%) translateY(20px);
        background: var(--txt, #2B2D26);
        color: #fff;
        padding: 10px 18px;
        border-radius: 10px;
        font-size: 16px;
        font-weight: 500;
        opacity: 0;
        transition: .25s ease;
        pointer-events: none;
        z-index: 9999;
    }

    .cee-toast.show {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }