/* ============================================================
   rarebaijiu.com — Premium Dark Gallery Design System
   Crown-themed Aesthetic with Gold & Deep Dark Palette
   ============================================================ */

/* ── 1. CSS Custom Properties ──────────────────────────────── */
:root {
    --brand-gold: #C9A84C;
    --brand-gold-light: #F0D080;
    --brand-gold-dark: #A07828;
    --brand-rose: #C96A8A;
    --brand-violet: #7C3AED;
    --bg-page: #0A0A0F;
    --bg-surface: #12121A;
    --bg-card: #1A1A26;
    --bg-navbar: rgba(10, 10, 15, 0.95);
    --bg-modal: #13131F;
    --bg-glass: rgba(201, 168, 76, 0.06);
    --bg-glass-hover: rgba(201, 168, 76, 0.12);
    --bg-overlay: rgba(0, 0, 0, 0.75);
    --text-primary: #F0EAD6;
    --text-secondary: #A89878;
    --text-muted: #937f65;
    --text-gold: #C9A84C;
    --border-subtle: rgba(201, 168, 76, 0.12);
    --border-card: rgba(201, 168, 76, 0.2);
    --border-glow: rgba(201, 168, 76, 0.45);
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.5);
    --shadow-card-hover: 0 12px 48px rgba(201, 168, 76, 0.2);
    --shadow-navbar: 0 2px 20px rgba(0, 0, 0, 0.6);
    --shadow-glow-gold: 0 0 30px rgba(201, 168, 76, 0.3);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;
    --space-2xl: 64px;
    --font-body: 'Inter', sans-serif;
    --font-display: 'Outfit', sans-serif;
    --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-base: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    --z-nav: 100;
    --z-modal: 200;
}

/* ── 2. Reset & Base ────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    background: var(--bg-page);
}

body {
    font-family: var(--font-body);
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100dvh;
    padding-top: 10px;
    padding-bottom: 120px;
    display: flex;
    flex-direction: column;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

ul,
ol {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input::placeholder,
textarea::placeholder {
    font-size: 14px;
    /* Does NOT trigger the zoom issue */
}

/* ── 3. NAVBAR ──────────────────────────────────────────────── */
.cb-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-lg);
    background: var(--bg-navbar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: var(--z-nav);
    box-shadow: var(--shadow-navbar);
    display: none !important;
}

.cb-navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
}

.cb-brand-crown {
    font-size: 1.5rem;
    line-height: 1;
    filter: drop-shadow(0 0 8px rgba(201, 168, 76, 0.6));
    animation: crownFloat 3s ease-in-out infinite;
}

@keyframes crownFloat {

    0%,
    100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-3px)
    }
}

.cb-brand-name {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--brand-gold-light), var(--brand-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.01em;
}

.cb-navbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.cb-nav-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
    font-size: 1rem;
    position: relative;
}

.cb-nav-icon-btn:hover {
    color: var(--brand-gold);
    background: var(--bg-glass-hover);
    border-color: var(--border-glow);
    box-shadow: 0 0 16px rgba(201, 168, 76, 0.25);
    transform: translateY(-1px);
}

.cb-nav-icon-btn .btn-tooltip {
    position: absolute;
    bottom: -34px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.68rem;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    border: 1px solid var(--border-subtle);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
    z-index: 10;
}

.cb-nav-icon-btn:hover .btn-tooltip {
    opacity: 1;
}

/* ── 4. LAYOUT SWITCHER BAR ─────────────────────────────────── */
.cb-layout-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-lg) var(--space-md) var(--space-md);
    position: sticky;
    /* top: 60px; */
    z-index: 50;
    /* margin-bottom: 50px; */
    background: linear-gradient(to bottom, var(--bg-page) 80%, transparent);
}

@media (max-width: 768px) {

    /* .cb-layout-bar {
        padding-right: 80px;
        gap: 6px;
    } */
    .cb-layout-btn {
        width: 34px !important;
        height: 34px !important;
        font-size: 0.8rem !important;
    }

    #layoutBtnCrown {
        display: none !important;
    }
}

@media (min-width: 769px) {
    #layoutBtnCircleGrid {
        display: none !important;
    }
}

.cb-layout-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-base);
    font-size: 0.95rem;
    position: relative;
}

.cb-layout-btn::after {
    display: none;
}

.cb-layout-btn:hover {
    color: var(--brand-gold);
    border-color: var(--border-glow);
    background: var(--bg-glass-hover);
    transform: scale(1.08);
}

.cb-layout-btn.active {
    color: var(--brand-gold);
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.15), rgba(201, 168, 76, 0.05));
    border-color: var(--brand-gold);
    box-shadow: 0 0 20px rgba(201, 168, 76, 0.25);
}

/* Crown emoji button */
.cb-layout-btn .crown-emoji {
    font-size: 1.1rem;
}

/* ── 5. GALLERY SECTION ─────────────────────────────────────── */
.cb-gallery-section {
    padding: var(--space-lg) var(--space-md) var(--space-2xl);
    min-height: 60dvh;
    flex: 1;
}

.cb-gallery-container {
    max-width: 1100px;
    margin: 0 auto;
}

/* [Grid/Circle View Disabled - Needed Later]
/* ── 6. LAYOUT: GRID ────────────────────────────────────────── * /
.cb-gallery.layout-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
}

@media (max-width: 600px) {
    .cb-gallery.layout-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
*/

/* ── 6.5 LAYOUT: CIRCLE GRID ────────────────────────────────────── */
.cb-gallery.layout-circle-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 0 10px;
}

.cb-gallery.layout-circle-grid .cb-img-item {
    aspect-ratio: 1/1;
    border-radius: 50%;
    border: 3px solid var(--border-card);
}

.cb-gallery.layout-circle-grid .cb-img-item:hover {
    border-color: var(--brand-gold);
    box-shadow: var(--shadow-glow-gold);
    z-index: 10;
}

@media (max-width: 600px) {
    .cb-gallery.layout-circle-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* ── 7. LAYOUT: CROWN ─────────────────────────────────────────────
   The Crown SVG is used as the background (600x600 container).
   10 images (all exactly the same size: 80x80) are positioned
   inside the crown shape perfectly matching the requested layout.
────────────────────────────────────────────────────────────────── */
.cb-gallery.layout-crown {
    position: relative;
    width: 100%;
    margin: 40px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 80px;
}

.cb-crown-wrapper {
    position: relative;
    width: 600px;
    height: 520px;
    margin: 0 auto;
}

/*
   Extra crown wrappers (the 19th+ item triggers a new chunk so the
   18-position nth-of-type rules stay aligned). Needs the same
   dimensions as the base wrapper, plus generous spacing so the
   shape doesn't bleed into the previous crown or the footer.
*/
.cb-crown-wrapper.cb-crown-extra {
    margin-top: 120px;
    margin-bottom: 80px;
    padding-bottom: 40px;
}


/* ── Crown SVG backdrop ── */
.cb-crown-svg-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    pointer-events: none;
    z-index: 0;
    user-select: none;
    filter: drop-shadow(0 0 15px rgba(201, 168, 76, 0.2));
}

/* ══════════════════════════════════════════════════════════════
   EXACT POSITIONS FOR 18 IMAGES (Completely INSIDE the crown)
   Based on SVG viewBox 0 0 24 24 mapped to 600x600 (1 unit = 25px)
   Image size: 56x56 (offset -28px from center) to ensure they 
   don't extend outside the gold shape even at the sharp tips!
════════════════════════════════════════════════════════════════ */
.cb-gallery.layout-crown .cb-img-item {
    position: absolute !important;
    aspect-ratio: 1/1 !important;
    border-radius: 50% !important;
    overflow: hidden;
    border: 2px solid rgba(201, 168, 76, 0.5);
    z-index: 2;
    animation: fadeInUp 0.4s ease both;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center center;
    pointer-events: auto !important;
}

.cb-gallery.layout-crown .cb-img-item:hover {
    z-index: 10 !important;
    box-shadow: 0 0 16px rgba(201, 168, 76, 0.8) !important;
    border-color: var(--brand-gold) !important;
    filter: brightness(1.1);
}


/* ── Responsive: scale the crown down on smaller screens ── */
@media (max-width: 680px) {
    .cb-gallery.layout-crown {
        left: 50%;
        margin-left: -300px;
        transform: scale(0.6);
        transform-origin: top center;
        /* height: 360px; */
        margin-bottom: 0;
    }
}

@media (max-width: 420px) {
    .cb-gallery.layout-crown {
        left: 50%;
        margin-left: -300px;
        transform: scale(0.48);
        /* height: 288px; */
    }
}

/* [Grid/Circle View Disabled - Needed Later]
/* ── 8. LAYOUT: CIRCLE ──────────────────────────────────────── * /
.cb-gallery.layout-circle {
    position: relative;
    width: 680px;
    max-width: 100%;
    /* height: 480px; * /
    margin: 0 auto;
}

.cb-gallery.layout-circle .cb-img-item {
    position: absolute;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--border-card);
}
*/

/* ── 8. LAYOUT: GRID ────────────────────────────────────────── */
.cb-gallery.layout-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 600px) {
    .cb-gallery.layout-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── 9. LAYOUT: CASCADE ─────────────────────────────────────── */
.cb-gallery.layout-cascade {
    columns: 3;
    column-gap: 8px;
}

.cb-gallery.layout-cascade .cb-img-item {
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    break-inside: avoid;
    width: 100%;
    margin-bottom: 8px;
    border-radius: 6px;
    overflow: hidden;
}

/* Allow actual images to display at their natural aspect ratio to prevent cropping */
.cb-gallery.layout-cascade .cb-img-item:not(.cb-seed) {
    aspect-ratio: auto !important;
}

/* Keep seeds at 3:4 so the initial skeleton doesn't collapse */
.cb-gallery.layout-cascade .cb-img-item.cb-seed {
    aspect-ratio: 3 / 4;
}

@media (max-width: 600px) {
    .cb-gallery.layout-cascade {
        columns: 3;
    }
}

/* ── 10. LAYOUT: DIAMOND ────────────────────────────────────── */
.cb-gallery.layout-diamond {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
    width: 880px;
    /* 4 items per row, 220px each */
    max-width: 100%;
    margin: 20px auto;
    padding-bottom: 60px;
    padding-top: 20px;
}

.cb-gallery.layout-diamond .cb-img-item {
    width: 150px;
    height: 150px;
    margin: -20px 35px;
    /* -40px vertical, 70px horizontal for perfect nesting */
    transform: rotate(45deg) !important;
    overflow: hidden;
    border-radius: 12px;
    border: 3px solid var(--border-card);
    transition: all var(--transition-base);
    cursor: pointer;
    background: var(--bg-card);
    position: relative;
}

/* Stagger every second row to create honeycomb/diamond interlock */
/* Desktop (4-3-4-3): 4 items (880px), 5th item pushes over */
.cb-gallery.layout-diamond .cb-img-item:nth-child(7n + 5) {
    margin-left: 145px;
    /* 35px base margin + 110px shift */
}

/* Tablet (3-2-3-2): max 920px screen */
@media (max-width: 920px) {
    .cb-gallery.layout-diamond {
        width: 660px;
    }

    .cb-gallery.layout-diamond .cb-img-item:nth-child(7n + 5) {
        margin-left: 35px;
    }

    /* reset */
    .cb-gallery.layout-diamond .cb-img-item:nth-child(5n + 4) {
        margin-left: 145px;
    }
}

/* Mobile (1-2-1-2): max 700px screen */
@media (max-width: 700px) {
    .cb-gallery.layout-diamond {
        width: 310px;
        justify-content: center;
    }

    .cb-gallery.layout-diamond .cb-img-item {
        width: 110px;
        height: 110px;
        margin: -14px 20px;
        /* Safe scaled down nesting margins */
    }

    /* Reset all desktop/tablet shifts */
    .cb-gallery.layout-diamond .cb-img-item:nth-child(n) {
        margin: -14px 20px;
    }

    /* Symmetrical large margins force the single item onto its own row, perfectly centered */
    .cb-gallery.layout-diamond .cb-img-item:nth-child(3n + 1) {
        margin: -14px 80px;
    }
}

.cb-gallery.layout-diamond .cb-img-item img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 145%;
    height: 145%;
    max-width: none;
    object-fit: cover;
    transform: translate(-50%, -50%) rotate(-45deg);
    transition: transform var(--transition-slow);
    margin: 0;
}

.cb-gallery.layout-diamond .cb-img-item:hover {
    transform: rotate(45deg) scale(1.1) !important;
    border-color: var(--brand-gold);
    box-shadow: var(--shadow-glow-gold);
    z-index: 10;
}

.cb-gallery.layout-diamond .cb-img-item:hover img {
    transform: translate(-50%, -50%) rotate(-45deg) scale(1.1);
}

/* ── 11. IMAGE ITEM BASE ────────────────────────────────────── */
.cb-img-item {
    cursor: pointer;
    overflow: hidden;
    position: relative;
    aspect-ratio: 3/4;
    background: var(--bg-card);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.cb-img-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-slow);
}

.cb-img-item:hover img {
    transform: scale(1.06);
}

.cb-img-item .cb-img-hover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-base);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 16px;
}

.cb-img-item:hover .cb-img-hover-overlay {
    opacity: 1;
}

.cb-img-hover-overlay .cb-hover-icons {
    display: flex;
    gap: 12px;
}

.cb-img-hover-overlay .cb-hover-icons span {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.cb-img-hover-overlay .cb-hover-icons span:hover {
    background: rgba(201, 168, 76, 0.3);
    border-color: var(--brand-gold);
    color: var(--brand-gold);
    transform: scale(1.12);
}

/* [Grid/Circle View Disabled - Needed Later]
.cb-gallery.layout-grid .cb-img-item:hover {
    box-shadow: 0 0 0 2px var(--brand-gold), var(--shadow-card-hover);
    z-index: 2;
}
*/

/* Fade-in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

/* ── Seed placeholder (filled until first API batch arrives) ── */
/*
   Shimmer loading effect for the 18 seed items that paint the crown
   silhouette on first load. Mirrors the followsocials.org
   `@keyframes sk-shimmer` + `.sk-shimmer` pattern (background-position
   sweep across a 3-stop gradient) but tuned to the Rarebaijiu gold
   palette.

   The dark interior of `images/crown-12.png` made a subtle shimmer
   disappear, so the peak highlight is now bright (0.75 alpha) and
   the sweep layer is sized to 220% so it visibly travels across
   each circle. A gold halo dropshadow pulses with each seed so the
   crown's empty interior glows while loading.

   IMPORTANT: The selector must include `.cb-gallery.layout-crown`
   to outrank the layout's own `.cb-img-item { animation: fadeInUp … }`
   rule (specificity 0,3,0 vs our 0,2,0). Without it, the layout's
   fadeInUp wins and the seed freezes at `opacity:0` from its
   `from` keyframe.
*/
@keyframes cb-shimmer {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

@keyframes cb-seed-pulse {

    0%,
    100% {
        border-color: rgba(201, 168, 76, 0.30);
        box-shadow: 0 0 0 rgba(201, 168, 76, 0);
    }

    50% {
        border-color: rgba(201, 168, 76, 0.85);
        box-shadow: 0 0 14px rgba(201, 168, 76, 0.45);
    }
}

/* Base seed rule: specificity 0,4,0 beats the layout's 0,3,0. */
.cb-gallery.layout-crown .cb-img-item.cb-seed,
.cb-gallery.layout-cascade .cb-img-item.cb-seed,
.cb-gallery.layout-diamond .cb-img-item.cb-seed,
.cb-gallery.layout-circle-grid .cb-img-item.cb-seed {
    /* Three layers stacked: warm wash at the bottom, a clear bright
       highlight band sweeping across (the shimmer), and an inner
       radial vignette so the seed has volume. The sweep layer is
       220% wide so the highlight clearly travels from one side of
       the circle to the other instead of repeating invisibly. */
    background:
        radial-gradient(ellipse at center,
            rgba(201, 168, 76, 0.22) 0%,
            rgba(201, 168, 76, 0.06) 70%,
            rgba(201, 168, 76, 0.02) 100%),
        linear-gradient(90deg,
            transparent 0%,
            rgba(255, 235, 190, 0.20) 30%,
            rgba(255, 240, 200, 0.75) 50%,
            rgba(255, 235, 190, 0.20) 70%,
            transparent 100%),
        linear-gradient(160deg,
            rgba(201, 168, 76, 0.20) 0%,
            rgba(201, 168, 76, 0.05) 100%);
    background-size: 100% 100%, 220% 100%, 100% 100%;
    background-repeat: no-repeat, no-repeat, no-repeat;
    background-position: center, 100% 0, center;
    border: 2px solid rgba(201, 168, 76, 0.30);
    opacity: 1;
    /* Faster shimmer (1.2s) + a slightly slower border pulse so
       the two effects feel layered instead of synced. The
       `animation-name` shorthand resets the layout's `fadeInUp`,
       which is what was killing the shimmer before. */
    animation: cb-shimmer 1.2s linear infinite,
        cb-seed-pulse 2.0s ease-in-out infinite;
}

/* Per-seed animation phase so they don't all shimmer in sync —
   gives the crown a more organic "loading" feel. Specificity
   matches the base seed rule so the per-index overrides win. */
.cb-gallery.layout-crown .cb-img-item.cb-seed:nth-of-type(1),
.cb-gallery.layout-crown .cb-img-item.cb-seed:nth-of-type(7),
.cb-gallery.layout-crown .cb-img-item.cb-seed:nth-of-type(13) {
    animation-delay: 0.00s, 0.0s;
}

.cb-gallery.layout-crown .cb-img-item.cb-seed:nth-of-type(2),
.cb-gallery.layout-crown .cb-img-item.cb-seed:nth-of-type(8),
.cb-gallery.layout-crown .cb-img-item.cb-seed:nth-of-type(14) {
    animation-delay: 0.08s, 0.2s;
}

.cb-gallery.layout-crown .cb-img-item.cb-seed:nth-of-type(3),
.cb-gallery.layout-crown .cb-img-item.cb-seed:nth-of-type(9),
.cb-gallery.layout-crown .cb-img-item.cb-seed:nth-of-type(15) {
    animation-delay: 0.16s, 0.4s;
}

.cb-gallery.layout-crown .cb-img-item.cb-seed:nth-of-type(4),
.cb-gallery.layout-crown .cb-img-item.cb-seed:nth-of-type(10),
.cb-gallery.layout-crown .cb-img-item.cb-seed:nth-of-type(16) {
    animation-delay: 0.24s, 0.6s;
}

.cb-gallery.layout-crown .cb-img-item.cb-seed:nth-of-type(5),
.cb-gallery.layout-crown .cb-img-item.cb-seed:nth-of-type(11),
.cb-gallery.layout-crown .cb-img-item.cb-seed:nth-of-type(17) {
    animation-delay: 0.32s, 0.8s;
}

.cb-gallery.layout-crown .cb-img-item.cb-seed:nth-of-type(6),
.cb-gallery.layout-crown .cb-img-item.cb-seed:nth-of-type(12),
.cb-gallery.layout-crown .cb-img-item.cb-seed:nth-of-type(18) {
    animation-delay: 0.40s, 1.0s;
}

/* Seeds should not flash the hover overlay or zoom. */
.cb-gallery .cb-img-item.cb-seed:hover {
    transform: none;
}

.cb-img-item {
    animation: fadeInUp 0.4s ease both;
}

.cb-img-item:nth-child(1) {
    animation-delay: 0.00s
}

.cb-img-item:nth-child(2) {
    animation-delay: 0.04s
}

.cb-img-item:nth-child(3) {
    animation-delay: 0.08s
}

.cb-img-item:nth-child(4) {
    animation-delay: 0.12s
}

.cb-img-item:nth-child(5) {
    animation-delay: 0.16s
}

.cb-img-item:nth-child(6) {
    animation-delay: 0.20s
}

.cb-img-item:nth-child(7) {
    animation-delay: 0.24s
}

.cb-img-item:nth-child(8) {
    animation-delay: 0.28s
}

.cb-img-item:nth-child(9) {
    animation-delay: 0.32s
}

.cb-img-item:nth-child(10) {
    animation-delay: 0.36s
}

.cb-img-item:nth-child(11) {
    animation-delay: 0.40s
}

.cb-img-item:nth-child(12) {
    animation-delay: 0.44s
}

/* ── 12. LOAD MORE ──────────────────────────────────────────── */
.cb-load-more-wrap {
    text-align: center;
    padding: var(--space-xl) 0 var(--space-lg);
}

.cb-btn-more {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 12px 32px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.15), rgba(201, 168, 76, 0.05));
    border: 1px solid var(--border-glow);
    color: var(--brand-gold);
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    transition: all var(--transition-base);
    cursor: pointer;
}

.cb-btn-more:hover {
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.25), rgba(201, 168, 76, 0.1));
    box-shadow: 0 0 24px rgba(201, 168, 76, 0.3);
    transform: translateY(-2px);
}

.cb-btn-more i {
    transition: transform var(--transition-base);
}

.cb-btn-more:hover i {
    transform: translateY(2px);
}

/* ── 13. CREATOR MODAL ──────────────────────────────────────── */
.cb-modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.cb-modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.cb-modal {
    background: var(--bg-modal);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 460px;
    max-height: 96dvh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(201, 168, 76, 0.1);
    transform: translateY(20px) scale(0.97);
    transition: transform var(--transition-base);
}

.cb-modal-overlay.open .cb-modal {
    transform: translateY(0) scale(1);
}

.cb-modal::-webkit-scrollbar {
    width: 4px
}

.cb-modal::-webkit-scrollbar-track {
    margin-top: 24px;
    margin-bottom: 24px;
    background: transparent;
}

.cb-modal::-webkit-scrollbar-thumb {
    background: var(--border-card);
    border-radius: 4px
}

.cb-modal-header {
    display: flex;
    justify-content: flex-end;
    padding: var(--space-md) var(--space-md) 0;
}

.cb-modal-close {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.cb-modal-close:hover {
    background: rgba(255, 255, 255, 0.12);
}

.cb-modal-tabs {
    display: flex;
    gap: var(--space-xs);
    padding-top: 8px;
    /* padding: 0 var(--space-lg); */
    margin-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
}

.cb-modal-tab {
    flex: 1;
    justify-content: center;
    padding: 10px 18px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
}

.cb-modal-tab:hover {
    color: var(--text-secondary);
}

.cb-modal-tab.active {
    color: var(--brand-gold);
    border-bottom-color: var(--brand-gold);
}

.cb-modal-panel {
    display: none;
    padding: 0 var(--space-md) var(--space-md);
}

.cb-modal-panel.active {
    display: block;
}

/* Profile panel */
.cb-modal-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto var(--space-md);
    display: block;
    border: 3px solid var(--brand-gold);
    box-shadow: 0 0 20px rgba(201, 168, 76, 0.3);
}

.cb-modal-name {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: var(--space-xs);
    background: linear-gradient(135deg, var(--brand-gold-light), var(--brand-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cb-modal-total-followers {
    text-align: center;
    color: var(--brand-gold);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}


.cb-modal-handle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: var(--space-md);
}

.cb-modal-ig-bio {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.35;
    margin: 0 auto var(--space-md);
    max-width: 90%;
    white-space: pre-line;
    text-align: center;
}

.cb-modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    justify-content: center;
    margin-bottom: var(--space-md);
}

.cb-modal-tag {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    background: rgba(201, 168, 76, 0.12);
    border: 1px solid var(--border-subtle);
    color: var(--brand-gold);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.cb-modal-tag:hover {
    background: rgba(201, 168, 76, 0.25);
    border-color: var(--brand-gold);
}

.cb-modal-socials {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.cb-modal-socials a {
    text-decoration: none;
    color: inherit;
}

.cb-modal-social-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
}

.cb-modal-social-item:hover {
    border-color: var(--border-card);
    background: var(--bg-glass);
}

.cb-modal-social-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cb-social-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.si-instagram {
    background: linear-gradient(135deg, #F58529, #DD2A7B, #8134AF);
    color: #fff
}

.si-pinterest {
    background: #E60023;
    color: #fff;
}

.si-tiktok {
    background: #010101;
    color: #fff;
    border: 1px solid #333
}

.si-youtube {
    background: #FF0000;
    color: #fff
}

.si-facebook {
    background: #1877F2;
    color: #fff
}

.si-vk {
    background: #0077FF;
    color: #fff
}

.cb-social-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.cb-social-followers {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--brand-gold);
}

/* ── 14. CHAT PANEL ──────────────────────────────────────────── */
.cb-chat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: var(--space-md);
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    border: 1px solid var(--border-subtle);
}

.cb-chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.cb-chat-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.cb-chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--brand-gold);
}

.cb-chat-online-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #10B981;
    border: 2px solid var(--bg-modal);
}

.cb-chat-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cb-chat-status {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cb-chat-verified {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    color: var(--brand-gold);
    background: rgba(201, 168, 76, 0.1);
    border: 1px solid var(--border-subtle);
    padding: 4px 8px;
    border-radius: var(--radius-full);
}

.cb-otp-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.cb-otp-card-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: var(--space-md);
    color: var(--brand-gold);
}

.cb-otp-card-header i {
    font-size: 1.2rem;
    margin-top: 2px;
}

.cb-otp-card-header h5 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.cb-otp-card-header p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.cb-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 16px;
    font-family: var(--font-body);
    outline: none;
    transition: border-color var(--transition-fast);
    margin-bottom: var(--space-sm);
    appearance: none;
    -webkit-appearance: none;
}

.cb-input:focus {
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.12);
}

.cb-input::placeholder {
    color: var(--text-muted);
}

.cb-btn-otp {
    width: 100%;
    padding: 11px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-dark));
    color: #0A0A0F;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-base);
    border: none;
    cursor: pointer;
}

.cb-btn-otp:hover {
    background: linear-gradient(135deg, var(--brand-gold-light), var(--brand-gold));
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(201, 168, 76, 0.35);
}

.cb-otp-boxes-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 12px 0;
}

.cb-otp-box {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    color: var(--brand-gold);
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: var(--font-display);
    outline: none;
    transition: all var(--transition-fast);
    appearance: none;
    -webkit-appearance: none;
}

.cb-otp-box:focus {
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

.cb-chat-messages::before {
    content: "";
    flex: 1 1 auto;
}

.cb-chat-messages {
    max-height: 260px;
    min-height: 260px;
    overflow-y: auto;
    padding: var(--space-sm) 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.cb-chat-messages::-webkit-scrollbar {
    width: 3px
}

.cb-chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 3px
}

.cb-bubble-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.cb-bubble-row.creator {
    flex-direction: row;
}

.cb-bubble-row.user {
    flex-direction: row-reverse;
}

.cb-bubble-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--brand-gold);
}

.cb-bubble-content {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.82rem;
    line-height: 1.5;
}

.cb-bubble-row.creator .cb-bubble-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: 4px 16px 16px 16px;
}

.cb-bubble-row.user .cb-bubble-content {
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.2), rgba(201, 168, 76, 0.1));
    border: 1px solid var(--border-card);
    color: var(--text-primary);
    border-radius: 16px 4px 16px 16px;
}

.cb-chat-time {
    font-size: 0.67rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

.cb-chat-input-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
    position: relative;
}

.cb-chat-templates-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 1.1rem;
}

.cb-chat-templates-btn:hover {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.cb-chat-input {
    flex: 1;
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 16px;
    font-family: var(--font-body);
    outline: none;
    transition: border-color var(--transition-fast);
    appearance: none;
    -webkit-appearance: none;
}

.cb-chat-input:focus {
    border-color: var(--brand-gold);
}

.cb-chat-input::placeholder {
    color: var(--text-muted);
}

.cb-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-dark));
    color: #0A0A0F;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    border: none;
    cursor: pointer;
}

.cb-chat-send:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 14px rgba(201, 168, 76, 0.4);
}

.cb-chat-chips {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    margin: 0;
    padding: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 360px;
    width: max-content;
    max-width: calc(100vw - 40px);
    overflow-y: auto;
    z-index: 20;
    scrollbar-width: thin;
}

.cb-chat-chips.show {
    display: flex;
}

.cb-chat-chip {
    white-space: normal;
    text-align: left;
    background: var(--bg-page);
    border: 1px solid var(--border-subtle);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.64rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.cb-chat-chip:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10B981;
    color: #059669;
}

.cb-otp-sent-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    font-size: 0.8rem;
    color: #10B981;
}

.cb-otp-change-btn {
    font-size: 0.75rem;
    color: var(--brand-gold);
    cursor: pointer;
    text-decoration: underline;
    background: none;
    border: none;
}

.cb-otp-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 6px;
}

/* ── 15. LOGIN DROPDOWN MODAL ───────────────────────────────── */
.cb-login-modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: calc(var(--z-modal) + 10);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.cb-login-modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.cb-login-modal {
    background: var(--bg-modal);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-xl);
    width: 290px;
    padding: var(--space-lg);
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.7);
    transform: translateY(-10px) scale(0.96);
    opacity: 0;
    transition: all var(--transition-base);
    pointer-events: none;
}

.cb-login-modal-overlay.open .cb-login-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

.cb-login-modal h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cb-login-modal h4 i {
    color: var(--brand-gold);
}

.cb-login-error {
    display: none;
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(220, 38, 38, 0.1);
    color: #EF4444;
    border-radius: var(--radius-md);
    font-size: 0.78rem;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.cb-login-field {
    margin-bottom: 12px;
}

.cb-login-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.cb-login-btn {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-dark));
    color: #0A0A0F;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-base);
    border: none;
    cursor: pointer;
    margin-top: var(--space-md);
}

.cb-login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(201, 168, 76, 0.35);
}

/* ── 16. PARTICLES ──────────────────────────────────────────── */
.cb-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.cb-particle {
    position: absolute;
    border-radius: 50%;
    background: var(--brand-gold);
    opacity: 0;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(100dvh) rotate(0deg)
    }

    10% {
        opacity: 0.25
    }

    90% {
        opacity: 0.05
    }

    100% {
        opacity: 0;
        transform: translateY(-100px) rotate(360deg)
    }
}

/* ── 16.5 SUPPORT CHAT MODAL (DARK THEME) ─────────────────── */
.sc-modal {
    background: var(--bg-modal);
    border: 1px solid var(--border-card);
    border-radius: 28px;
    padding: 24px 20px 20px;
    width: 100%;
    max-width: 420px;
    color: var(--text-primary);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
    position: relative;
    font-family: 'Inter', sans-serif;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cb-login-modal-overlay.open .sc-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.sc-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--border-subtle);
    transition: all 0.2s ease;
}

.sc-close-btn:hover {
    background: var(--bg-card);
}

.sc-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 20px;
    padding-right: 32px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 20px;
}

.sc-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-gold-light), var(--brand-gold));
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    position: relative;
    flex-shrink: 0;
}

.sc-online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #10B981;
    border: 2px solid var(--bg-modal);
    border-radius: 50%;
}

.sc-header-info {
    min-width: 0;
    flex: 1;
}

.sc-header-info h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-header-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-status-dot {
    width: 8px;
    height: 8px;
    background: #10B981;
    border-radius: 50%;
}

.sc-badge-official {
    margin-left: auto;
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Chat user sign-out is now exposed via the navbar button
   (#btnChatUserLogout, right after the helpline button) — see
   styles.css .cb-side-btn rules. The earlier in-modal
   .sc-header-signout selector was removed along with the
   button it styled. */

.sc-chat-area {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sc-chat-area::before {
    content: "";
    flex: 1 1 auto;
}


.sc-message-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.sc-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-surface);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
    border: 1px solid var(--border-subtle);
}

.sc-msg-avatar i {
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.1);
}

.sc-message-bubble {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 16px;
    border-radius: 16px 16px 16px 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sc-message-bubble p {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.sc-message-row.user {
    flex-direction: row-reverse;
}

.sc-message-row.user .sc-message-bubble {
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.2), rgba(201, 168, 76, 0.1));
    border: 1px solid var(--border-card);
    color: var(--text-primary);
    border-radius: 16px 4px 16px 16px;
}

.sc-message-bubble p:last-of-type {
    margin-bottom: 8px;
}

.sc-time {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: right;
    font-weight: 500;
}

.sc-verification-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-card);
    border-radius: 20px;
    padding: 20px;
}

.sc-vc-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.sc-vc-icon {
    position: relative;
    color: #10B981;
    font-size: 2.2rem;
    line-height: 1;
    margin-top: 2px;
}

.sc-vc-icon-check {
    position: absolute;
    bottom: -2px;
    right: -6px;
    font-size: 1.1rem;
    background: var(--bg-surface);
    border-radius: 50%;
    border: 3px solid var(--bg-surface);
}

.sc-vc-title h4 {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.sc-vc-title p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.sc-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 16px;
    color: var(--text-primary);
    outline: none;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

.sc-input:focus {
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.2);
}

.sc-input::placeholder {
    color: var(--text-muted);
}

.sc-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--brand-gold-light), var(--brand-gold));
    color: #000;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(201, 168, 76, 0.25);
}

.sc-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(201, 168, 76, 0.4);
}

/* ── 17. FOOTER ─────────────────────────────────────────────── */
.cb-footer {
    text-align: center;
    padding: var(--space-md);
    color: var(--text-muted);
    font-size: 0.8rem;
    position: fixed;
    bottom: -150px;
    /* Hide below viewport without transform to avoid Safari bugs */
    left: 0;
    width: 100%;
    z-index: 50;
    background: var(--bg-page);
    transition: bottom 0.3s ease-in-out;
}

.cb-footer.show-footer {
    bottom: 0;
}

/* Fix iOS Safari glitch: hide fixed footer when virtual keyboard is open */
@media (max-width: 768px) {

    body:has(input:focus) .cb-footer,
    body:has(textarea:focus) .cb-footer {
        display: none !important;
    }
}


.cb-footer .logo {
    height: 30px;
    margin: auto;
    margin-bottom: var(--space-xs);
}

.cb-footer-brand {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--brand-gold-light), var(--brand-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: var(--space-xs);
}

.cb-creator-count-wrapper {
    margin: 4px 0 6px 0;
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 5px;
}


.cb-creator-count {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--brand-gold-light), var(--brand-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.cb-creator-label {
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    margin-top: 4px;
}

/* ── 18. RESPONSIVE ─────────────────────────────────────────── */
@media (max-width:480px) {
    .cb-navbar {
        padding: 0 var(--space-md);
    }

    .cb-brand-name {
        font-size: 1.1rem;
    }

    .cb-gallery-section {
        padding: var(--space-md) var(--space-xs) var(--space-xl);
    }

    .cb-modal {
        border-radius: var(--radius-lg);
    }

    .cb-login-modal-overlay {
        padding: 40px var(--space-sm) 0;
    }

    .cb-login-modal {
        width: calc(100vw - 24px);
    }
}

::-webkit-scrollbar {
    width: 6px
}

::-webkit-scrollbar-track {
    background: transparent
}

::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 6px
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-card)
}

/* ── PAGE LOADER ─────────────────────────────────────────────── */
.cb-page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-page);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.cb-page-loader.cb-loaded {
    opacity: 0;
    visibility: hidden;
}

.cb-loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.cb-loader-icon {
    font-size: 3rem;
    color: var(--brand-gold);
    animation: loaderPulse 1.5s infinite ease-in-out;
    filter: drop-shadow(0 0 15px rgba(201, 168, 76, 0.4));
}

.cb-loader-text {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--brand-gold-light);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    animation: loaderFade 1.5s infinite ease-in-out;
}

@keyframes loaderPulse {
    0% {
        transform: scale(0.9);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
        filter: drop-shadow(0 0 25px rgba(201, 168, 76, 0.8));
    }

    100% {
        transform: scale(0.9);
        opacity: 0.7;
    }
}

@keyframes loaderFade {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

/* ══════════════════════════════════════════════════════════════
   CREATOR MATERIALS MODAL
   Mirrors ceybook's content-materials.php structure but inside a
   Rarebaijiu-themed modal: upload widget at top, grid of own
   materials below.
══════════════════════════════════════════════════════════════ */
.cb-materials-modal,
.cb-workspace-small {
    background: var(--bg-modal);
    border: 1px solid var(--border-card);
    border-radius: 24px;
    padding: 24px;
    width: 100%;
    max-width: 760px;
    max-height: 88dvh;
    overflow-y: auto;
    color: var(--text-primary);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
    position: relative;
    font-family: var(--font-body);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cb-materials-modal::-webkit-scrollbar-track,
.cb-workspace-small::-webkit-scrollbar-track {
    margin-top: 24px;
    margin-bottom: 24px;
    background: transparent;
}

.cb-login-modal-overlay.open .cb-materials-modal,
.cb-login-modal-overlay.open .cb-workspace-small {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Small / compact mode for the workspace modal — used when
   showing the login or change-password sub-views. Mirrors the
   original .cb-login-modal dropdown proportions (290-340px) so
   the input fields look like the original creator-login form
   rather than a giant materials-modal form. */
.cb-workspace-small {
    max-width: 380px;
    padding: 20px;
}

.cb-workspace-small #cbWorkspaceViewLogin,
.cb-workspace-small .cb-workspace-pw {
    max-width: 340px;
    width: 100%;
    margin: 0 auto;
}

.cb-materials-modal .cb-modal-close,
.cb-workspace-small .cb-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
}

.cb-materials-modal .cb-modal-close:hover,
.cb-workspace-small .cb-modal-close:hover {
    color: var(--brand-gold);
    border-color: var(--brand-gold);
}

.cb-mat-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding-right: 44px;
}

.cb-mat-hero .cb-mat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand-gold-light), var(--brand-gold));
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(201, 168, 76, 0.25);
}

.cb-mat-hero h2 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-weight: 800;
}

.cb-mat-hero p {
    margin: 2px 0 0;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* Upload card */
.cb-mat-upload-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 18px;
    margin-top: 45px;
}

.cb-mat-drop {
    border: 2px dashed var(--border-subtle);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-card);
}

.cb-mat-drop:hover {
    border-color: var(--brand-gold);
    background: rgba(201, 168, 76, 0.06);
}

.cb-mat-drop.dragging {
    border-color: var(--brand-gold);
    background: rgba(201, 168, 76, 0.12);
}

.cb-mat-drop i {
    font-size: 28px;
    color: var(--brand-gold);
    margin-bottom: 6px;
    display: block;
}

.cb-mat-drop p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.cb-mat-drop small {
    display: block;
    margin-top: 4px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ── File preview row (shows after a file is picked) ───────── */
.cb-mat-file-preview {
    display: none;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-subtle);
    border-radius: 12px;
    padding: 10px 12px;
    margin-top: 10px;
}

.cb-mat-file-preview.visible {
    display: flex;
}

.cb-mat-file-preview-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.18), rgba(201, 168, 76, 0.08));
    color: var(--brand-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.cb-mat-file-info {
    flex: 1;
    min-width: 0;
}

.cb-mat-file-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cb-mat-file-size {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cb-mat-file-clear {
    background: none;
    border: none;
    cursor: pointer;
    color: #dc2626;
    font-size: 15px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}

.cb-mat-file-clear:hover {
    background: rgba(220, 38, 38, 0.10);
}

/* ── Upload progress bar (followsocials fcr-progress pattern) ──
   The bar has a label INSIDE the fill (e.g. "45%") and a status
   line BELOW it (e.g. "Uploading to storage…"). */
.cb-mat-progress {
    display: none;
    margin-top: 12px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-subtle);
    border-radius: 12px;
    padding: 9px 12px;
}

.cb-mat-progress.active {
    display: block;
}

.cb-mat-progress-bar-bg {
    height: 7px;
    background: var(--bg-surface);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

.cb-mat-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--brand-gold-light), var(--brand-gold));
    color: #000;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.25s ease;
    border-radius: 10px;
    min-width: 2.5em;
    text-align: center;
}

.cb-mat-progress-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
}

/* ── 4-digit OTP boxes (cb-cpw-otp-box) ───────────────────── */
.cb-cpw-otp-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 6px;
}

.cb-cpw-otp-box {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    color: var(--brand-gold);
    border: 1.5px solid var(--border-subtle);
    border-radius: 10px;
    background: var(--bg-card);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.cb-cpw-otp-box:focus {
    outline: none;
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

.cb-cpw-otp-box.has-value {
    border-color: var(--brand-gold);
    background: var(--bg-surface);
}

.cb-mat-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
}

.cb-mat-form .cb-mat-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cb-mat-form label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cb-mat-form input[type=text],
.cb-mat-form textarea {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 16px;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.cb-mat-form input[type=text]:focus,
.cb-mat-form textarea:focus {
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.15);
}

.cb-mat-form textarea {
    resize: vertical;
    min-height: 60px;
}

.cb-mat-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.cb-mat-tag-chip {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.18s ease;
    user-select: none;
}

.cb-mat-tag-chip:hover {
    border-color: var(--brand-gold);
    color: var(--text-primary);
}

.cb-mat-tag-chip.active {
    background: rgba(201, 168, 76, 0.15);
    border-color: var(--brand-gold);
    color: var(--brand-gold);
}

.cb-mat-submit-btn {
    margin-top: 6px;
    background: linear-gradient(135deg, var(--brand-gold-light), var(--brand-gold));
    color: #000;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    font-family: inherit;
}

.cb-mat-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(201, 168, 76, 0.3);
}

.cb-mat-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Phase 10: Consolidated creator workspace ── */
.cb-mat-hero-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
}

.cb-mat-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(201, 168, 76, 0.3);
    background: rgba(201, 168, 76, 0.08);
    color: var(--gold-primary, #c9a84c);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.1s, border-color 0.15s;
    font-size: 0.95rem;
}

.cb-mat-icon-btn:hover {
    background: rgba(201, 168, 76, 0.18);
    border-color: rgba(201, 168, 76, 0.55);
    transform: translateY(-1px);
}

.cb-mat-icon-btn:active {
    transform: translateY(0);
}

.cb-mat-upload-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 12px;
}

.cb-mat-upload-card-header h3 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-weight: 700;
}

.cb-mat-cancel-edit-btn {
    background: transparent;
    border: 1px solid rgba(201, 168, 76, 0.3);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.cb-mat-cancel-edit-btn:hover {
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.35);
}

.cb-mat-login-error,
.cb-mat-login-success {
    margin-top: 10px;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.85rem;
}

.cb-mat-login-hint {
    margin-top: 12px;
    text-align: center;
    color: var(--text-secondary);
}

.cb-mat-login-hint a {
    color: var(--gold-primary, #c9a84c);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* 3-step change-password flow flat layout styles */
.cb-alert-info {
    background: rgba(201, 168, 76, 0.08);
    border-left: 4px solid var(--brand-gold);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    color: var(--text-primary);
    font-size: 12px;
    margin-bottom: 24px;
    margin-top: 12px;
    line-height: 1.4;
}

.cb-alert-info i {
    color: var(--brand-gold);
    font-size: 1.2rem;
    margin-top: 2px;
}

/* Materials grid */
.cb-mat-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.cb-mat-list-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-weight: 700;
}

.cb-mat-list-header .cb-mat-count {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* ── Materials list (row layout, followsocials fcr-mat-row) ──
   Each row: 64×64 thumbnail + meta (date + tag) + description +
   32×32 icon buttons (edit / delete). One row per upload. */
.cb-mat-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cb-mat-row {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-subtle);
    border-radius: 14px;
    align-items: flex-start;
    transition: border-color .15s, box-shadow .15s;
}

.cb-mat-row:hover {
    border-color: var(--brand-gold);
    box-shadow: 0 3px 14px rgba(201, 168, 76, 0.10);
}

.cb-mat-row .cb-mat-thumb {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-gold);
    font-size: 22px;
}

.cb-mat-row .cb-mat-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cb-mat-row .cb-mat-body {
    flex: 1;
    min-width: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: transparent;
}

.cb-mat-row .cb-mat-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 2px;
}

.cb-mat-row .cb-mat-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.cb-mat-row .cb-mat-tag {
    font-size: 0.66rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 20px;
    background: rgba(201, 168, 76, 0.12);
    color: var(--brand-gold);
    border: 1px solid rgba(201, 168, 76, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.cb-mat-row .cb-mat-desc {
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cb-mat-row .cb-mat-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
    border-top: none;
    padding: 0;
}

.cb-mat-row .cb-mat-btn {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    transition: filter .15s, transform .12s, background .15s;
    background: var(--bg-surface);
    color: var(--brand-gold);
}

.cb-mat-row .cb-mat-btn:hover {
    transform: scale(1.08);
}

.cb-mat-row .cb-mat-btn.edit:hover {
    background: rgba(201, 168, 76, 0.15);
}

.cb-mat-row .cb-mat-btn.del {
    background: rgba(220, 38, 38, 0.10);
    color: #dc2626;
}

.cb-mat-row .cb-mat-btn.del:hover {
    background: rgba(220, 38, 38, 0.20);
}

.cb-mat-empty {
    padding: 30px 18px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.88rem;
    border: 1px dashed var(--border-subtle);
    border-radius: 14px;
}

.cb-mat-loading {
    padding: 30px 18px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

/* Edit sub-modal (reuses cb-materials-modal styling) */
.cb-mat-edit-modal {
    max-width: 480px;
}

/* Confirm dialog (delete + password confirm) */
.cb-confirm-modal {
    background: var(--bg-modal);
    border: 1px solid var(--border-card);
    border-radius: 20px;
    padding: 28px;
    width: 100%;
    max-width: 380px;
    color: var(--text-primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    position: relative;
    font-family: var(--font-body);
    text-align: center;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cb-login-modal-overlay.open .cb-confirm-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.cb-confirm-modal .cb-confirm-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.12);
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 16px;
    border: 1px solid rgba(220, 38, 38, 0.25);
}

.cb-confirm-modal h3 {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.cb-confirm-modal p {
    margin: 0 0 22px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.cb-confirm-actions {
    display: flex;
    gap: 10px;
}

.cb-confirm-btn {
    flex: 1;
    padding: 11px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.18s ease;
}

.cb-confirm-btn:hover {
    background: var(--bg-card);
}

.cb-confirm-btn.primary {
    background: linear-gradient(135deg, var(--brand-gold-light), var(--brand-gold));
    border-color: var(--brand-gold);
    color: #000;
}

.cb-confirm-btn.primary:hover {
    box-shadow: 0 6px 16px rgba(201, 168, 76, 0.3);
}

.cb-confirm-btn.danger {
    background: rgba(220, 38, 38, 0.12);
    border-color: rgba(220, 38, 38, 0.35);
    color: #dc2626;
}

.cb-confirm-btn.danger:hover {
    background: rgba(220, 38, 38, 0.18);
}

/* Change-password modal — scoped to BOTH the legacy standalone
   .cb-password-modal AND the in-workspace view, so the same
   styles work whether the modal is opened from the old entry
   points (openChangePasswordModal) or the new workspace
   (cbOpenCreatorWorkspace('changePassword')). */
.cb-password-modal {
    background: var(--bg-modal);
    border: 1px solid var(--border-card);
    border-radius: 24px;
    padding: 24px;
    width: 100%;
    max-width: 420px;
    color: var(--text-primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    position: relative;
    font-family: var(--font-body);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cb-login-modal-overlay.open .cb-password-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.cb-password-modal .cb-modal-close,
.cb-workspace-pw .cb-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cb-password-modal .cb-modal-close:hover,
.cb-workspace-pw .cb-modal-close:hover {
    color: var(--brand-gold);
    border-color: var(--brand-gold);
}

.cb-password-modal .cb-pw-hero,
.cb-workspace-pw .cb-pw-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding-right: 44px;
}

.cb-password-modal .cb-pw-hero-icon,
.cb-workspace-pw .cb-pw-hero-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand-gold-light), var(--brand-gold));
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(201, 168, 76, 0.25);
}

.cb-password-modal h2,
.cb-workspace-pw h2 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-weight: 800;
}

.cb-password-modal .cb-pw-hero-sub,
.cb-workspace-pw .cb-pw-hero-sub {
    margin: 2px 0 0;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.cb-password-modal .cb-pw-field,
.cb-workspace-pw .cb-pw-field {
    margin-bottom: 12px;
}

.cb-password-modal .cb-pw-field label,
.cb-workspace-pw .cb-pw-field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 5px;
}

.cb-password-modal .cb-pw-input-wrap,
.cb-workspace-pw .cb-pw-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.cb-password-modal .cb-pw-input-wrap input,
.cb-workspace-pw .cb-pw-input-wrap input {
    flex: 1;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 11px 44px 11px 14px;
    font-size: 16px;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
    width: 100%;
}

.cb-password-modal .cb-pw-input-wrap input:focus,
.cb-workspace-pw .cb-pw-input-wrap input:focus {
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.15);
}

.cb-password-modal .cb-pw-eye,
.cb-workspace-pw .cb-pw-eye {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px 8px;
    font-size: 0.9rem;
    transition: color 0.18s ease;
}

.cb-password-modal .cb-pw-eye:hover,
.cb-workspace-pw .cb-pw-eye:hover {
    color: var(--brand-gold);
}

.cb-password-modal .cb-pw-submit,
.cb-workspace-pw .cb-pw-submit {
    margin-top: 6px;
    width: 100%;
    background: linear-gradient(135deg, var(--brand-gold-light), var(--brand-gold));
    color: #000;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    font-family: inherit;
}

.cb-password-modal .cb-pw-submit:hover:not(:disabled),
.cb-workspace-pw .cb-pw-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(201, 168, 76, 0.3);
}

.cb-password-modal .cb-pw-submit:disabled,
.cb-workspace-pw .cb-pw-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cb-password-modal .cb-pw-submit.cb-pw-btn-secondary,
.cb-workspace-pw .cb-pw-submit.cb-pw-btn-secondary {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.cb-password-modal .cb-pw-submit.cb-pw-btn-secondary:hover:not(:disabled),
.cb-workspace-pw .cb-pw-submit.cb-pw-btn-secondary:hover:not(:disabled) {
    box-shadow: none;
    transform: none;
    border-color: var(--border-card);
    color: var(--text-primary);
}

.cb-pw-status {
    display: none;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.82rem;
}

.cb-pw-status.error {
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.25);
    display: block;
}

.cb-pw-status-success {
    display: none;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.82rem;
}

.cb-pw-status-success.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.25);
    display: block;
}

/* Step panels (visible one at a time) */
.cb-cpw-step {
    animation: cbFadeIn 0.25s ease;
}

/* .cb-cpw-steps {
    padding: 4px 2px;
} */

.cb-cpw-step h3 {
    margin: 0 0 4px;
    font-size: 0.95rem;
    font-family: var(--font-display);
    color: var(--text-primary);
    font-weight: 800;
}

.cb-cpw-step-hint {
    margin: 0 0 14px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* 4-digit OTP boxes */
.cb-cpw-otp-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 6px;
}

.cb-cpw-otp-box {
    width: 48px;
    height: 56px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    transition: all 0.18s ease;
}

.cb-cpw-otp-box:focus {
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.2);
}

.cb-cpw-otp-box.has-value {
    border-color: var(--brand-gold);
}

@keyframes cbFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Side-panel button visibility toggles */
body[data-creator-mode="1"] .cb-guest-only {
    display: none !important;
}

body:not([data-creator-mode="1"]) .cb-creator-only {
    display: none !important;
}

/* Hide the "Live Chat" tab inside the per-creator popup when a
   creator is signed in. Creators use the Helpline modal for chat
   (handled separately), so the in-creator-popup chat tab has no
   purpose for them. body[data-creator-mode="1"] is set by the PHP
   bootstrap at the top of index.php when cb_jwt decodes to a
   UsrLevel=49 payload, and re-synced by cbRefreshCreatorMode() on
   every state change. */
body[data-creator-mode="1"] #tabChat {
    display: none !important;
}

/* Mobile sizing */
@media (max-width: 640px) {

    .cb-password-modal,
    .cb-confirm-modal {
        max-width: calc(100vw - 24px);
        padding: 18px;
    }

    .cb-mat-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
}

/* Tablet & Mobile Full-Screen Materials Modal */
@media (max-width: 768px) {
    .cb-materials-modal:not(.cb-workspace-small) {
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100dvh;
        max-width: 100vw;
        max-height: 100dvh;
        border-radius: 0;
        border: none;
        margin: 0;
        padding: 20px;
    }

    .cb-materials-modal:not(.cb-workspace-small)::-webkit-scrollbar-track {
        margin-top: 0;
        margin-bottom: 0;
    }

    .cb-materials-modal:not(.cb-workspace-small) .cb-modal-close {
        right: 20px;
        top: 20px;
    }
}

/* ── ALL MODALS CENTERED ON DESKTOP (~1/3 WIDTH) & FULLSCREEN ON MOBILE ── */

/* 1) Center and constrain widths on Desktop */
.cb-filter-modal,
.sc-modal,
.cb-modal,
.cb-login-modal,
.cb-materials-modal,
.cb-workspace-small,
.cb-password-modal,
.cb-confirm-modal {
    width: 33.33vw !important;
    min-width: 480px !important;
    max-width: 500px !important;
}

/* 2) Fullscreen only on Mobile views (max-width: 576px) */
@media (max-width: 576px) {

    .cb-login-modal-overlay,
    .cb-modal-overlay {
        align-items: stretch !important;
        justify-content: stretch !important;
        padding: 0 !important;
    }

    .cb-filter-modal,
    .sc-modal,
    .cb-modal,
    .cb-login-modal,
    .cb-materials-modal,
    .cb-workspace-small,
    .cb-password-modal,
    .cb-confirm-modal {
        max-width: 100% !important;
        width: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        min-width: 100% !important;
        border-radius: 0 !important;
        border: none !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        transform: translateY(20px) scale(0.95);
    }

    .cb-login-modal-overlay.open .cb-filter-modal,
    .cb-login-modal-overlay.open .sc-modal,
    .cb-modal-overlay.open .cb-modal,
    .cb-login-modal-overlay.open .cb-login-modal,
    .cb-login-modal-overlay.open .cb-materials-modal,
    .cb-login-modal-overlay.open .cb-workspace-small,
    .cb-login-modal-overlay.open .cb-password-modal,
    .cb-login-modal-overlay.open .cb-confirm-modal {
        transform: translateY(0) scale(1) !important;
    }

    .cb-password-modal,
    .cb-confirm-modal {
        justify-content: center !important;
    }

    /* Ensure flex children within modals can expand */
    .sc-modal #scChatStepActive,
    .sc-modal #scChatStepOtp,
    .cb-modal .cb-modal-panel {
        flex: 1;
        max-height: none !important;
        height: auto !important;
        overflow-y: auto;
    }

    #panelChat.active {
        display: flex !important;
        flex-direction: column;
        overflow-y: hidden !important;
    }

    #cbChatStepActive:not([style*="display: none"]),
    #scChatStepActive:not([style*="display: none"]),
    #cbChatStepOtp:not([style*="display: none"]),
    #scChatStepOtp:not([style*="display: none"]) {
        display: flex !important;
        flex-direction: column;
        flex: 1;
        overflow-y: hidden !important;
    }

    .cb-chat-messages, 
    .sc-chat-area {
        flex: 1;
        max-height: none !important;
        min-height: 0 !important;
    }
}