  html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
        .ct-app,
        .ct-chat,
        .ct-voicebar,
        .ct-inputbar,
        .ct-inputwrap {
            max-width: 100% !important;
            width: 100% !important;
            box-sizing: border-box !important;
        }
        .ct-voicebar {
            position: relative !important;
            top: auto !important;
            left: auto !important;
            right: auto !important;
            z-index: 10 !important;
        }
        /* Ensure first message is never hidden behind voicebar */
        .ct-chat {
            scroll-padding-top: 60px !important;
        }
        .ct-chat .ct-msg:first-child,
        .ct-chat .ct-empty:first-child {
            margin-top: 8px !important;
        }
        .ct-header {
            max-width: 100% !important;
            width: 100% !important;
            box-sizing: border-box !important;
            display: flex !important;
            justify-content: space-between !important;
            align-items: center !important;
        }
        .ct-header-left {
            display: flex !important;
            align-items: center !important;
            gap: 12px !important;
            max-width: none !important;
            width: auto !important;
        }
        .ct-header-right {
            display: flex !important;
            align-items: center !important;
            gap: 8px !important;
            max-width: none !important;
            width: auto !important;
            margin-left: auto !important;
        }
        .ct-app {
            margin: 0 !important;
            padding: 0 !important;
        }

        /* ── Speaker (Narration) Toggle ── */
        .ct-speaker {
            /* Inherits ct-voice sizing from chat-terminal.css */
            transition: all 0.2s ease !important;
        }
        .ct-speaker.muted {
            background: var(--error-color, #ef4444) !important;
            border-color: var(--error-color, #ef4444) !important;
            opacity: 1 !important;
        }
        .ct-speaker.muted .ct-si {
            color: #fff !important;
        }

        /* ── Test Input Gear Dropdown ── */
        .ct-test-wrapper {
            position: relative;
        }
        .ct-test-menu {
            display: none;
            position: absolute;
            top: calc(100% + 8px);
            right: 0;
            min-width: 200px;
            max-height: 60vh;
            overflow-y: auto;
            background: var(--bg-secondary, #1a1a2e);
            border: 1px solid var(--border-color, rgba(255,255,255,0.1));
            border-radius: 12px;
            box-shadow: 0 8px 32px rgba(0,0,0,0.4);
            z-index: 9999;
            padding: 6px 0;
            scrollbar-width: thin;
        }
        .ct-test-menu.visible { display: block; }
        .ct-test-menu-group {
            padding: 8px 14px 4px;
            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--text-muted, rgba(255,255,255,0.3));
            pointer-events: none;
        }
        .ct-test-menu-item {
            display: block;
            width: 100%;
            padding: 8px 14px;
            background: none;
            border: none;
            color: var(--text-secondary, rgba(255,255,255,0.7));
            font-size: 13px;
            text-align: left;
            cursor: pointer;
            transition: background 0.15s, color 0.15s;
            font-family: inherit;
        }
        .ct-test-menu-item:hover {
            background: var(--bg-tertiary, rgba(255,255,255,0.06));
            color: var(--text-primary, #fff);
        }
        .ct-test-menu-sep {
            height: 1px;
            background: var(--border-color, rgba(255,255,255,0.08));
            margin: 4px 10px;
        }

        /* ── Background Visualizer Menu ── */
        .ct-bg-wrapper { position: relative; }
        .ct-bg-menu {
            display: none;
            position: absolute;
            top: calc(100% + 8px);
            right: 0;
            min-width: 160px;
            background: var(--bg-secondary, #1a1a2e);
            border: 1px solid var(--border-color, rgba(255,255,255,0.1));
            border-radius: 12px;
            box-shadow: 0 8px 32px rgba(0,0,0,0.4);
            z-index: 9999;
            padding: 6px 0;
        }
        .ct-bg-menu.visible { display: block; }
        .ct-bg-menu-title {
            padding: 8px 14px 6px;
            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--text-muted, rgba(255,255,255,0.3));
            pointer-events: none;
        }
        .ct-bg-opt {
            display: block;
            width: 100%;
            padding: 9px 14px;
            background: none;
            border: none;
            color: var(--text-secondary, rgba(255,255,255,0.7));
            font-size: 13px;
            text-align: left;
            cursor: pointer;
            transition: background 0.15s, color 0.15s;
            font-family: inherit;
        }
        .ct-bg-opt:hover {
            background: var(--bg-tertiary, rgba(255,255,255,0.06));
            color: var(--text-primary, #fff);
        }
        .ct-bg-opt-sel {
            color: var(--text-primary, #fff);
            background: var(--bg-tertiary, rgba(255,255,255,0.06));
        }

        /* Ensure chat content is above background canvas */
        .ct-msg, .ct-typing, .ct-empty, #ct-waiting {
            position: relative;
            z-index: 1;
        }


 .ct-vb-actions {
            margin-left: auto;
            display: flex;
            gap: 8px;
            align-items: center;
            flex-shrink: 0;
        }
        .ct-vb-btn {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 12px;
            font-weight: 600;
            padding: 5px 14px;
            border-radius: 20px;
            cursor: pointer;
            font-family: inherit;
            letter-spacing: 0.3px;
            transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
            white-space: nowrap;
            border: 1.5px solid transparent;
            line-height: 1;
        }
        .ct-vb-btn:hover { transform: scale(1.04); }
        .ct-vb-btn:active { transform: scale(0.97); }
        .ct-vb-btn i { font-size: 11px; }

        .ct-vb-btn--stop {
            background: rgba(239, 68, 68, 0.1);
            border-color: rgba(239, 68, 68, 0.4);
            color: #ef4444;
        }
        .ct-vb-btn--stop:hover {
            background: #ef4444;
            border-color: #ef4444;
            color: #fff;
        }

        .ct-vb-btn--end {
            background: rgba(107, 114, 128, 0.1);
            border-color: rgba(107, 114, 128, 0.3);
            color: #6b7280;
        }
        .ct-vb-btn--end:hover {
            background: #6b7280;
            border-color: #6b7280;
            color: #fff;
        }

 @keyframes ct-glow-pulse {
            0%, 100% { 
                box-shadow: 0 0 15px rgba(255,255,255,0.08), 0 0 30px rgba(255,255,255,0.04);
                transform: scale(1);
            }
            50% { 
                box-shadow: 0 0 25px rgba(255,255,255,0.15), 0 0 50px rgba(255,255,255,0.08), 0 0 80px rgba(255,255,255,0.03);
                transform: scale(1.05);
            }
        }
        @keyframes ct-ring-pulse {
            0% { transform: scale(1); opacity: 0.4; }
            100% { transform: scale(1.8); opacity: 0; }
        }
        @keyframes ct-spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        #ct-waiting .bi-arrow-repeat {
            animation: ct-spin 1.2s linear infinite;
        }
        #ct-waiting .bi-three-dots {
            animation: ct-glow-pulse 1.5s ease-in-out infinite;
        }
        #ct-empty-start {
            position: relative;
            animation: none !important;
        }
        #ct-empty-start::after {
            display: none;
        }

        /* ── Beautiful Start Button ── */
        .ct-start-orb {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            background: linear-gradient(145deg, #2a2a2a, #3d3d3d);
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            cursor: pointer;
            border: none;
            outline: none;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            box-shadow: 
                0 4px 20px rgba(0,0,0,0.15),
                0 0 0 1px rgba(255,255,255,0.06),
                inset 0 1px 0 rgba(255,255,255,0.1);
        }
        .ct-start-orb:hover {
            transform: scale(1.08);
            box-shadow: 
                0 8px 32px rgba(0,0,0,0.25),
                0 0 0 1px rgba(255,255,255,0.1),
                inset 0 1px 0 rgba(255,255,255,0.15);
        }
        .ct-start-orb:active {
            transform: scale(0.96);
        }
        .ct-start-orb .ct-orb-icon {
            font-size: 36px;
            color: rgba(255,255,255,0.9);
            z-index: 2;
            filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3));
        }
        /* Animated ring around the orb */
        .ct-start-orb::before {
            content: '';
            position: absolute;
            inset: -6px;
            border-radius: 50%;
            border: 2px solid transparent;
            border-top-color: rgba(74,222,128,0.6);
            border-right-color: rgba(74,222,128,0.2);
            animation: ct-orb-spin 3s linear infinite;
        }
        .ct-start-orb::after {
            content: '';
            position: absolute;
            inset: -14px;
            border-radius: 50%;
            background: transparent;
            border: 1px solid rgba(74,222,128,0.2);
            animation: ct-orb-breathe 3s ease-in-out infinite;
        }
        @keyframes ct-orb-spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        @keyframes ct-orb-breathe {
            0%, 100% { transform: scale(1); opacity: 0.4; }
            50% { transform: scale(1.15); opacity: 0; }
        }

        /* Light theme overrides */
        [data-theme="light"] .ct-start-orb,
        :root:not([data-theme="dark"]) .ct-start-orb {
            background: linear-gradient(145deg, #f0f0f0, #d8d8d8);
            box-shadow: 
                0 4px 20px rgba(0,0,0,0.08),
                0 0 0 1px rgba(0,0,0,0.06),
                inset 0 1px 0 rgba(255,255,255,0.8);
        }
        [data-theme="light"] .ct-start-orb:hover,
        :root:not([data-theme="dark"]) .ct-start-orb:hover {
            box-shadow: 
                0 8px 32px rgba(0,0,0,0.12),
                0 0 0 1px rgba(0,0,0,0.1),
                inset 0 1px 0 rgba(255,255,255,0.9);
        }
        [data-theme="light"] .ct-start-orb .ct-orb-icon,
        :root:not([data-theme="dark"]) .ct-start-orb .ct-orb-icon {
            color: rgba(40,40,40,0.85);
            filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
        }
        [data-theme="light"] .ct-start-orb::before,
        :root:not([data-theme="dark"]) .ct-start-orb::before {
            border-top-color: rgba(34,197,94,0.5);
            border-right-color: rgba(34,197,94,0.15);
        }
        [data-theme="light"] .ct-start-orb::after,
        :root:not([data-theme="dark"]) .ct-start-orb::after {
            border-color: rgba(34,197,94,0.15);
        }

        /* Subtitle text */
        #ct-empty-title {
            font-weight: 500 !important;
            font-size: 15px !important;
            letter-spacing: 0.5px !important;
            opacity: 0.5 !important;
            margin-top: 20px !important;
        }

        /* Connecting state — faster spin, pulsing icon */
        .ct-start-orb.connecting {
            pointer-events: none;
        }
        .ct-start-orb.connecting::before {
            animation: ct-orb-spin 0.8s linear infinite;
            border-top-color: rgba(74,222,128,0.85);
        }
        .ct-start-orb.connecting .ct-orb-icon {
            animation: ct-icon-pulse 1s ease-in-out infinite;
        }
        @keyframes ct-icon-pulse {
            0%, 100% { opacity: 0.5; transform: scale(1); }
            50% { opacity: 1; transform: scale(1.1); }
        }

 .ct-attach {
            transition: color 0.15s, transform 0.15s !important;
        }
        .ct-attach:hover {
            color: var(--accent-color, #22c55e) !important;
            transform: rotate(-20deg);
        }
        .ct-attach.uploading { pointer-events: none; opacity: 0.5; }
        .ct-attach.uploading i { animation: ct-spin 1s linear infinite; }
        @keyframes ct-spin { to { transform: rotate(360deg); } }

        .ct-upload-toast {
            position: fixed;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            background: var(--bg-secondary, #f5f5f5);
            border: 1px solid var(--border-color, rgba(0,0,0,0.1));
            border-radius: 12px;
            padding: 10px 18px;
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 13px;
            color: var(--text-primary, #1a1a2e);
            box-shadow: 0 4px 20px rgba(0,0,0,0.12);
            z-index: 10000;
            animation: ct-toast-in 0.2s ease-out;
        }
        @keyframes ct-toast-in { from { opacity:0; transform: translateX(-50%) translateY(10px); } }
        .ct-upload-bar {
            width: 80px;
            height: 4px;
            background: rgba(0,0,0,0.1);
            border-radius: 2px;
            overflow: hidden;
        }
        .ct-upload-fill {
            height: 100%;
            background: var(--accent-color, #22c55e);
            border-radius: 2px;
            transition: width 0.3s ease;
            width: 0%;
        }

        /* Lightbox modal for images/videos */
        .ct-lightbox {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.85);
            z-index: 10002;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: opacity 0.2s;
            cursor: zoom-out;
        }
        .ct-lightbox.active { opacity: 1; }
        .ct-lightbox-close {
            position: absolute;
            top: 16px;
            right: 16px;
            background: rgba(255,255,255,0.15);
            border: none;
            color: #fff;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            font-size: 20px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.15s;
            z-index: 2;
        }
        .ct-lightbox-close:hover { background: rgba(255,255,255,0.25); }
        .ct-lightbox img {
            max-width: 92vw;
            max-height: 90vh;
            object-fit: contain;
            border-radius: 8px;
            cursor: default;
        }
        .ct-lightbox video {
            max-width: 92vw;
            max-height: 90vh;
            border-radius: 8px;
            cursor: default;
        }
        .ct-lightbox-dl {
            position: absolute;
            bottom: 16px;
            right: 16px;
            background: rgba(255,255,255,0.15);
            border: none;
            color: #fff;
            padding: 8px 16px;
            border-radius: 8px;
            font-size: 13px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
            text-decoration: none;
            transition: background 0.15s;
        }
        .ct-lightbox-dl:hover { background: rgba(255,255,255,0.25); }

/* ── Compact header buttons ── */
.ct-header-right .ct-hbtn,
.ct-header .ct-hbtn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    font-size: 15px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-secondary, rgba(0,0,0,0.5));
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    box-shadow: none;
}

.ct-header-right .ct-hbtn:hover,
.ct-header .ct-hbtn:hover {
    background: var(--bg-secondary, rgba(0,0,0,0.06));
    color: var(--text-primary, #1a1a2e);
}

.ct-header-right .ct-hbtn i,
.ct-header .ct-hbtn i {
    font-size: 15px;
    line-height: 1;
}

/* Tighten the gap between buttons */
.ct-header-right {
    gap: 4px;
}
/* ── Compact header buttons ── */
.ct-header-right .ct-hbtn,
.ct-header .ct-hbtn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    font-size: 15px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-secondary, rgba(0,0,0,0.5));
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    box-shadow: none;
}

.ct-header-right .ct-hbtn:hover,
.ct-header .ct-hbtn:hover {
    background: var(--bg-secondary, rgba(0,0,0,0.06));
    color: var(--text-primary, #1a1a2e);
}

.ct-header-right .ct-hbtn i,
.ct-header .ct-hbtn i {
    font-size: 15px;
    line-height: 1;
}

/* Tighten the gap between buttons */
.ct-header-right {
    gap: 4px;
}
/* ── Compact header buttons ── */
.ct-header-right .ct-hbtn,
.ct-header .ct-hbtn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    font-size: 15px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-secondary, rgba(0,0,0,0.5));
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    box-shadow: none;
}

.ct-header-right .ct-hbtn:hover,
.ct-header .ct-hbtn:hover {
    background: var(--bg-secondary, rgba(0,0,0,0.06));
    color: var(--text-primary, #1a1a2e);
}

.ct-header-right .ct-hbtn i,
.ct-header .ct-hbtn i {
    font-size: 15px;
    line-height: 1;
}

/* Tighten the gap between buttons */
.ct-header-right {
    gap: 4px;
}
/* ═══════════════════════════════════════════════════════════
   terms-modal.css — Compact monochromatic terms modal
   
   Targets the EXACT HTML structure in index.php:
     #terms-acceptance-modal          (overlay, inline style: position fixed)
       > div                          (card, inline style: max-width 480px)
         > h2#terms-modal-title
         > p#terms-modal-subtitle
         > div                        (links row, inline: display flex, gap 30px)
           > a > svg + span#privacy-link-text
           > a > svg + span#terms-link-text
         > button#accept-terms-btn
         > p#terms-modal-footer
   ═══════════════════════════════════════════════════════════ */

/* ── Overlay ── */
#terms-acceptance-modal {
    background: rgba(0, 0, 0, 0.35) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    padding: 16px !important;
}

/* When JS shows modal (sets display:flex or removes display:none) */
#terms-acceptance-modal[style*="display: flex"],
#terms-acceptance-modal[style*="display:flex"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ── Card ── */
#terms-acceptance-modal > div {
    max-width: 300px !important;
    width: 300px !important;
    padding: 24px 22px 18px !important;
    background: var(--bg-primary, #fff) !important;
    border-radius: 16px !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.1) !important;
}

/* ── Title ── */
#terms-modal-title {
    font-size: 15px !important;
    color: var(--text-primary, #1a1a2e) !important;
    margin-bottom: 4px !important;
}

/* ── Subtitle ── */
#terms-modal-subtitle {
    font-size: 11px !important;
    line-height: 1.45 !important;
    color: rgba(0, 0, 0, 0.4) !important;
    margin-bottom: 14px !important;
}

/* ── Links row (the div with inline flex+gap containing the two <a> tags) ── */
#terms-acceptance-modal > div > div[style*="gap"] {
    display: block !important;
    text-align: center !important;
    margin-bottom: 14px !important;
}

/* ── Links — simple underlined text ── */
#terms-acceptance-modal a {
    display: inline !important;
    color: var(--text-primary, #1a1a2e) !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
    text-decoration-color: rgba(0, 0, 0, 0.2) !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 8px !important;
    gap: 0 !important;
}

#terms-acceptance-modal a:hover {
    opacity: 0.6 !important;
    color: var(--text-primary, #1a1a2e) !important;
    background: none !important;
}

/* Hide SVG icons inside links */
#terms-acceptance-modal a > svg {
    display: none !important;
}

/* ── Accept button ── */
#accept-terms-btn {
    max-width: 100% !important;
    width: 100% !important;
    padding: 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #fff !important;
    background: var(--text-primary, #1a1a2e) !important;
    background-image: none !important;
    border: none !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    margin-bottom: 12px !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    transition: opacity 0.15s !important;
}

#accept-terms-btn:hover {
    opacity: 0.85 !important;
    transform: none !important;
    box-shadow: none !important;
    background: var(--text-primary, #1a1a2e) !important;
}

/* ── Footer ── */
#terms-modal-footer {
    font-size: 9px !important;
    color: rgba(0, 0, 0, 0.3) !important;
    line-height: 1.3 !important;
}

/* ══════════════════════════════════════
   Dark theme
   ══════════════════════════════════════ */

[data-theme="dark"] #terms-acceptance-modal {
    background: rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] #terms-acceptance-modal > div {
    background: var(--bg-primary, #0a0a0f) !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] #terms-modal-title {
    color: var(--text-primary, #f0f0f0) !important;
}

[data-theme="dark"] #terms-modal-subtitle {
    color: rgba(255, 255, 255, 0.4) !important;
}

[data-theme="dark"] #terms-acceptance-modal a {
    color: rgba(255, 255, 255, 0.6) !important;
    text-decoration-color: rgba(255, 255, 255, 0.2) !important;
}

[data-theme="dark"] #accept-terms-btn {
    background: #f0f0f0 !important;
    color: #0a0a0f !important;
}

[data-theme="dark"] #accept-terms-btn:hover {
    background: #f0f0f0 !important;
    color: #0a0a0f !important;
}

[data-theme="dark"] #terms-modal-footer {
    color: rgba(255, 255, 255, 0.25) !important;
}

/* ══════════════════════════════════════
   Small screens
   ══════════════════════════════════════ */

@media (max-width: 360px) {
    #terms-acceptance-modal > div {
        max-width: 260px !important;
        width: 260px !important;
        padding: 20px 16px 14px !important;
    }
}