/* ============================================================
   WebStories Visual Page Builder — Wix-style drag-and-drop
   ============================================================
   Loaded on every page. Two modes:
   1. PUBLIC: renders saved blocks read-only (no handles, no palette).
   2. BUILDING: stella0225 + Building toggle ON → palette, handles, toolbars.
   ============================================================ */

/* ----- Floating "Building" toggle (visible only for admin) ----- */
.wsb-toggle-fab {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1500;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ff79f2 60%, #6bf7ff);
    border: 3px solid rgba(13, 18, 34, 0.9);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45), 0 0 0 0 rgba(255, 121, 242, 0.5);
    cursor: pointer;
    color: #1a0a30;
    font-weight: 900;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.08em;
    font-size: 0.7rem;
    transition: transform 0.15s ease, box-shadow 0.18s ease, filter 0.15s ease;
}
.wsb-toggle-fab:hover { transform: scale(1.06); filter: brightness(1.1); }
.wsb-toggle-fab.is-on {
    background: linear-gradient(135deg, #6bf7ff, #ff79f2);
    animation: wsb-fab-pulse 2s ease-in-out infinite;
}
@keyframes wsb-fab-pulse {
    0%, 100% { box-shadow: 0 14px 36px rgba(0,0,0,0.45), 0 0 0 0 rgba(255, 121, 242, 0.6); }
    50% { box-shadow: 0 14px 36px rgba(0,0,0,0.45), 0 0 0 14px rgba(255, 121, 242, 0); }
}

/* ----- Top building toolbar (visible only when building mode is on) ----- */
.wsb-topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1400;
    background: linear-gradient(180deg, rgba(13, 18, 34, 0.95), rgba(13, 18, 34, 0.75));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(107, 247, 255, 0.25);
    padding: 10px 18px;
    display: flex; align-items: center; gap: 14px;
    color: #fff; font-family: 'Montserrat', sans-serif;
    box-shadow: 0 10px 36px rgba(0,0,0,0.5);
}
.wsb-topbar .wsb-brand {
    font-weight: 800; letter-spacing: 0.08em;
    color: transparent;
    background: linear-gradient(135deg, #6bf7ff, #ff79f2);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.wsb-topbar .wsb-page-name {
    color: #c5d4ee; font-size: 0.85em; padding: 5px 12px;
    border: 1px solid rgba(107, 247, 255, 0.25); border-radius: 999px;
    background: rgba(13, 18, 34, 0.65);
}
.wsb-topbar .wsb-spacer { flex: 1; }
.wsb-btn {
    background: rgba(15, 24, 60, 0.85); color: #fff;
    border: 1px solid rgba(107, 247, 255, 0.35);
    padding: 8px 16px; border-radius: 999px; font-weight: 700; font-family: inherit;
    cursor: pointer; transition: filter 0.15s ease, border-color 0.15s ease;
    width: auto; font-size: 0.85em;
}
.wsb-btn:hover { border-color: #ff79f2; filter: brightness(1.1); }
.wsb-btn-primary {
    background: linear-gradient(135deg, #6bf7ff, #ff79f2);
    color: #1a0a30; border: none; font-weight: 800;
}
.wsb-btn-primary:hover { filter: brightness(1.1); }
.wsb-btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.wsb-btn-ghost {
    background: transparent; color: #c5d4ee; border: 1px solid rgba(255, 255, 255, 0.18);
}
.wsb-btn-danger { background: rgba(255, 90, 122, 0.2); color: #ff8b9a; border: 1px solid rgba(255, 90, 122, 0.5); }

/* When building mode is on, push body content down so topbar doesn't cover it */
body.wsb-building { padding-top: 56px; }

/* ----- Slide-out palette (right side) ----- */
.wsb-palette {
    position: fixed; top: 56px; right: 0; bottom: 0;
    width: 340px; z-index: 1380;
    background: linear-gradient(180deg, rgba(13, 18, 34, 0.96), rgba(8, 10, 22, 0.92));
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-left: 1px solid rgba(107, 247, 255, 0.22);
    box-shadow: -16px 0 40px rgba(0, 0, 0, 0.55);
    transform: translateX(360px);
    transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.3, 1);
    display: flex; flex-direction: column;
    font-family: 'Open Sans', sans-serif; color: #e9f2ff;
}
.wsb-palette.is-open { transform: translateX(0); }
.wsb-palette-head {
    padding: 18px 20px 12px;
    border-bottom: 1px solid rgba(107, 247, 255, 0.18);
    display: flex; align-items: center; gap: 10px;
}
.wsb-palette-head h3 {
    margin: 0; font-family: 'Montserrat', sans-serif; letter-spacing: 0.06em;
    color: transparent;
    background: linear-gradient(135deg, #6bf7ff, #ff79f2);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    font-size: 1.1em;
}
.wsb-palette-close {
    margin-left: auto; background: transparent; border: none; color: #c5d4ee;
    cursor: pointer; font-size: 1.4em; padding: 2px 8px; line-height: 1;
}
.wsb-palette-close:hover { color: #ff79f2; }

.wsb-tabs {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 6px; padding: 10px 12px;
    border-bottom: 1px solid rgba(107, 247, 255, 0.12);
}
.wsb-tab {
    background: rgba(15, 24, 60, 0.55);
    border: 1px solid rgba(107, 247, 255, 0.18);
    color: #c5d4ee; padding: 10px 6px; border-radius: 10px;
    font-size: 0.7em; font-weight: 700; cursor: pointer; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    font-family: 'Montserrat', sans-serif; letter-spacing: 0.04em;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.wsb-tab:hover { border-color: #ff79f2; color: #fff; }
.wsb-tab.is-active {
    background: linear-gradient(135deg, rgba(107, 247, 255, 0.22), rgba(255, 121, 242, 0.22));
    border-color: #6bf7ff; color: #fff;
}
.wsb-tab .wsb-tab-icon { font-size: 1.3em; line-height: 1; }

.wsb-variants {
    flex: 1; overflow-y: auto;
    padding: 14px 16px 80px;
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-content: start;
}
.wsb-variant {
    background: rgba(15, 24, 60, 0.55);
    border: 1px solid rgba(107, 247, 255, 0.2);
    border-radius: 12px; padding: 14px 10px;
    cursor: grab; user-select: none;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    min-height: 96px; justify-content: center;
    transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
    text-align: center;
}
.wsb-variant:hover {
    border-color: #ff79f2;
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(255, 121, 242, 0.25);
}
.wsb-variant:active { cursor: grabbing; }
.wsb-variant-label {
    font-size: 0.72em; color: #c5d4ee; font-weight: 600;
    letter-spacing: 0.04em; text-transform: uppercase;
}
.wsb-variant-preview {
    pointer-events: none;
    display: flex; align-items: center; justify-content: center;
    min-height: 38px; width: 100%;
}

/* ----- Block rendering (placed on the page) ----- */
.wsb-block {
    position: absolute;
    box-sizing: border-box;
    z-index: 10;
}
/* Selected block — show outline + handles + ring */
.wsb-block.is-selected {
    outline: 2px solid #ff79f2;
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(255, 121, 242, 0.18), 0 0 30px rgba(255, 121, 242, 0.35);
}
body.wsb-building .wsb-block { cursor: grab; }
body.wsb-building .wsb-block.is-dragging,
body.wsb-building .wsb-block.is-resizing { cursor: grabbing; user-select: none; }

/* Handles (only visible on selected + building mode) */
.wsb-handle {
    position: absolute;
    width: 14px; height: 14px;
    background: #fff;
    border: 2px solid #ff79f2;
    border-radius: 50%;
    z-index: 1200;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.wsb-handle[data-handle="nw"] { top: -7px; left: -7px; cursor: nwse-resize; }
.wsb-handle[data-handle="ne"] { top: -7px; right: -7px; cursor: nesw-resize; }
.wsb-handle[data-handle="sw"] { bottom: -7px; left: -7px; cursor: nesw-resize; }
.wsb-handle[data-handle="se"] { bottom: -7px; right: -7px; cursor: nwse-resize; }
.wsb-handle[data-handle="n"] { top: -7px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.wsb-handle[data-handle="s"] { bottom: -7px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.wsb-handle[data-handle="w"] { left: -7px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.wsb-handle[data-handle="e"] { right: -7px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }

/* Floating mini-toolbar above selected block */
.wsb-mini {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1300;
    display: flex; gap: 6px;
    background: rgba(13, 18, 34, 0.96);
    border: 1px solid rgba(107, 247, 255, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 999px;
    padding: 6px 8px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
    white-space: nowrap;
}
.wsb-mini-btn {
    background: transparent; border: none;
    color: #c5d4ee; cursor: pointer; font-size: 1em;
    padding: 5px 9px; border-radius: 999px;
    font-family: inherit; width: auto;
    transition: background 0.12s ease, color 0.12s ease;
}
.wsb-mini-btn:hover { background: rgba(107, 247, 255, 0.16); color: #fff; }
.wsb-mini-btn.is-danger:hover { background: rgba(255, 90, 122, 0.25); color: #ff8b9a; }

.wsb-mini-color {
    width: 28px; height: 28px; padding: 0; border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35); cursor: pointer;
    background: transparent;
}

/* ----- Block variants — preview thumbnails ----- */
.wsb-thumb-btn-pill-cyan {
    padding: 8px 16px; border-radius: 999px; font-weight: 800;
    background: linear-gradient(135deg, #6bf7ff, #ff79f2); color: #1a0a30; font-size: 0.75em;
}
.wsb-thumb-btn-pill-pink {
    padding: 8px 16px; border-radius: 999px; font-weight: 800;
    background: linear-gradient(135deg, #ff79f2, #ffd700); color: #1a0a30; font-size: 0.75em;
}
.wsb-thumb-btn-outline {
    padding: 7px 16px; border-radius: 8px; font-weight: 700;
    background: transparent; border: 2px solid #6bf7ff; color: #6bf7ff; font-size: 0.75em;
}
.wsb-thumb-btn-circle {
    width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #6bf7ff, #ff79f2);
    color: #1a0a30; font-weight: 900; display: flex; align-items: center; justify-content: center;
}
.wsb-thumb-btn-ghost {
    padding: 7px 14px; background: rgba(255,255,255,0.06); color: #fff; font-weight: 700;
    border-radius: 999px; font-size: 0.75em;
}
.wsb-thumb-text-h1 { font-size: 1em; font-weight: 800; font-family: 'Fredoka One', cursive; color: #fff; }
.wsb-thumb-text-h2 { font-size: 0.85em; font-weight: 700; color: #6bf7ff; }
.wsb-thumb-text-body { font-size: 0.75em; color: #c5d4ee; }
.wsb-thumb-text-callout {
    padding: 6px 10px; background: rgba(107, 247, 255, 0.12); border: 1px solid rgba(107, 247, 255, 0.35);
    border-radius: 10px; font-size: 0.72em; color: #6bf7ff;
}
.wsb-thumb-shape-rectangle { width: 60px; height: 24px; background: linear-gradient(135deg, #6bf7ff, #ff79f2); border-radius: 6px; }
.wsb-thumb-shape-circle { width: 32px; height: 32px; background: linear-gradient(135deg, #ff79f2, #ffd700); border-radius: 50%; }
.wsb-thumb-shape-divider { width: 60px; height: 2px; background: linear-gradient(90deg, transparent, #6bf7ff, transparent); }
.wsb-thumb-shape-star { color: #ffd700; font-size: 1.6em; line-height: 1; }
.wsb-thumb-image-square { width: 34px; height: 34px; background: linear-gradient(135deg, #c5d4ee, #6bf7ff); border-radius: 4px; display:flex;align-items:center;justify-content:center;color:#1a0a30;font-weight:800;font-size:0.7em;}
.wsb-thumb-image-portrait { width: 26px; height: 36px; background: linear-gradient(135deg, #c5d4ee, #ff79f2); border-radius: 4px; }
.wsb-thumb-image-circle { width: 34px; height: 34px; background: linear-gradient(135deg, #ffd700, #ff79f2); border-radius: 50%; }
.wsb-thumb-bg-solid { width: 60px; height: 30px; background: rgba(255, 121, 242, 0.5); border-radius: 8px; }
.wsb-thumb-bg-gradient { width: 60px; height: 30px; background: linear-gradient(135deg, #6bf7ff, #ff79f2); border-radius: 8px; }
.wsb-thumb-bg-glass { width: 60px; height: 30px; background: rgba(255,255,255,0.12); border-radius: 8px; border: 1px solid rgba(107,247,255,0.4); backdrop-filter: blur(6px); }
.wsb-thumb-video-yt {
    width: 60px; height: 30px; background: #ff0000; border-radius: 6px;
    display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 0.7em;
}
.wsb-thumb-video-vimeo {
    width: 60px; height: 30px; background: #1ab7ea; border-radius: 6px;
    display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 0.6em;
}
.wsb-thumb-anim {
    width: 70px; padding: 5px 8px; text-align: center; border-radius: 6px;
    background: rgba(255,255,255,0.05); color: #fff; font-weight: 700; font-size: 0.7em;
    border: 1px dashed rgba(107,247,255,0.45);
}

/* ----- Rendered blocks — actual element styles ----- */
.wsb-block-button {
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; font-family: 'Montserrat', sans-serif;
    font-weight: 800; letter-spacing: 0.04em; cursor: pointer;
    width: 100%; height: 100%;
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
    border: none;
}
.wsb-block-button:hover { transform: translateY(-2px); filter: brightness(1.08); }
.wsb-block-button[data-variant="pill-cyan"],
.wsb-block-button[data-variant="pill-pink"] { border-radius: 999px; }
.wsb-block-button[data-variant="outline"] { border-radius: 10px; border: 2px solid currentColor; background: transparent; }
.wsb-block-button[data-variant="circle"] { border-radius: 50%; }
.wsb-block-button[data-variant="ghost"] { background: rgba(255,255,255,0.06); border-radius: 999px; color: #fff; }

.wsb-block-text {
    display: flex; align-items: center;
    width: 100%; height: 100%;
    font-family: 'Open Sans', sans-serif;
    line-height: 1.3;
    word-break: break-word;
}
.wsb-block-text[data-variant="heading"] { font-family: 'Fredoka One', cursive; font-weight: 400; }
.wsb-block-text[data-variant="subheading"] { font-family: 'Montserrat', sans-serif; font-weight: 700; }
.wsb-block-text[data-variant="body"] { font-family: 'Open Sans', sans-serif; }
.wsb-block-text[data-variant="callout"] {
    padding: 12px 16px;
    border: 1px solid rgba(107, 247, 255, 0.45);
    border-radius: 14px;
    background: rgba(107, 247, 255, 0.1);
}
.wsb-block-text[contenteditable="true"]:focus { outline: 2px dashed #ff79f2; }

.wsb-block-shape {
    width: 100%; height: 100%;
}
.wsb-block-shape[data-variant="rectangle"] { border-radius: 8px; }
.wsb-block-shape[data-variant="circle"] { border-radius: 50%; }
.wsb-block-shape[data-variant="divider"] {
    background: linear-gradient(90deg, transparent, #6bf7ff, transparent);
    height: 100%;
}
.wsb-block-shape[data-variant="star"] {
    display: flex; align-items: center; justify-content: center;
    background: transparent !important;
    font-size: min(80%, 80%);
}

.wsb-block-image {
    width: 100%; height: 100%;
    overflow: hidden;
    background: rgba(15, 24, 60, 0.5);
    border: 1px dashed rgba(107, 247, 255, 0.4);
    display: flex; align-items: center; justify-content: center;
    color: #6bf7ff; font-weight: 700; font-size: 0.85em;
}
.wsb-block-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wsb-block-image[data-variant="circle"] { border-radius: 50%; }
.wsb-block-image[data-variant="circle"] img { border-radius: 50%; }

.wsb-block-background {
    width: 100%; height: 100%;
    border-radius: 16px;
}
.wsb-block-background[data-variant="glass"] {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.wsb-block-background[data-variant="gradient"] {
    background: linear-gradient(135deg, var(--wsb-color1, #6bf7ff), var(--wsb-color2, #ff79f2));
}

.wsb-block-video {
    width: 100%; height: 100%;
    background: #000; border-radius: 10px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700;
}
.wsb-block-video iframe { width: 100%; height: 100%; border: 0; }

.wsb-block-animated-text {
    display: flex; align-items: center;
    width: 100%; height: 100%;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    line-height: 1.2;
    background: linear-gradient(135deg, #6bf7ff, #ff79f2);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    color: transparent;
}
.wsb-anim-fade-in.is-visible { animation: wsb-fade-in 1.2s ease-out forwards; }
.wsb-anim-slide-up.is-visible { animation: wsb-slide-up 1s cubic-bezier(0.2,0.7,0.3,1.2) forwards; }
.wsb-anim-gradient-sweep {
    background-size: 220% 220%;
    animation: wsb-sweep 5s ease-in-out infinite;
}
@keyframes wsb-fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes wsb-slide-up { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes wsb-sweep {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ----- Inspector panel (right side, below palette) ----- */
.wsb-inspector {
    position: fixed; top: 72px; right: 360px; z-index: 1370;
    width: 260px; max-height: calc(100vh - 100px); overflow-y: auto;
    background: rgba(13, 18, 34, 0.96);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(107, 247, 255, 0.25);
    border-radius: 14px;
    padding: 14px 16px;
    color: #e9f2ff; font-family: 'Open Sans', sans-serif;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
    display: none;
}
.wsb-inspector.is-open { display: block; }
.wsb-inspector h4 {
    margin: 0 0 10px;
    font-family: 'Montserrat', sans-serif; letter-spacing: 0.06em;
    color: #6bf7ff; font-size: 0.85em; text-transform: uppercase;
}
.wsb-inspector label {
    display: block; margin-top: 10px;
    font-size: 0.78em; color: #c5d4ee; font-weight: 600;
}
.wsb-inspector input[type="text"],
.wsb-inspector input[type="number"],
.wsb-inspector select,
.wsb-inspector textarea {
    width: 100%; box-sizing: border-box;
    background: rgba(13, 18, 34, 0.65);
    border: 1px solid rgba(107, 247, 255, 0.25);
    color: #fff;
    padding: 7px 10px; border-radius: 8px; margin-top: 4px;
    font-family: inherit; font-size: 0.85em;
}
.wsb-inspector input[type="color"] {
    width: 38px; height: 30px; padding: 2px; border-radius: 6px; border: 1px solid rgba(107, 247, 255, 0.25);
    background: transparent;
}
.wsb-inspector .wsb-inspector-row {
    display: flex; gap: 8px; align-items: center; margin-top: 6px;
}

/* Empty hint when no blocks placed yet & in builder mode */
.wsb-empty-hint {
    position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%);
    background: rgba(13, 18, 34, 0.85);
    border: 1px dashed rgba(107, 247, 255, 0.45);
    color: #c5d4ee;
    padding: 10px 18px; border-radius: 14px;
    font-family: 'Open Sans', sans-serif; font-size: 0.88em;
    z-index: 1100;
    pointer-events: none;
    backdrop-filter: blur(8px);
}

/* Confirmation flash */
.wsb-flash {
    position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
    background: rgba(13, 18, 34, 0.96);
    border: 1px solid rgba(107, 247, 255, 0.5);
    color: #6bf7ff; font-weight: 700;
    padding: 10px 20px; border-radius: 999px;
    z-index: 1600; box-shadow: 0 14px 30px rgba(0,0,0,0.5);
    animation: wsb-flash-fade 2s ease-out forwards;
}
.wsb-flash.is-err { color: #ff8b9a; border-color: #ff5a7a; }
@keyframes wsb-flash-fade {
    0% { opacity: 0; transform: translate(-50%, 10px); }
    10%, 80% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -8px); }
}

/* Mobile: hide palette & inspector, show a warning */
@media (max-width: 900px) {
    .wsb-palette, .wsb-inspector { display: none !important; }
    body.wsb-building::after {
        content: "Visual builder works best on a desktop. Switch to a wider screen to edit.";
        position: fixed; top: 60px; left: 10px; right: 10px; z-index: 2000;
        background: rgba(13, 18, 34, 0.95); border: 1px solid rgba(255, 215, 0, 0.45);
        color: #ffd700; padding: 12px 16px; border-radius: 10px;
        font-family: 'Open Sans', sans-serif; font-size: 0.9em;
    }
}

/* ===== Native-element editing (existing page elements) ===== */
body.wsb-building [data-wsb-editable] {
    cursor: pointer;
    outline-offset: 3px;
    transition: outline-color 0.12s ease, box-shadow 0.12s ease;
}
body.wsb-building [data-wsb-editable]:hover {
    outline: 1px dashed #6bf7ff;
}
body.wsb-building [data-wsb-editable].wsb-native-selected {
    outline: 2px solid #ff79f2 !important;
    box-shadow: 0 0 0 6px rgba(255, 121, 242, 0.18), 0 0 30px rgba(255, 121, 242, 0.32);
    border-radius: 6px;
}
.wsb-native-tag {
    position: absolute;
    z-index: 1350;
    pointer-events: none;
    background: rgba(13, 18, 34, 0.92);
    color: #6bf7ff;
    border: 1px solid rgba(107, 247, 255, 0.4);
    padding: 3px 8px;
    border-radius: 999px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.66em;
    letter-spacing: 0.08em;
    font-weight: 700;
    backdrop-filter: blur(8px);
}

/* ===== Minimal modal styles (shared with admin.css; declared here so the
   builder's confirm modal works on every page including login.html etc) ===== */
.ws-modal-overlay {
    position: fixed; inset: 0; z-index: 2200;
    background: rgba(5, 6, 20, 0.7);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: none; align-items: center; justify-content: center;
    padding: 18px;
}
.ws-modal-overlay.is-open { display: flex; }
.ws-modal {
    background: rgba(15, 24, 60, 0.96);
    border: 1px solid rgba(107, 247, 255, 0.3);
    border-radius: 16px;
    padding: 24px 24px 18px;
    width: 100%; max-width: 420px;
    color: #e9f2ff; font-family: 'Open Sans', sans-serif;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
}
.ws-modal h3 {
    margin: 0 0 8px;
    font-family: 'Montserrat', sans-serif; letter-spacing: 0.04em;
    color: transparent;
    background: linear-gradient(135deg, #6bf7ff, #ff79f2);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.ws-modal-sub { color: #c5d4ee; font-size: 0.92em; margin: 0 0 14px; line-height: 1.55; }
.ws-modal-actions {
    display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
}
.ws-modal .btn-primary {
    background: linear-gradient(135deg, #6bf7ff, #ff79f2); color: #1a0a30; border: none;
    padding: 10px 18px; border-radius: 999px; font-weight: 800; cursor: pointer; width: auto;
    font-family: 'Montserrat', sans-serif; letter-spacing: 0.04em;
}
.ws-modal .btn-primary:hover { filter: brightness(1.08); }
.ws-modal .btn-ghost {
    background: transparent; color: #c5d4ee;
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 9px 16px; border-radius: 999px; font-weight: 700; cursor: pointer; width: auto;
    font-family: inherit;
}
.ws-modal .btn-ghost:hover { border-color: #ff79f2; color: #fff; }
.ws-modal .btn-danger-cta {
    background: linear-gradient(135deg, #ff5a7a, #ff79f2); color: #fff; border: none;
    padding: 10px 18px; border-radius: 999px; font-weight: 800; cursor: pointer; width: auto;
    font-family: 'Montserrat', sans-serif; letter-spacing: 0.04em;
}
.ws-modal .btn-danger-cta:hover { filter: brightness(1.08); }

/* ===== Themes modal ===== */
.wsb-themes-modal { max-width: 560px; }
.wsb-themes-save-row {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    margin-top: 8px;
}
.wsb-themes-save-row input[type="text"] {
    flex: 1; min-width: 200px;
    background: rgba(13, 18, 34, 0.7);
    border: 1px solid rgba(107, 247, 255, 0.3);
    color: #fff;
    padding: 10px 14px; border-radius: 999px;
    font-family: inherit; font-size: 0.92em;
}
.wsb-themes-save-row .btn-primary { padding: 9px 16px; }
.wsb-themes-list {
    display: grid; gap: 8px;
    max-height: 280px; overflow-y: auto;
    padding-right: 4px;
}
.wsb-theme-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center; gap: 10px;
    padding: 10px 12px;
    background: rgba(15, 24, 60, 0.55);
    border: 1px solid rgba(107, 247, 255, 0.18);
    border-radius: 12px;
}
.wsb-theme-meta { display: flex; flex-direction: column; min-width: 0; }
.wsb-theme-meta strong { color: #fff; font-size: 1em; }
.wsb-theme-sub { color: #9aa6c0; font-size: 0.78em; margin-top: 2px; }
.wsb-theme-row .wsb-btn-primary { padding: 6px 12px; font-size: 0.78em; }
.wsb-theme-row .wsb-btn-ghost { padding: 6px 12px; font-size: 0.78em; }
.wsb-theme-row .wsb-theme-del:hover { border-color: #ff5a7a; color: #ff8b9a; }
@media (max-width: 640px) {
    .wsb-theme-row { grid-template-columns: 1fr; }
    .wsb-theme-row .wsb-btn-primary, .wsb-theme-row .wsb-btn-ghost { width: 100%; }
}
