/**
 * Confidence Talk - Frontend Dashboard CSS
 *
 * Gold Series frontend overrides — relies on gold-series.css for base styles.
 * Only contains frontend-specific overrides and theme compatibility fixes.
 *
 * @package ConfidenceTalk
 */

/* ============================================================
   RESPONSIVE FOUNDATION
   ============================================================
   Fluid type tokens (--ct-fs-h1..--ct-fs-small) + breakpoint
   convention (bp-sm: 480px · bp-md: 768px · bp-lg: 1024px ·
   bp-xl: 1280px) live in admin/css/gold-series.css :root and
   public/css/pages.css :root — both load on every CT surface.
   ============================================================ */

/* ============================================
   DANGER BUTTON — For delete/remove actions
   ============================================ */
.ct-btn-danger {
    background: rgba(231, 76, 60, 0.2) !important;
    border: 1px solid rgba(231, 76, 60, 0.5) !important;
    color: #e74c3c !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}
.ct-btn-danger:hover {
    background: rgba(231, 76, 60, 0.35) !important;
    border-color: #e74c3c !important;
    color: #ff6b6b !important;
}

/* ============================================
   DASHBOARD CONTAINER — Match Admin Panel
   ============================================ */

body.ct-dashboard-active .ct-gold-series {
    max-width: 1400px;
    margin: 24px auto 40px;
    padding: 0;
}

/* Reset wp-admin offset margins on frontend */
body.ct-dashboard-active .ct-top-bar {
    margin-left: 0;
    width: 100%;
}

body.ct-dashboard-active .ct-main-layout {
    margin-left: 0;
    width: 100%;
}

/* Sidebar match admin panel width */
body.ct-dashboard-active .ct-sidebar {
    width: 240px;
    min-width: 240px;
}

/* Nav item match admin panel sizing */
body.ct-dashboard-active .ct-nav-item {
    padding: 10px 14px;
    font-size: 13px;
    gap: 10px;
}

/* Content area match admin panel */
body.ct-dashboard-active .ct-content {
    padding: 24px;
    min-height: 500px;
    background: transparent;
}

/* ============================================
   THEME OVERRIDE FIXES
   ============================================ */

/* Force transparent backgrounds on theme containers only on dashboard pages */
body.ct-dashboard-active .entry-content,
body.ct-dashboard-active .site-content,
body.ct-dashboard-active .content-area,
body.ct-dashboard-active .site-main,
body.ct-dashboard-active .page-content,
body.ct-dashboard-active .post-content,
body.ct-dashboard-active article,
body.ct-dashboard-active .hentry,

/* Dashboard: transparent by default — themes override this via ct-bg-theme- classes */
body.ct-dashboard-active {
    background: transparent;
    background-color: transparent;
}

/* Dashboard: main content wrapper transparent */
body.ct-dashboard-active .ct-site-content {
    background: transparent;
}

/* ============================================
   PROFILE FORM — 2nd Generation Validation
   ============================================ */

/* Required field label indicator */
.ct-field-required label::after {
    content: " *";
    color: #e74c3c;
}

/* Field error state — red border + subtle glow */
.ct-field-error input,
.ct-field-error select,
.ct-field-error textarea {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.2) !important;
    background: rgba(231, 76, 60, 0.05) !important;
}

/* Field valid state — green border */
.ct-field-valid input,
.ct-field-valid select,
.ct-field-valid textarea {
    border-color: #2ecc71 !important;
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.15) !important;
}

/* Error text below field */
.ct-field-error-msg {
    font-size: 11px;
    color: #e74c3c;
    margin-top: 4px;
    display: none;
}
.ct-field-error .ct-field-error-msg {
    display: block;
}

/* Progress bar */
.ct-profile-progress-wrap {
    margin-bottom: 20px;
}
.ct-profile-progress-label {
    font-size: 12px;
    color: rgba(255,255,255,0.55);
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
}
.ct-profile-progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    overflow: hidden;
}

/* ============================================
   MOBILE-FIRST HERO SWITCHER
   ============================================ */
/* Mobile: ≤768px — compact hero carousel. Inactive slides are fully
   hidden (image + text) so no ghost text or broken overlaps show. */
.ct-hero.ct-hero-mobile .ct-hero-bg-slide:not(.ct-active),
.ct-hero.ct-hero-phone .ct-hero-bg-slide:not(.ct-active) {
    opacity: 0 !important;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.45s ease-in-out, visibility 0s linear 0.45s;
}
.ct-hero.ct-hero-mobile .ct-hero-bg-slide.ct-active,
.ct-hero.ct-hero-phone .ct-hero-bg-slide.ct-active {
    visibility: visible;
    transition-delay: 0s;
}
.ct-hero.ct-hero-mobile .ct-hero-bg-image {
    height: 100% !important;
    min-height: 100% !important;
    background-size: cover !important;
    background-position: center 30% !important;
}
.ct-hero.ct-hero-mobile img.ct-hero-bg-image {
    object-fit: cover;
    object-position: center 30%;
}
.ct-hero.ct-hero-mobile .ct-hero-overlay {
    background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.7) 100%) !important;
}
.ct-hero.ct-hero-mobile .ct-hero-slide-text {
    padding: 12px !important;
    max-width: 100% !important;
}
.ct-hero.ct-hero-mobile .ct-hero-name {
    font-size: 22px !important;
    line-height: 1.2 !important;
}
.ct-hero.ct-hero-mobile .ct-hero-era {
    font-size: 13px !important;
}
.ct-hero.ct-hero-mobile .ct-hero-quote {
    font-size: 14px !important;
    line-height: 1.4 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ct-hero.ct-hero-mobile .ct-hero-buttons-bar {
    flex-direction: column;
    gap: 6px;
}
.ct-hero.ct-hero-mobile .ct-hero-buttons-bar .ct-btn {
    width: 100%;
    text-align: center;
}

/* Phone: ≤480px — compact hero; the portrait is kept (not hidden) and the
   overlay is darkened so headline/quote stay legible over the photo. This
   fixes the old text-only rule that made the portrait flash on vanish into
   a dark box on small phones. */
.ct-hero.ct-hero-phone .ct-hero-overlay {
    background: linear-gradient(to bottom, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.78) 100%) !important;
}
.ct-hero.ct-hero-phone .ct-hero-bg-slide {
    background-color: #2C5F6E;
    border-radius: 12px;
    margin-bottom: 8px;
}
.ct-hero.ct-hero-phone .ct-hero-slide-text {
    padding: 16px !important;
    text-align: center;
}
.ct-hero.ct-hero-phone .ct-hero-name {
    font-size: 20px !important;
}
.ct-hero.ct-hero-phone .ct-hero-quote {
    font-size: 13px !important;
    line-height: 1.35 !important;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ct-hero.ct-hero-phone .ct-hero-era {
    font-size: 12px !important;
}

/* Shared pagination dots */
.ct-hero-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 8px 0 16px;
}
.ct-hero-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    border: 2px solid rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.2s ease;
}
.ct-hero-dot.active {
    background: #CD853F;
    border-color: #CD853F;
    transform: scale(1.2);
}
.ct-hero-dot:hover {
    background: rgba(255,255,255,0.6);
}

/* Hero compact mode: ensure wave is visible */
.ct-hero.ct-hero-compact .ct-hero-wave {
    bottom: 0 !important;
}
.ct-profile-progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #CD853F, #2ecc71);
    transition: width 0.6s ease;
    width: 0%;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

#ct-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.ct-toast {
    pointer-events: auto;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    max-width: 380px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.ct-toast.ct-toast-visible {
    transform: translateX(0);
    opacity: 1;
}

.ct-toast.ct-toast-hiding {
    transform: translateX(120%);
    opacity: 0;
}

.ct-toast-success {
    background: #1a2e1a;
    border: 1px solid rgba(46, 204, 113, 0.35);
    color: #2ecc71;
}

.ct-toast-error {
    background: #2e1a1a;
    border: 1px solid rgba(231, 76, 60, 0.35);
    color: #e74c3c;
}

.ct-toast-icon {
    font-size: 18px;
    line-height: 1.3;
    flex-shrink: 0;
}

.ct-toast-text {
    flex: 1;
}

.ct-toast-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}
.ct-toast-close:hover {
    opacity: 1;
}

/* ============================================
   SHAKE ANIMATION
   ============================================ */
@keyframes ct-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.ct-shake {
    animation: ct-shake 0.5s ease-in-out;
}

/* ============================================
   SAVE BUTTON SPINNER
   ============================================ */

.ct-btn-save {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ct-btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ct-spin 0.6s linear infinite;
}

@keyframes ct-spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   FLASH UPDATED FIELD — subtle pulse
   ============================================ */
@keyframes ct-field-flash {
    0% { background: rgba(46, 204, 113, 0.15); }
    100% { background: transparent; }
}

.ct-field-flash {
    animation: ct-field-flash 1.2s ease-out;
}

/* FadeIn animation for chat messages */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   CHAT INTERFACE
   ============================================ */
.ct-chat-container {
    display: flex;
    flex-direction: column;
    height: 600px;
    background: var(--metallic-steel-gradient);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    overflow: hidden;
    position: relative;
}

.ct-chat-container.ct-has-portrait .ct-chat-header,
.ct-chat-container.ct-has-portrait .ct-messages,
.ct-chat-container.ct-has-portrait .ct-chat-input {
    position: relative;
    z-index: 1;
}

.ct-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.ct-chat-title {
    color: #ffffff;
    font-size: var(--ct-fs-h4);
    font-weight: 600;
    line-height: 1.3;
}

.ct-chat-agents {
    display: flex;
    gap: 4px;
}

.ct-chat-agent-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.ct-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ct-message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.ct-message-user {
    align-self: flex-end;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.9);
}

.ct-message-agent {
    align-self: flex-start;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
}

.ct-message-system {
    align-self: center;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    text-align: center;
}

.ct-message .ct-message-text {
    flex: 1;
    min-width: 0;
    font-family: system-ui, -apple-system, 'Segoe UI', 'Noto Sans', 'Noto Naskh Arabic', 'Arial Unicode MS', sans-serif;
    letter-spacing: normal;
    text-transform: none;
    word-spacing: normal;
}

.ct-message .ct-message-time {
    font-size: 9px;
    opacity: 0.5;
    margin-top: 4px;
    text-align: right;
}

.ct-chat-input {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.ct-chat-input .ct-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    box-shadow: none;
}

.ct-chat-input .ct-input:focus {
    border-color: rgba(205, 133, 63, 0.5);
    box-shadow: 0 0 0 3px rgba(205, 133, 63, 0.1);
    background: rgba(255, 255, 255, 0.10);
}

.ct-chat-input .ct-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
    font-weight: 300;
}

/* ============================================
   VOICE PREF TOGGLES (Hear / Auto-listen) ★ v1.9.21
   ============================================ */
.ct-chat-prefs {
    display: inline-flex;
    gap: 6px;
}

.ct-chat-toggle {
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.55);
    font-size: 10px;
    font-weight: 600;
    padding: 4px 11px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
    white-space: nowrap;
    line-height: 1.4;
}

.ct-chat-toggle:hover {
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.08);
}

.ct-chat-toggle[aria-pressed="true"] {
    background: linear-gradient(135deg, #8B4513, #A0522D, #CD853F);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    border-color: rgba(205, 133, 63, 0.6);
}


.ct-chat-container.ct-mode-listen .ct-voice-btn {
    border-color: rgba(74, 143, 160, 0.8);
    box-shadow: 0 0 0 2px rgba(74, 143, 160, 0.25), 0 0 12px rgba(44, 95, 110, 0.45);
}


/* Voice-only mode — completely hide message DOM (no ghost bubbles, no text,
   no gold speaking bar). Pure-audio interaction surface. */
.ct-mode-voice-only .ct-message {
    display: none !important;
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

.ct-mode-voice-only .ct-message-text {
    display: none !important;
    color: transparent !important;
}

.ct-mode-voice-only .ct-message-welcome,
.ct-mode-voice-only .ct-message-return-banner {
    display: none !important;
    opacity: 0 !important;
}

.ct-mode-voice-only .ct-speak-btn {
    display: none !important;
}

/* Kill the gold "speaking" left-bar that chat.js adds while streaming —
   it must never appear in a pure-voice interface. */
.ct-mode-voice-only .ct-message-text.ct-speaking {
    border-left: 0 !important;
    animation: none !important;
}

/* Hide the empty-state / typing indicator visuals in voice-only. */
.ct-mode-voice-only .ct-typing-indicator {
    display: none !important;
}

/* Text-only mode — hide speak buttons */
.ct-mode-text-only .ct-speak-btn {
    display: none !important;
}

/* ============================================
   WELCOME CARD — Greeting messages
   ============================================ */
.ct-message.ct-message-welcome {
    border-left: 3px solid #CD853F;
    background: linear-gradient(135deg, rgba(205, 133, 63, 0.08) 0%, rgba(205, 133, 63, 0.02) 100%) !important;
    position: relative;
    overflow: hidden;
}

.ct-message.ct-message-welcome .ct-message-text {
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.95) !important;
}

.ct-message.ct-message-welcome .ct-message-text strong {
    color: #CD853F;
}

/* ============================================
   FRONTEND BUTTON STYLING
   ============================================ */
.ct-gold-series .ct-btn {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.ct-gold-series .ct-btn-primary {
    background: linear-gradient(135deg, #8B4513, #A0522D, #CD853F);
    border-color: transparent;
    box-shadow: 0 3px 8px rgba(139, 69, 19, 0.35);
}

.ct-gold-series .ct-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(139, 69, 19, 0.45);
}

.ct-gold-series .ct-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

.ct-gold-series .ct-btn-secondary:hover {
    background: rgba(205, 133, 63, 0.2);
    border-color: rgba(205, 133, 63, 0.4);
    color: #fff;
    transform: translateY(-1px);
}

/* Profile save button */
.ct-gold-series .ct-form-group + .ct-btn-primary {
    margin-top: 8px;
}


/* ============================================
   RETURN BANNER
   ============================================ */
.ct-message.ct-message-return-banner {
    max-width: 100%;
    align-self: center;
    text-align: center;
    background: linear-gradient(135deg, rgba(205, 133, 63, 0.1) 0%, rgba(205, 133, 63, 0.03) 100%) !important;
    border: 1px solid rgba(205, 133, 63, 0.25);
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 4px;
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
}

.ct-message.ct-message-return-banner .ct-message-text {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85) !important;
}

/* ============================================
   PORTRAIT LIVING EFFECT
   ============================================ */
.ct-chat-container.ct-has-portrait::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    /* Layer C: portrait background — `cover` fills the tall chat container
       (the portraits are 16:9 landscape) so the image is centered and covers
       the screen instead of leaving empty bands. A subtle background-position
       drift provides the slow motion; transform is reserved for reactions. */
    background-image: var(--ct-portrait-url);
    background-size: cover;
    background-position: 50% 40%;
    background-repeat: no-repeat;
    animation: ctBreathingZoom 50s ease-in-out infinite;
    pointer-events: none;
}

/* Responsive portrait background: serve lighter variants on smaller viewports.
   Desktop keeps the crisp hero (1800w) set on --ct-portrait-url. */
@media screen and (max-width: 768px) {
    .ct-chat-container.ct-has-portrait::before {
        background-image: var(--ct-portrait-url-400w, var(--ct-portrait-url));
    }
}

@media screen and (min-width: 769px) and (max-width: 1199px) {
    .ct-chat-container.ct-has-portrait::before {
        background-image: var(--ct-portrait-url-800w, var(--ct-portrait-url));
    }
}

@keyframes ctBreathingZoom {
    0%, 100% { background-position: 50% 38%; }
    50%      { background-position: 50% 43%; }
}

/* ============================================
   SPEAK BUTTON
   ============================================ */
.ct-speak-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(205, 133, 63, 0.3);
    cursor: pointer;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    color: #cd853f;
    font-size: 13px;
    padding: 0;
    line-height: 1;
}

.ct-speak-btn::before {
    content: '▶';
    display: block;
    line-height: 1;
    transition: transform 0.2s ease;
}

.ct-speak-btn.playing::before {
    content: '⏸';
}

.ct-speak-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #cd853f;
}

.ct-speak-btn:hover::before {
    transform: scale(1.15);
}

.ct-speak-btn:active {
    transform: scale(0.95);
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media screen and (max-width: 768px) {
    .ct-chat-container {
        /* Full-viewport chat on phones: fill the viewport minus the top bar,
           the fixed bottom tab bar and the safe area. dvh = dynamic viewport
           height (URL bar / keyboard aware where supported); vh is the fallback.
           JS (CTChat._fitChatToViewport) fine-tunes with visualViewport. */
        height: calc(100vh - 44px - 64px - env(safe-area-inset-bottom, 0px) - 24px);
        height: calc(100dvh - 44px - 64px - env(safe-area-inset-bottom, 0px) - 24px);
        min-height: 320px;
        border-radius: 12px;
    }

    .ct-message {
        max-width: 90%;
    }

    /* Keep the input above the home-indicator / bottom safe area on phones */
    .ct-chat-input {
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }
}

/* ============================================
   CHAT INPUT AREA — Voice/Text integration
   ============================================ */
.ct-voice-btn {
    border: 1px solid rgba(205, 133, 63, 0.3);
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    height: 40px;
    border-radius: 24px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.ct-voice-btn .ct-voice-icon {
    font-size: 16px;
    line-height: 1;
}

.ct-voice-btn .ct-voice-timer {
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: #ffe;
    opacity: 0;
    min-width: 30px;
    text-align: center;
}

.ct-voice-btn.ct-voice-active .ct-voice-timer {
    opacity: 1;
}

.ct-voice-btn:hover {
    background: rgba(205, 133, 63, 0.15);
    border-color: #CD853F;
}

.ct-voice-btn:active,
.ct-voice-btn.ct-recording,
.ct-voice-btn.ct-voice-active {
    background: rgba(252, 129, 129, 0.2);
    border-color: #e74c3c;
}

.ct-voice-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   TYPING INDICATOR
   ============================================ */
.ct-typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    align-self: flex-start;
    margin-bottom: 4px;
    max-width: 80%;
}

.ct-typing-indicator > span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(205, 133, 63, 0.4);
}

/* ============================================
   WELCOME BANNER — transition out
   ============================================ */
.ct-welcome-banner {
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.ct-welcome-banner.ct-welcome-hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    max-height: 0;
    padding: 0 24px;
    margin-bottom: 0;
    overflow: hidden;
}

/* ========================================================================
   POLISH #1: SCROLLBAR STYLING — Matches Gold Series dark theme
   ======================================================================== */
.ct-messages::-webkit-scrollbar {
    width: 6px;
}

.ct-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ct-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

.ct-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(205, 133, 63, 0.4);
}

/* Firefox scrollbar */
.ct-messages {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

/* ========================================================================
   POLISH #2: SEND BUTTON — Bronze-gold circle with arrow
   ======================================================================== */
#ct-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    line-height: 1;
    flex-shrink: 0;
    border: 1px solid rgba(205, 133, 63, 0.3);
    background: linear-gradient(135deg, #8B4513, #A0522D, #CD853F);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.3);
    position: relative;
}

#ct-send-btn::before {
    content: '➤';
    font-size: 16px;
    color: #fff;
    display: block;
    line-height: 1;
    transition: transform 0.2s ease;
}

#ct-send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 14px rgba(139, 69, 19, 0.5);
}

#ct-send-btn:hover::before {
    transform: translateX(2px);
}

#ct-send-btn:active {
    transform: scale(0.95);
}

#ct-send-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ========================================================================
   POLISH #3: EMPTY STATE — Placeholder when no conversation selected
   ======================================================================== */
.ct-chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 40px 20px;
    text-align: center;
    min-height: 300px;
}

.ct-chat-empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.ct-chat-empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.ct-chat-empty-state-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.5;
    max-width: 280px;
}

.ct-chat-empty-state .ct-chat-empty-state-btn {
    margin-top: 20px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #8B4513, #A0522D, #CD853F);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ct-chat-empty-state .ct-chat-empty-state-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 69, 19, 0.4);
}

/* No conversation selected — show via the empty messages container */
#ct-messages:empty + .ct-chat-input .ct-chat-empty-state {
    display: flex;
}

/* ========================================================================
   POLISH #4: CONVERSATION LIST ITEMS — Modern sidebar entry styling
   ======================================================================== */
.conversation-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    cursor: pointer;
    gap: 10px;
    font-size: 13px;
    border: 1px solid transparent;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    position: relative;
}

.conversation-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
    border-left-color: rgba(205, 133, 63, 0.3);
}

.conversation-item.active {
    background: rgba(205, 133, 63, 0.08);
    border-left-color: #CD853F;
    border-color: rgba(205, 133, 63, 0.15);
}

.conversation-item .conversation-title {
    color: #e8e8e8;
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-item .conversation-date {
    color: rgba(255, 255, 255, 0.35);
    font-size: 11px;
    white-space: nowrap;
    min-width: 85px;
    text-align: right;
}

.conversation-item .conversation-preview {
    display: none;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.conversation-item .conversation-delete-btn {
    opacity: 0;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}

.conversation-item:hover .conversation-delete-btn {
    opacity: 1;
}

/* ========================================================================
   POLISH #5: MESSAGE HOVER ACTIONS — Subtle reveal on hover
   ======================================================================== */
.ct-message {
    transition: background 0.2s ease, border-color 0.2s ease;
}

.ct-message-agent:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.18);
}

.ct-message-user:hover {
    background: rgba(139, 69, 19, 0.18);
    border-color: rgba(205, 133, 63, 0.35);
}

/* Timestamp hidden by default, revealed on hover */
.ct-message .ct-message-time {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ct-message:hover .ct-message-time {
    opacity: 0.7;
}

/* Copy icon appears on hover */
.ct-message .ct-message-copy {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 10px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.ct-message:hover .ct-message-copy {
    opacity: 1;
}

.ct-message .ct-message-copy:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* Make message container relative for absolute positioning */
.ct-message {
    position: relative;
}

/* ========================================================================
   DASHBOARD BACKGROUND THEMES — Controlled via Tools tab dropdown
   Selector: body.ct-dashboard-active.ct-bg-theme-{name}
   ======================================================================== */

/* Background themes applied to the main site-content wrapper */
/* THEME: none — Transparent (default) */
body.ct-dashboard-active.ct-bg-theme-none .ct-site-content,
body.ct-dashboard-active.ct-bg-theme-none .ct-gold-series {
    background: transparent !important;
}

/* THEME: ember — 🔥 Bronze ember particles floating upward */
body.ct-dashboard-active.ct-bg-theme-ember .ct-site-content {
    background: transparent !important;
    position: relative;
}
body.ct-dashboard-active.ct-bg-theme-ember .ct-site-content::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle at 30% 90%, rgba(205, 133, 63, 0.04) 0%, transparent 30%),
        radial-gradient(circle at 70% 95%, rgba(139, 69, 19, 0.06) 0%, transparent 25%),
        radial-gradient(circle at 50% 85%, rgba(218, 165, 32, 0.04) 0%, transparent 35%);
    animation: ctEmberRise 8s ease-in-out infinite;
}
body.ct-dashboard-active.ct-bg-theme-ember .ct-gold-series {
    background: transparent !important;
}
@keyframes ctEmberRise {
    0%   { transform: translateY(0) scale(1); opacity: 0.6; }
    50%  { transform: translateY(-20px) scale(1.05); opacity: 1; }
    100% { transform: translateY(0) scale(1); opacity: 0.6; }
}

/* THEME: shield — 🛡️ Dark center → bronze edge radial gradient */
body.ct-dashboard-active.ct-bg-theme-shield .ct-site-content,
body.ct-dashboard-active.ct-bg-theme-shield .ct-gold-series {
    background: radial-gradient(ellipse at center, #0f172a 0%, #1a1a2e 40%, #16213e 70%, rgba(139, 69, 19, 0.15) 100%) !important;
}

/* THEME: grid — 🌐 Thin bronze grid lines with slow pulse glow */
body.ct-dashboard-active.ct-bg-theme-grid .ct-site-content,
body.ct-dashboard-active.ct-bg-theme-grid .ct-gold-series {
    background:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px) !important;
    background-size: 40px 40px !important;
    animation: ctGridPulse 12s ease-in-out infinite;
}
@keyframes ctGridPulse {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(205, 133, 63, 0.02); }
}

/* THEME: drift — 💫 Single large blurred bronze orb */
body.ct-dashboard-active.ct-bg-theme-drift .ct-site-content {
    background: transparent !important;
    position: relative;
}
body.ct-dashboard-active.ct-bg-theme-drift .ct-gold-series {
    background: transparent !important;
}
body.ct-dashboard-active.ct-bg-theme-drift .ct-site-content::before {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(circle at center, rgba(205, 133, 63, 0.06) 0%, rgba(139, 69, 19, 0.03) 40%, transparent 70%);
    animation: ctDriftFloat 20s ease-in-out infinite;
    top: -100px;
    left: -100px;
}
@keyframes ctDriftFloat {
    0%   { transform: translate(0, 0) scale(1); }
    25%  { transform: translate(200px, 100px) scale(1.1); }
    50%  { transform: translate(400px, 50px) scale(0.95); }
    75%  { transform: translate(200px, -50px) scale(1.05); }
    100% { transform: translate(0, 0) scale(1); }
}

/* THEME: marble — 🏛️ Bronze-on-dark marble veins */
body.ct-dashboard-active.ct-bg-theme-marble .ct-site-content,
body.ct-dashboard-active.ct-bg-theme-marble .ct-gold-series {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(139, 69, 19, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(205, 133, 63, 0.03) 0%, transparent 50%),
        repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(255, 255, 255, 0.01) 2px, rgba(255, 255, 255, 0.01) 3px),
        repeating-linear-gradient(-45deg, transparent, transparent 3px, rgba(205, 133, 63, 0.01) 3px, rgba(205, 133, 63, 0.01) 4px) !important;
}

/* THEME: starlight — ✨ Subtle twinkling dots */
body.ct-dashboard-active.ct-bg-theme-starlight .ct-site-content,
body.ct-dashboard-active.ct-bg-theme-starlight .ct-gold-series {
    background:
        radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.3) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 30% 60%, rgba(255, 255, 255, 0.2) 0%, transparent 100%),
        radial-gradient(1px 1px at 50% 10%, rgba(255, 255, 255, 0.25) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 70% 40%, rgba(205, 133, 63, 0.2) 0%, transparent 100%),
        radial-gradient(1px 1px at 90% 70%, rgba(255, 255, 255, 0.15) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 15% 80%, rgba(205, 133, 63, 0.15) 0%, transparent 100%),
        radial-gradient(1px 1px at 60% 90%, rgba(255, 255, 255, 0.2) 0%, transparent 100%),
        radial-gradient(1px 1px at 45% 45%, rgba(255, 255, 255, 0.1) 0%, transparent 100%) !important;
    animation: ctStarTwinkle 4s ease-in-out infinite alternate;
}
@keyframes ctStarTwinkle {
    0%   { opacity: 0.6; }
    100% { opacity: 1; }
}

/* THEME: waves — 🌊 Slow horizontal gradient waves */
body.ct-dashboard-active.ct-bg-theme-waves .ct-site-content,
body.ct-dashboard-active.ct-bg-theme-waves .ct-gold-series {
    background:
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 40px,
            rgba(205, 133, 63, 0.02) 40px,
            rgba(205, 133, 63, 0.02) 41px,
            transparent 41px,
            transparent 80px
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 80px,
            rgba(139, 69, 19, 0.02) 80px,
            rgba(139, 69, 19, 0.02) 81px,
            transparent 81px,
            transparent 120px
        ) !important;
    animation: ctWaveSlide 15s linear infinite;
}
@keyframes ctWaveSlide {
    0%   { background-position: 0 0, 0 0; }
    100% { background-position: 120px 0, 240px 0; }
}

/* Background themes behind dashboard content */
body.ct-dashboard-active.ct-bg-theme-ember .ct-site-content > *,
body.ct-dashboard-active.ct-bg-theme-drift .ct-site-content > * {
    position: relative;
    z-index: 1;
}

/* ============================================================
   LIVING GOLD PRESENCE — Chat "Alive" Effects (trimmed)
   Layer B: reactive gold bars (idle / thinking / speaking)
   Layer C: portrait breathing zoom (added to ::before above)
   All scoped to #ct-chat-container ONLY. Pure CSS transforms +
   opacity (GPU-friendly). Respects prefers-reduced-motion.
   ============================================================ */

/* ---------- Layer B: Reactive Gold Bars (idle dots → active bars) ----------
   Idle: 7 small gold dots (resting pulse).
   Active (agent thinking OR speaking): dots morph into vertical gold bars
   that surge violently while the reply is voiced. Scoped to
   #ct-chat-container ONLY. Pure CSS transforms + opacity (GPU-friendly).
   Respects prefers-reduced-motion below. */
.ct-chat-wave {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
    height: 40px;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

.ct-chat-wave-bar {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(180deg, #cd853f 0%, #daa520 100%);
    /* Idle: gentle resting dot pulse */
    animation: ctChatWaveIdle 2.4s ease-in-out infinite;
    transform-origin: center;
}

.ct-chat-wave-bar:nth-child(2) { animation-delay: 0.1s; }
.ct-chat-wave-bar:nth-child(3) { animation-delay: 0.2s; }
.ct-chat-wave-bar:nth-child(4) { animation-delay: 0.3s; }
.ct-chat-wave-bar:nth-child(5) { animation-delay: 0.4s; }
.ct-chat-wave-bar:nth-child(6) { animation-delay: 0.5s; }
.ct-chat-wave-bar:nth-child(7) { animation-delay: 0.6s; }

@keyframes ctChatWaveIdle {
    0%, 100% {
        opacity: 0.9;
        transform: scale(1);
    }
    50% {
        opacity: 0.45;
        transform: scale(0.7);
    }
}

/* Active (thinking OR speaking): dots morph into vertical gold bars.
   Thinking flag added by Batch 2 JS with the typing indicator; speaking
   is auto-detected via a .ct-speaking bubble (no JS needed). */
#ct-chat-container:is(.ct-agent-thinking, :has(.ct-message-text.ct-speaking)) .ct-chat-wave-bar {
    width: 5px;
    border-radius: 3px;
    transform-origin: bottom;
}

#ct-chat-container:is(.ct-agent-thinking, :has(.ct-message-text.ct-speaking)) .ct-chat-wave-bar:nth-child(1) { height: 12px; }
#ct-chat-container:is(.ct-agent-thinking, :has(.ct-message-text.ct-speaking)) .ct-chat-wave-bar:nth-child(2) { height: 20px; }
#ct-chat-container:is(.ct-agent-thinking, :has(.ct-message-text.ct-speaking)) .ct-chat-wave-bar:nth-child(3) { height: 28px; }
#ct-chat-container:is(.ct-agent-thinking, :has(.ct-message-text.ct-speaking)) .ct-chat-wave-bar:nth-child(4) { height: 35px; }
#ct-chat-container:is(.ct-agent-thinking, :has(.ct-message-text.ct-speaking)) .ct-chat-wave-bar:nth-child(5) { height: 28px; }
#ct-chat-container:is(.ct-agent-thinking, :has(.ct-message-text.ct-speaking)) .ct-chat-wave-bar:nth-child(6) { height: 20px; }
#ct-chat-container:is(.ct-agent-thinking, :has(.ct-message-text.ct-speaking)) .ct-chat-wave-bar:nth-child(7) { height: 12px; }

/* Thinking state: faster, uneven "mind working" shimmer.
   Added by Batch 2 JS when the typing indicator shows. */
#ct-chat-container.ct-agent-thinking .ct-chat-wave-bar {
    animation-name: ctChatWaveThink;
    animation-duration: 0.9s;
    animation-timing-function: ease-in-out;
}

@keyframes ctChatWaveThink {
    0%, 100% {
        opacity: 1;
        transform: scaleY(1);
    }
    30% {
        opacity: 0.55;
        transform: scaleY(1.35);
    }
    60% {
        opacity: 0.8;
        transform: scaleY(0.65);
    }
}

/* Speaking state: high-energy surge while the agent's reply
   is being voiced (auto-detected via a .ct-speaking bubble,
   no JS needed). */
#ct-chat-container:has(.ct-message-text.ct-speaking) .ct-chat-wave-bar {
    animation-name: ctChatWaveSpeak;
    animation-duration: 0.45s;
    animation-timing-function: ease-in-out;
}

@keyframes ctChatWaveSpeak {
    0%, 100% {
        opacity: 1;
        transform: scaleY(1);
    }
    25% {
        opacity: 0.4;
        transform: scaleY(1.85);
    }
    50% {
        opacity: 0.9;
        transform: scaleY(0.6);
    }
    75% {
        opacity: 0.5;
        transform: scaleY(1.5);
    }
}

/* No animation chrome for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ct-chat-wave-bar,
    .ct-chat-container.ct-has-portrait::before {
        animation: none !important;
    }
}

/* ============================================================
   PHASE 3 — CT REACTION FX (visual gestures → portrait + chip)
   Visual gestures the AI emits ([waving hand], [nods], [smiles],
   [brightens up], [eyes light up], [opens eyes], [looks at you])
   are rendered as short-lived on-screen effects. GPU-friendly
   (transform / opacity / filter) and scoped to #ct-chat-container.
   Respects prefers-reduced-motion.
   ============================================================ */

/* ---------- Gesture icon zoom (replaces the glow: a wave 🖐️ zooms across the chat box) ----------
   When an agent gestures, a big gesture ICON (👋 wave, 🙂 nod, 😊 smile, ✨ glow)
   zooms in over the whole chat box, holds ~2s, then disappears. No glow, no label. */
.ct-react-zoom {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 16, 10, 0.14);
    opacity: 0;
    animation: ctReactZoomVeil 2s ease-in-out 1 forwards;
}
.ct-react-zoom-icon {
    font-size: 150px;
    line-height: 1;
    filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.55));
    transform-origin: 50% 50%;
    animation: ctReactZoom 2s ease-in-out 1 forwards;
}
@keyframes ctReactZoomVeil {
    0%   { opacity: 0; }
    14%  { opacity: 1; }
    78%  { opacity: 1; }
    100% { opacity: 0; }
}
@keyframes ctReactZoom {
    0%   { opacity: 0; transform: scale(0.4) rotate(-10deg); }
    16%  { opacity: 1; transform: scale(1.05) rotate(3deg); }
    30%  { opacity: 1; transform: scale(1.16) rotate(-4deg); }
    50%  { opacity: 1; transform: scale(1.22) rotate(5deg); }
    70%  { opacity: 1; transform: scale(1.24) rotate(0deg); }
    100% { opacity: 0; transform: scale(1.3) rotate(0deg); }
}

/* ---------- Portrait effects (combined with the breathing zoom) ---------- */
#ct-chat-container.ct-has-portrait.ct-react-wave::before {
    animation: ctReactWave 1.6s ease-in-out 1, ctBreathingZoom 50s ease-in-out infinite;
}
@keyframes ctReactWave {
    0%, 100% { transform: scale(1); }
    30%      { transform: scale(0.92) translateY(8px); }
    55%      { transform: scale(0.97); }
    80%      { transform: scale(1); }
}

#ct-chat-container.ct-has-portrait.ct-react-nod::before {
    animation: ctReactNod 1.3s ease-in-out 1, ctBreathingZoom 50s ease-in-out infinite;
}
@keyframes ctReactNod {
    0%, 100% { transform: translateY(0); }
    25%      { transform: translateY(6px); }
    50%      { transform: translateY(0); }
    75%      { transform: translateY(-6px); }
}

#ct-chat-container.ct-has-portrait.ct-react-smile::before {
    animation: ctReactSmile 1.6s ease-in-out 1, ctBreathingZoom 50s ease-in-out infinite;
}
@keyframes ctReactSmile {
    0%, 100% { transform: scale(1); }
    40%      { transform: scale(1.05); }
    70%      { transform: scale(1.02); }
}

#ct-chat-container.ct-has-portrait.ct-react-glow::before {
    animation: ctReactGlow 1.7s ease-in-out 1, ctBreathingZoom 50s ease-in-out infinite;
}
@keyframes ctReactGlow {
    0%, 100% { transform: scale(1); }
    35%      { transform: scale(1.06); }
    70%      { transform: scale(1.02); }
}

#ct-chat-container.ct-has-portrait.ct-react-wake::before {
    animation: ctReactWake 2s ease-out 1, ctBreathingZoom 50s ease-in-out infinite;
}
@keyframes ctReactWake {
    0%   { opacity: 0.5; transform: scale(0.9); }
    45%  { opacity: 1; transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

/* ---------- Full-screen transparent agent overlay ([looks at you]) ---------- */
.ct-react-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    pointer-events: none;
    background-color: rgba(6, 10, 18, 0.6);
    background-repeat: no-repeat;
    background-position: center 40%;
    background-size: cover;
    opacity: 0;
    animation: ctReactOverlay 3.2s ease forwards;
}
@keyframes ctReactOverlay {
    0%   { opacity: 0; }
    12%  { opacity: 1; }
    85%  { opacity: 1; }
    100% { opacity: 0; }
}

/* No reaction chrome for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ct-react-zoom,
    .ct-react-overlay {
        animation: none !important;
        opacity: 0;
    }
}

/* ============================================================
   CONTAINER QUERIES — CARD GRIDS (Batch 7)
   Card grids adapt to the width of the content column, not just
   the viewport. Thresholds mirror the viewport breakpoints
   (content column ≈ viewport − 24px of horizontal padding), so
   phone/tablet behaviour is unchanged; narrow containers on wide
   screens (modals, side panels, laptops with a fixed sidebar)
   collapse gracefully to larger, more readable cards.
   Browsers without container-query support fall back to the
   existing @media rules in gold-series.css.
   ============================================================ */
.ct-content {
    container-type: inline-size;
    container-name: ct-content;
}

@container ct-content (max-width: 456px) {
    .ct-cards-grid-2,
    .ct-cards-grid-3,
    .ct-cards-grid-4,
    .ct-cards-grid-1-2,
    .ct-cards-grid-2-1 {
        grid-template-columns: 1fr;
    }
}

@container ct-content (min-width: 457px) and (max-width: 1000px) {
    .ct-cards-grid-3,
    .ct-cards-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

