/* Global frontend UI */
:root {
    --bs-bg: #f5f5f7;
    --bs-surface: #ffffff;
    --bs-primary-text: #2d2e32;
    --bs-secondary-brown: #7a5015;
    --bs-open-brown: #714d1c;
    --bs-muted: #86868b;
    --bs-outline: #d2d2d7;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
    line-height: 1;
}

body.bs-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bs-bg);
     /* background: #f8f8ff;*/
     color: var(--bs-primary-text);
    
    padding-top: 4rem;
    padding-bottom: 0;
    -webkit-font-smoothing: antialiased;
}

.bs-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 1030; height: 4rem; background: rgba(255,255,255,.82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid rgba(210,210,215,.35); }
.bs-logo { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; color: #000; }
.bs-logo-image { max-height: 34px; width: auto; display: block; object-fit: contain; }
.bs-footer-bar {
    position: relative;
    left: 0;
    right: 0;
    z-index: 1025;
    border-top: 1px solid rgba(210,210,215,.35);
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.bs-footer-links-row { border-bottom: 1px solid rgba(210,210,215,.28); padding-bottom: .35rem; }
.bs-footer-credit-row, .bs-footer-links { line-height: 1.35; padding:10px; }
.bs-footer-link { color: #5f6470; font-weight: 600; }
.bs-footer-link:hover { color: #1f2937; text-decoration: underline !important; }
.bs-nav-link { color: var(--bs-muted); font-size: .875rem; font-weight: 500; text-decoration: none; transition: color .2s; }
.bs-nav-link:hover { color: #000; }
.bs-nav-dropdown-wrap { padding-bottom: 12px; margin-bottom: -12px; }
.bs-nav-dropdown-wrap:hover .bs-nav-dropdown-menu { opacity: 1; transform: translateY(0); pointer-events: auto; }
.bs-nav-dropdown-menu { position: absolute; top: calc(100% + 8px); left: -12px; min-width: 230px; padding: .45rem; border-radius: .8rem; background: #fff; border: 1px solid rgba(210,210,215,.5); box-shadow: 0 18px 40px -20px rgba(0,0,0,.28); opacity: 0; transform: translateY(6px); pointer-events: none; transition: all .2s; z-index: 20; }
.bs-nav-dropdown-menu--screens { width: min(720px, 82vw); max-width: calc(100vw - 24px); padding: .6rem; left: 50%; transform: translate(-50%, 6px); }
.bs-nav-dropdown-wrap:hover .bs-nav-dropdown-menu--screens { transform: translate(-50%, 0); }
.bs-nav-screens-grid { display: grid; grid-template-columns: repeat(var(--bs-screens-cols, 2), minmax(0, 1fr)); gap: .5rem; }
.bs-nav-screens-col { min-width: 150px; }
.bs-nav-dropdown-item { display: block; color: #2d2e32; text-decoration: none; font-size: .8rem; font-weight: 600; padding: .5rem .6rem; border-radius: .55rem; }
.bs-nav-dropdown-item:hover { background: rgba(210,210,215,.25); color: #000; }
.bs-btn-get { background: var(--bs-primary-text); color: #fff; border: none; padding: .5rem 1.5rem; border-radius: 999px; font-weight: 700; font-size: .875rem; }
.bs-btn-get:hover { opacity: .92; color: #fff; }
.bs-sidebar-w { width: 280px; }
.bs-shell { width: 100%; max-width: var(--bs-shell-width); margin: 0 auto; }
.bs-container { display: flex; min-height: 0; }
.glass-panel { background: rgba(255,255,255,.72); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,.5); }
.canvas-shadow { box-shadow: 0 30px 60px -12px rgba(0,0,0,.08), 0 18px 36px -18px rgba(0,0,0,.05); }
.bs-rounded-screen { border-radius: 1.5rem; }
.bs-rounded-inner { border-radius: 1.5rem; }
.bs-btn-download { background: var(--bs-secondary-brown); color: #fff; border: none; border-radius: 999px; font-weight: 700; font-size: .875rem; padding: 1rem; box-shadow: 0 12px 28px -8px rgba(122,80,21,.35); transition: transform .2s; }
.bs-btn-download:hover { color: #fff; transform: scale(1.01); }
.bs-btn-open { background: var(--bs-open-brown); color: #fff; border: none; border-radius: 999px; font-weight: 700; font-size: .875rem; padding: .65rem 1.75rem; }
.bs-btn-open:hover { color: #fff; opacity: .95; }
.bs-section-title { font-size: .6875rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.bs-divider-line { height: 1px; background: rgba(210,210,215,.45); flex: 1; }
.bs-form-soft { background: rgba(210,210,215,.22); border: none; border-radius: .75rem; }
.bs-form-soft:focus { background: rgba(210,210,215,.28); box-shadow: none; }
.bs-form-soft.form-select { border: 1px solid rgba(148, 163, 184, 0.35); background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%); box-shadow: inset 0 1px 1px rgba(15,23,42,.03), 0 8px 16px -14px rgba(15,23,42,.45); }
.bs-form-soft.form-select:focus { border-color: #f97316; box-shadow: 0 0 0 .16rem rgba(249,115,22,.18), inset 0 1px 1px rgba(15,23,42,.05); }
.transition-200 { transition: all .2s ease; }
[x-cloak] { display: none !important; }
.pickr { border: 1px solid #4c4c4e;}

/* Shared home/screen */
.bs-form-select-chevron { appearance: none; -webkit-appearance: none; background-image: none !important; }
.quick-swatch-90 { height: 90px; min-height: 90px; }
.bs-quick-grid-row {
    display: grid;
    grid-template-columns: repeat(var(--bs-columns, 5), minmax(0, 1fr));
    gap: 1rem;
}
.bs-quick-grid-col { min-width: 0; }
.home-quick-card:hover .quick-swatch-90,
.screen-quick-card:hover .quick-swatch-90 { box-shadow: 0 8px 24px -12px rgba(0,0,0,.15) !important; }
.screen-tool-divider { color: #b8bcc0; font-weight: 600; }
.screen-library-btn { background: #fff; color: #2d2e32;     border: 1px solid #b8afaf !important; }
.screen-library-btn:hover { background: #f4f5f6; color: #2d2e32; }
.bs-topbar-action {
    gap: .45rem;
    border: 1px solid #ffc0c0 !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: #2d2e32 !important;
    font-weight: 600;
    font-size: .8rem;
    padding: 6px 8px !important;
    box-shadow: 0 6px 14px -12px rgba(15, 23, 42, 0.35);
}
.bs-topbar-action:hover {
    border-color: #ffadad !important;
    background: #fff7f7 !important;
    color: #1f2937 !important;
}
.bs-topbar-action__text { line-height: 1; white-space: nowrap; }
/* useAsButton: swatch is .pcr-button inside .bs-pickr-wrap (stable Alpine parent) */
.bs-canvas-options #homepage-color-picker-wrap .pcr-button,
.bs-canvas-options #screen-color-picker-wrap .pcr-button,
.bs-pickr-wrap .pcr-button {
    background: var(--bs-picker-preview, #ffffff) !important;
}
.bs-canvas-options #homepage-color-picker-wrap .pcr-button::before,
.bs-canvas-options #screen-color-picker-wrap .pcr-button::before,
.bs-pickr-wrap .pcr-button::before {
    background: var(--bs-picker-preview, #ffffff) !important;
}
.bs-canvas-options .pickr,
.bs-pickr-wrap {
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    width: auto !important;
    max-width: none !important;
    display: inline-flex !important;
}
.bs-canvas-options #homepage-color-picker-wrap .pcr-button,
.bs-canvas-options #screen-color-picker-wrap .pcr-button,
.bs-pickr-wrap .pcr-button {
    border: 1px solid rgba(148, 163, 184, 0.45) !important;
    border-radius: 0.65rem !important;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85) !important;
    padding: 2px !important;
    box-sizing: border-box !important;
}
.bs-canvas-options #homepage-color-picker-wrap .pcr-button::before,
.bs-canvas-options #homepage-color-picker-wrap .pcr-button::after,
.bs-canvas-options #screen-color-picker-wrap .pcr-button::before,
.bs-canvas-options #screen-color-picker-wrap .pcr-button::after,
.bs-pickr-wrap .pcr-button::before,
.bs-pickr-wrap .pcr-button::after { top: 2px !important;    left: 2px !important;   right: 2px !important;   bottom: 2px !important;
    width: auto !important; height: auto !important;    border-radius: calc(0.65rem - 2px) !important;}
/* Gradient row: compact swatch (mobile uses 42px via media query) */
.bs-pickr-wrap.bs-gradient-pickr-wrap .pcr-button {   width: 32px; height: 32px;   min-width: 32px;   min-height: 32px;}
/* Main plain picker in canvas settings row: keep clearly visible on desktop */
.bs-pickr-wrap.bs-plain-pickr-wrap .pcr-button {  width: 40px;  height: 40px;  min-width: 38px;  min-height: 38px; }
.bs-canvas-options { box-shadow: inset 0 0 0 1px rgba(210,210,215,.45); }
.bs-mode-pill { background: rgba(255,255,255,.65); border-radius: 999px; padding: 4px; }
.bs-mode-tab { position: relative; border-radius: 999px; }
.bs-mode-tab.is-active::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: 3px; height: 2px; border-radius: 999px; background: #ef4444; }
.bs-timer-enable-switch .form-check-input { border-color: #9ea0a8; }
.bs-timer-enable-switch .form-check-input:checked { background-color: #7a5015; border-color: #7a5015; }
.bs-canvas-preview {
    box-shadow: 0 28px 70px -36px rgba(15, 23, 42, 0.45), 0 14px 30px -24px rgba(15, 23, 42, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.85) inset !important;
}
.bs-canvas-preview:hover {
    box-shadow: 0 34px 85px -38px rgba(15, 23, 42, 0.52), 0 18px 35px -22px rgba(15, 23, 42, 0.34), 0 0 0 1px rgba(255, 255, 255, 0.95) inset !important;
}
.bs-home-title-gradient {
    background: linear-gradient(120deg, #5f2eea, #db3ad1 40%, #ff8b3e 70%, #f7b500);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.bs-content-readable,
.bs-content-readable p,
.bs-content-readable li,
.page-rich-content {    color: #3f4248 !important;   font-size: .98rem;   line-height: 1.72; }
.bs-content-readable h1,
.bs-content-readable h2,
.bs-content-readable h3,
.bs-content-readable h4,
.bs-content-readable h5,
.bs-content-readable h6,
.page-rich-content h1,
.page-rich-content h2,
.page-rich-content h3,
.page-rich-content h4,
.page-rich-content h5,
.page-rich-content h6 { color: #1f2937 !important; }
.bs-content-readable h1,
.page-rich-content h1 { font-size: 2rem; line-height: 1.2; font-weight: 800; margin: 1rem 0 .65rem; }
.bs-content-readable h2,
.page-rich-content h2 { font-size: 1.7rem; line-height: 1.26; font-weight: 750; margin: .95rem 0 .6rem; }
.bs-content-readable h3,
.page-rich-content h3 { font-size: 1.45rem; line-height: 1.32; font-weight: 700; margin: .9rem 0 .55rem; }
.bs-content-readable h4,
.page-rich-content h4 { font-size: 1.25rem; line-height: 1.36; font-weight: 700; margin: .8rem 0 .5rem; }
.bs-content-readable h5,
.page-rich-content h5 { font-size: 1.1rem; line-height: 1.4; font-weight: 650; margin: .7rem 0 .45rem; }
.bs-content-readable h6,
.page-rich-content h6 { font-size: 1rem; line-height: 1.45; font-weight: 650; margin: .65rem 0 .4rem; }
.bs-content-readable strong,
.page-rich-content strong { font-weight: 700; color: #111827; }
.bs-content-readable em,
.page-rich-content em { font-style: italic; }
.bs-content-readable blockquote,
.page-rich-content blockquote {
    margin: .9rem 0;
    padding: .55rem .95rem;
    border-left: 3px solid rgba(122, 80, 21, 0.35);
    background: rgba(248, 250, 252, .8);
    border-radius: .5rem;
}
.bs-content-readable code,
.page-rich-content code {
    background: #f1f5f9;    padding: .12rem .35rem;   border-radius: .3rem;   font-size: .88em;}
.hover-bg-light:hover { background: rgba(210,210,215,.25); }
.pcr-app { max-height: 90vh !important; overflow: auto !important; }
.pcr-app { z-index: 9999 !important; }
.pcr-app[data-theme='classic'] {
    border-radius: .85rem;   border: 1px solid rgba(148, 163, 184, 0.35);   box-shadow: 0 20px 45px -20px rgba(15, 23, 42, 0.45);
    padding-top: 0 !important;    position: relative; }
/* Classic popup: stacked preview swatches — inset from border like toolbar */
.pcr-app[data-theme='classic'] .pcr-selection .pcr-color-preview {
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 0.65rem;
    padding: 2px;
    box-sizing: border-box;
    overflow: hidden;
}
.pcr-app[data-theme='classic'] .pcr-selection .pcr-color-preview .pcr-last-color {
    border-radius: calc(0.65rem - 2px) calc(0.65rem - 2px) 2px 2px;
}
.pcr-app[data-theme='classic'] .pcr-selection .pcr-color-preview .pcr-current-color {
    border-radius: 2px 2px calc(0.65rem - 2px) calc(0.65rem - 2px);
}
/* Popup header: title + close (keeps close off the hue / opacity sliders) */
.bs-pickr-header {   display: flex;   align-items: center;  justify-content: space-between;
    gap: 0.65rem;   flex-wrap: nowrap;   padding: 8px 10px 10px 12px;    margin: 0 0 6px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.28);  background: #fff;  border-radius: 0.85rem 0.85rem 0 0;
    position: relative;   z-index: 12; }

.bs-pickr-title {  font-size: 0.8125rem;  font-weight: 700;  color: #334155;  letter-spacing: 0.02em;
    white-space: nowrap;  flex: 1;  min-width: 0;  padding-right: 0.5rem; }
button.bs-pickr-close {  flex-shrink: 0; width: 2rem;  height: 2rem; display: inline-flex; align-items: center;
    justify-content: center;   margin: 0 0 0 auto; padding: 0;  border-radius: 0.45rem;  border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(248, 250, 252, 0.98);  color: #475569;  font-size: 1.1rem; line-height: 1;
    cursor: pointer;  transition: background 0.15s, color 0.15s, border-color 0.15s; }
button.bs-pickr-close:hover {  background: #fff;  color: #1e293b;  border-color: rgba(148, 163, 184, 0.65);
}
.pcr-app[data-theme='classic'] .pcr-selection {  position: relative;  z-index: 1; padding-top: 8px; }
@media (max-width: 767.98px) {
    /* Let our JS positioning (near the tap) control where Pickr opens. */
    .pcr-app.visible[data-theme='classic'] {
        top: auto !important;
        bottom: auto !important;
        margin: 0 !important;
        max-width: calc(100vw - 16px) !important;
    }

    /* Mobile gradient controls layout:
       Row 1: Angle + 1st color card
       Row 2+: 2 color cards per row */
    .bs-gradient-controls {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: .55rem .6rem !important;
        align-items: start !important;
    }
    .bs-gradient-angle {
        grid-column: 1 / span 1 !important;
        max-width: 100% !important;
    }
    .bs-gradient-angle input {
        max-width: 100% !important;
    }
    .bs-gradient-color-card {
        width: 100% !important;
        max-width: 100% !important;
    }
    .bs-gradient-add-btn {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        justify-self: center !important;
    }

    /* Keep the "X" remove button inside the gradient color card */
    .bs-gradient-color-card {
        overflow: hidden !important;
        justify-content: space-between !important;
    }
    .bs-gradient-color-card input.form-control {
        width: auto !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
    .bs-gradient-color-card .btn {
        flex: 0 0 auto !important;
        padding-left: .35rem !important;
        padding-right: .35rem !important;
    }
}
.screen-overlay--idle { cursor: none !important; }
.screen-overlay { width: 100vw !important; height: 100dvh !important; overflow: hidden; }
.screen-settings-popover { width: min(340px, calc(100vw - 1.5rem)); z-index: 10; }
.bs-category-preview-swatch { height: 112px; border-radius: 1rem 1rem 0 0; background: var(--cat-preview-bg, #ffffff); }
.screen-settings-popover__inner { background: linear-gradient(165deg, #fff 0%, #f6f7f9 100%); border: 1px solid rgba(15, 23, 42, 0.08); border-radius: 1rem; box-shadow: 0 20px 50px -20px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(255,255,255,.6) inset; padding: 1rem 1.1rem 1.15rem; max-height: min(70vh, 520px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.screen-settings-popover__title { font-size: 0.95rem; font-weight: 700; letter-spacing: -0.02em; color: #1a1d24; margin: 0; }
.screen-settings-section { padding-bottom: 0.75rem; border-bottom: 1px solid rgba(15, 23, 42, 0.06); }
.screen-settings-section:last-child { border-bottom: 0; padding-bottom: 0; }
.screen-settings-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #1f2937; }
.screen-color-input { height: 2.75rem; border-radius: 0.65rem; cursor: pointer; }
.screen-segmented { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(15, 23, 42, 0.06); }
.screen-segmented__btn { flex: 1; border: 0; border-radius: 999px; padding: 0.4rem 0.35rem; font-size: 0.72rem; font-weight: 600; color: #4b5563; background: transparent; transition: background .15s, color .15s, box-shadow .15s; }
.screen-segmented__btn.is-active { background: #fff; color: #111827; box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.screen-timer-display { text-shadow: 0 2px 24px rgba(0,0,0,.35); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.page-rich-content p { margin-bottom: 0.75rem; }
.page-rich-content ul, .page-rich-content ol { padding-left: 1.25rem; margin-bottom: 0.75rem; }
.page-rich-content a { color: #4a6bb4; }

/* Color library modal */
.cl-backdrop { background: rgba(0,0,0,0.12); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(8px); }
.cl-modal { width: min(1366px, 92vw); height: 90vh; max-height: 90vh; border-radius: 14px; background: rgba(255,255,255,0.92); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); box-shadow: 0 32px 64px -12px rgba(0,0,0,0.14); border: 1px solid rgba(255,255,255,0.25); overflow: hidden; display: flex; flex-direction: column; }
.cl-header { height: 64px; background: rgba(255,255,255,.82); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(219,221,221,.5); padding: 10px; }
.cl-tab { border: 0; background: transparent; padding: .25rem .15rem .45rem; color: #5a5c5c; font-size: .95rem; font-weight: 500; border-bottom: 2px solid transparent; }
.cl-tab.active { color: #2d2f2f; font-weight: 700; border-bottom-color: #ff8b3e; }
.cl-body { padding: 1.75rem 1.75rem 1.25rem; overflow-y: auto; scrollbar-width: thin; }
.cl-body::-webkit-scrollbar { width: 4px; }
.cl-body::-webkit-scrollbar-thumb { background: #dbdddd; border-radius: 10px; }
.cl-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1.25rem; }
.cl-card { border: 0; background: transparent; text-align: left; transition: transform .25s ease, box-shadow .25s ease; }
.cl-swatch { aspect-ratio: 5/3; border-radius: 12px; box-shadow: 0 4px 14px -8px rgba(0,0,0,.2); border: 1px solid rgba(0,0,0,.06); transition: transform .25s ease, box-shadow .25s ease; }
.cl-card:hover .cl-swatch { transform: translateY(-1px) scale(1.015); box-shadow: 0 14px 28px -16px rgba(0,0,0,.35); }
.cl-card.selected .cl-swatch { box-shadow: 0 0 0 2px rgba(45,47,47,.7), 0 14px 28px -16px rgba(0,0,0,.35); }
.cl-name { margin-top: .5rem; text-align: center; color: #5a5c5c; font-size: .78rem; font-weight: 500; }
.cl-rule { height: 1px; background: rgba(219,221,221,.45); flex: 1; }

@media (max-width: 576px) {
    .screen-settings-popover { position: fixed !important; left: 0.65rem !important; right: 0.65rem !important; top: auto !important; bottom: 0.85rem !important; width: auto !important; margin-top: 0 !important; }
    .screen-settings-popover__inner { max-height: 55vh; }
}
@media (min-width: 768px) {
    .cl-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .cl-body { padding: 1.75rem 2rem 1.5rem; }
}
@media (min-width: 1200px) {
    .cl-grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
}
@media (max-width: 767.98px) {
    .bs-footer-bar { padding-bottom: env(safe-area-inset-bottom, 0px); }
    .bs-footer-links-row { justify-content: center !important; }
    .bs-footer-credit-row { justify-content: center !important; text-align: center; }
    .bs-container { overflow-x: hidden; }
.bs-container,
.bs-main-offset {
    overflow: visible !important;
}

/* Prevent Pickr from being clipped and ensure it stays on top */
.bs-container, .bs-main-offset, .pcr-app {
    overflow: visible !important;
}
    .bs-container > main {
        min-width: 0;
        gap: 1.25rem !important;
    }
    .bs-container > main > .row {
        row-gap: 1rem !important;
        margin-bottom: 0 !important;
    }
    .bs-nav { padding-inline: .25rem; }
    .bs-topbar-action {   border: 0 !important;   box-shadow: none !important;   background: transparent !important;
        width: 38px;   height: 38px;  padding: 0 !important;   }
    .bs-topbar-action__text { display: none; }
    .bs-canvas-options {  border-radius: 1rem !important;    display: grid !important;   grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .55rem !important;    align-items: center;  justify-content: stretch !important;   }
    .bs-canvas-options .screen-tool-divider { display: none; }
    .bs-canvas-options .bs-mode-pill {
        grid-column: 1 / -1;   justify-self: center;   width: min(280px, 100%);   display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));   }
    .bs-canvas-options .bs-canvas-tools {
        grid-column: 1 / -1;    width: 100%;  display: flex !important; flex-wrap: wrap;
        justify-content: center;   align-items: center;   gap: 0.55rem !important;  }
    .bs-canvas-options #homepage-color-picker-wrap,
    .bs-canvas-options #screen-color-picker-wrap {
        width: auto;     max-width: 100%;   }
    .bs-canvas-options #homepage-color-picker-wrap .pcr-button,
    .bs-canvas-options #screen-color-picker-wrap .pcr-button,
    .bs-pickr-wrap .pcr-button {  width: 42px;    height: 42px;  border-radius: .65rem;  }
    .bs-canvas-options .screen-library-btn {   width: auto;  min-width: 110px;  justify-content: center; }
    .bs-canvas-options .bs-btn-open { grid-column: 1 / -1; width: 100%; justify-content: center;  }
    .bs-main-offset { min-width: 0; }
    .bs-main-offset > .row > section.col-lg-8 {
        height: auto !important;  min-height: 0 !important;   }
    .bs-main-offset > .row > section.col-lg-8 > .canvas-shadow {
        flex-grow: 0 !important;
        min-height: 0 !important;
    }
    .cl-modal { width: 96vw; max-height: 97vh; height: 97vh; }
    .cl-header { height: auto; min-height: 64px; padding-top: .35rem; padding-bottom: .35rem; }
    .bs-canvas-preview {
        min-height: 200px !important;
        max-height: 200px !important;
        height: 200px !important;
        flex: 0 0 auto !important;
    }
    .bs-quick-after-config {
        position: static !important;
        z-index: auto !important;
        clear: both;
        margin-top: .25rem !important;
        padding-top: 0 !important;
        display: block !important;
    }
    .bs-quick-grid-row { gap: .7rem; }
    .bs-quick-grid-col .card { border-radius: .95rem !important; }
    .bs-category-preview-swatch { height: 96px; }
}

/* Fullscreen overlay chrome: stay top-right relative to the overlay (not fixed to viewport)
   so iOS/Android rotation and fullscreen APIs match desktop device emulation. */
/* Mobile + Tablet overlay controls (stable) */
@media (max-width: 1024px) {
    .screen-overlay .screen-overlay-chrome {
        position: fixed !important;

        /* ✅ Always stick to top-right */
        top: calc(10px + env(safe-area-inset-top, 0px)) !important;
        right: calc(10px + env(safe-area-inset-right, 0px)) !important;

        left: auto !important;
        bottom: auto !important;

        /* ✅ Prevent overflow issues */
        width: auto !important;
        max-width: calc(100% - 20px) !important;

        /* ✅ Clean layout */
        padding: 0 !important;
        margin: 0 !important;

        display: flex !important;
        justify-content: flex-end !important;
        align-items: flex-start !important;
        flex-wrap: wrap !important;

        /* ✅ Prevent shifting */
        transform: none !important;

        /* ✅ Always above everything */
        z-index: 2305 !important;
    }
}
/* Custom color picker modal */
.cp-picker-backdrop { background-color: rgba(246,246,246,.92); background-image: linear-gradient(45deg, #e5e7eb 25%, transparent 25%), linear-gradient(-45deg, #e5e7eb 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e5e7eb 75%), linear-gradient(-45deg, transparent 75%, #e5e7eb 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.cp-picker-card { max-width: 480px; width: 100%; border-radius: .75rem; border: 1px solid rgba(45,47,47,.06); box-shadow: 0 32px 64px -16px rgba(0,0,0,.15); background: #fff; max-height: min(92vh, 720px); overflow: hidden; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom, 0); }
.cp-header { padding: 1rem 1.25rem; background: rgba(240,241,241,.35); border-bottom: 1px solid rgba(45,47,47,.05); }
.cp-mode-pill { background: #e1e3e3; padding: 4px; border-radius: 999px; display: flex; gap: 4px; width: 100%; max-width: 240px; }
.cp-mode-pill button { flex: 1; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: .4rem .75rem; border: none; border-radius: 999px; background: transparent; color: #5a5c5c; transition: color .15s, background .15s, box-shadow .15s; }
.cp-mode-pill button.is-on { background: #fff; color: #2d2f2f; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.cp-sv-layer-base,.cp-sv-layer-w,.cp-sv-layer-b { position: absolute; inset: 0; }
.cp-sv-layer-w { background: linear-gradient(to right, #fff, transparent); }
.cp-sv-layer-b { background: linear-gradient(to top, #000, transparent); }
.cp-sv-panel { position: relative; flex: 1; min-height: 140px; height: 180px; border-radius: .5rem; overflow: hidden; cursor: crosshair; touch-action: none; user-select: none; }
.cp-sv-knob,.cp-hue-knob { position: absolute; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); pointer-events: none; transform: translate(-50%, -50%); }
.cp-sv-knob { width: 16px; height: 16px; }
.cp-hue-strip { width: 16px; min-width: 16px; height: 180px; border-radius: 999px; position: relative; cursor: pointer; touch-action: none; user-select: none; background: linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%); box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.cp-hue-knob { left: 50%; width: 20px; height: 20px; }
.cp-hex-bar { background: #f0f1f1; border-radius: .5rem; padding: .5rem 1rem; }
.cp-tab { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding-bottom: .5rem; margin-bottom: -1px; border: none; border-bottom: 2px solid transparent; background: none; color: #5a5c5c; transition: color .15s, border-color .15s; }
.cp-tab.is-active { color: #2d2f2f; border-bottom-color: #5b5b5b; }
.cp-range { flex: 1; height: 6px; -webkit-appearance: none; appearance: none; background: #e1e3e3; border-radius: 999px; }
.cp-range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #5b5b5b; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.cp-range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #5b5b5b; cursor: pointer; border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.cp-num { width: 3rem; text-align: center; font-size: 12px; font-family: ui-monospace, monospace; background: #e1e3e3; border: none; border-radius: .375rem; padding: .25rem .15rem; }
.cp-select-solid { width: 100%; background: #5b5b5b; color: #f3f3f3; font-weight: 800; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; padding: .85rem 1rem; border: none; border-radius: 999px; transition: transform .15s, box-shadow .15s; }
.cp-select-solid:hover { color: #f3f3f3; box-shadow: 0 8px 24px -8px rgba(0,0,0,.25); }
.cp-select-solid:active { transform: translateY(1px); }
.cp-body-scroll { overflow-y: auto; flex: 1; min-height: 0; }
@media (max-width: 575.98px) {
    .cp-picker-card { max-width: 100%; max-height: 95dvh; border-radius: .75rem .75rem 0 0; }
    .cp-picker-backdrop.align-items-end { align-items: flex-end !important; }
    .cp-sv-panel { height: 160px; min-height: 120px; }
    .cp-hue-strip { height: 160px; }
}

@media (min-width: 768px) {
    .pb-md-4 {    padding-bottom: 0.5rem !important; }
    button.bs-btn-download.px-5.py-3 {     margin: 10px;  }
}

.pb-md-4 {    padding-bottom: 0.5rem !important; }
    button.bs-btn-download.px-5.py-3 {     margin: 10px;  }