        /* ==========================================================================
           [SEC:CSS:COMPONENTS]
           4. COMPONENTS
           ========================================================================== */

        /* Character Roster Card */
        /* Character Roster Card (Option 13: Expanding Folio) */
        .char-roster-btn {
            position: relative;
            background-size: cover;
            background-position: center 20%;
            border-radius: 28px;
            /* Softer edges from Option 8 */
            overflow: hidden;
            aspect-ratio: 2 / 3;
            border: 1px solid rgba(255, 255, 255, 0.1);
            cursor: pointer;
            transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
        }

        .char-roster-btn:hover {
            transform: translateY(-8px);
            border-color: rgba(129, 140, 248, 0.4);
            box-shadow:
                0 30px 60px rgba(0, 0, 0, 0.6),
                0 0 20px rgba(129, 140, 248, 0.2);
        }

        .char-roster-btn::after {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(to top,
                    rgba(0, 0, 0, 0.95) 0%,
                    rgba(0, 0, 0, 0.3) 40%,
                    rgba(0, 0, 0, 0) 80%);
            pointer-events: none;
            transition: opacity 0.5s ease;
        }

        .char-roster-content {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            padding: 2.25rem;
            z-index: 10;
            display: flex;
            flex-direction: column;
            transition: all 0.5s ease;
        }

        .char-roster-content h3 {
            font-family: 'Playfair Display', serif;
            font-size: 1.75rem;
            font-weight: 700;
            line-height: 1.2;
            margin-bottom: 0.5rem;
            text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
            display: -webkit-box;
            -webkit-line-clamp: 2;
            line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .char-folio-description {
            font-family: 'Spectral', serif;
            font-size: 1rem;
            line-height: 1.5;
            color: rgba(255, 255, 255, 0.85);
            font-style: italic;
            max-height: 3.1em;
            /* ~2 lines */
            overflow: hidden;
            transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
            margin-bottom: 0;
        }

        .char-roster-btn:hover .char-folio-description {
            max-height: 300px;
            margin-bottom: 1.25rem;
            color: #fff;
        }

        /* User Badge Premium (Option 13) */
        .user-badge-premium {
            background: rgba(255, 255, 255, 0.08);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 0.5px solid rgba(255, 255, 255, 0.25);
            color: #fff;
            padding: 5px 12px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            gap: 6px;
            z-index: 20;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            pointer-events: none;
            white-space: nowrap;
            font-size: 0.65rem;
            font-weight: 700;
            letter-spacing: 0.05em;
            text-transform: uppercase;
        }

        .user-badge-premium svg {
            width: 14px;
            height: 14px;
            color: #818cf8;
        }

        .user-badge-premium span {
            font-size: 0.7rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            font-family: 'Inter', sans-serif;
        }

        /* Lozenge Tags */
        .tag-lozenge {
            display: inline-flex;
            align-items: center;
            padding: 3px 12px;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 100px;
            font-size: 0.65rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: rgba(255, 255, 255, 0.9);
            backdrop-filter: blur(8px);
            margin-right: 6px;
            margin-bottom: 6px;
            transition: all 0.3s ease;
        }

        .char-roster-btn:hover .tag-lozenge {
            background: rgba(255, 255, 255, 0.2);
            border-color: rgba(255, 255, 255, 0.3);
            color: #fff;
        }

        .modal-overlay {
            background-color: var(--surface-overlay);
            backdrop-filter: blur(2px);
        }

        /* Edit Response Modal: Set to occupy 2/3 of the viewport height for better visibility */
        #edit-response-modal>div:not(.modal-overlay) {
            height: 66vh !important;
            max-height: 90vh !important;
            display: flex;
            flex-direction: column;
        }

        /* Ensure text area fills the modal */
        #edit-response-modal textarea {
            height: 100% !important;
            flex-grow: 1;
        }

        /* Toggle Switch */
        .toggle-bg {
            transition: background-color var(--transition-fast);
        }

        /* Abstract Geometric Placeholder (Option 23) */
        .placeholder-geometric {
            width: 100%;
            height: 100%;
            background: #020617;
            overflow: hidden;
            position: relative;
        }

        .geo-circle {
            position: absolute;
            border-radius: 50%;
            background: rgba(99, 102, 241, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.03);
        }

        .geo-1 {
            width: 300px;
            height: 300px;
            top: -50px;
            left: -50px;
        }

        .geo-2 {
            width: 250px;
            height: 250px;
            bottom: 50px;
            right: -80px;
        }

        .geo-3 {
            width: 150px;
            height: 150px;
            top: 100px;
            right: 20px;
            opacity: 0.5;
        }

        .toggle-bg:after {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            width: 1.25rem;
            height: 1.25rem;
            background: white;
            border-radius: 50%;
            transition: left var(--transition-fast);
        }

        input:checked+.toggle-bg {
            background-color: var(--brand-color);
        }

        input:checked+.toggle-bg:after {
            left: calc(100% - 2px - 1.25rem);
        }

/* Author's note: a small mark on the pencil while this chat has a note in force. */
.author-note-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 7px;
    height: 7px;
    border-radius: 9999px;
    background: #f472b6;
    pointer-events: none;
}
