        .word-selection-popup {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            border-radius: 15px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            padding: 30px;
            max-width: 500px;
            width: 90%;
            z-index: 10000;
        }

        .word-selection-popup h3 {
            margin-bottom: 20px;
            color: #333;
        }

        .word-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .word-button {
            padding: 12px 20px;
            background: white;
            color: #333;
            border: 2px solid #e0e0e0;
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            transition: all 0.2s;
            text-align: left;
        }

        .word-button:hover {
            border-color: #0097b2;
            background: #f0f9fa;
        }

        .popup-actions {
            margin-top: 20px;
            display: flex;
            gap: 10px;
            justify-content: flex-end;
        }

        .popup-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 9999;
        }

        .message-image {
            width: 100%;
            max-width: 500px;
            border-radius: 10px;
            margin: 10px 0;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
        }
        
        .message-image:hover {
            transform: scale(1.02);
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
        }

        .message-content-wrapper {
            display: flex;
            flex-direction: column;
        }

        .message-text {
            word-wrap: break-word;
        }

        .message-text strong {
            font-weight: 600;
            color: #333;
        }

        .message-text em {
            font-style: italic;
        }

        /* Drawer Styles */
        .drawer {
            position: absolute;
            top: 0;
            bottom: 0;
            width: 280px;
            background: white;
            box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
            transform: translateX(-100%);
            transition: transform 0.3s ease;
            z-index: 1000;
            display: flex;
            flex-direction: column;
        }

        .drawer.open {
            transform: translateX(0);
        }

        .left-drawer {
            left: 0;
        }

        .right-drawer {
            right: 0;
            left: auto;
            transform: translateX(100%);
        }

        .right-drawer.open {
            transform: translateX(0);
        }

        .drawer-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.3);
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease;
            z-index: 999;
        }

        .drawer-overlay.active {
            opacity: 1;
            pointer-events: all;
        }

        .drawer-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px;
            border-bottom: 1px solid #e0e0e0;
            background: #f8f9fa;
        }

        .drawer-header h3 {
            font-size: 18px;
            color: #333;
            margin: 0;
        }

        .close-drawer {
            background: none;
            border: none;
            font-size: 24px;
            color: #666;
            cursor: pointer;
            padding: 0;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: background 0.2s;
        }

        .close-drawer:hover {
            background: #e0e0e0;
        }

        .drawer-content {
            flex: 1;
            overflow-y: auto;
            padding: 10px;
        }

        .drawer-item {
            padding: 15px;
            margin: 5px 0;
            background: #f8f9fa;
            border-radius: 10px;
            cursor: pointer;
            transition: background 0.2s, transform 0.1s;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .drawer-item:hover {
            background: #e9ecef;
            transform: translateX(3px);
        }

        .drawer-item.active {
            background: #0097b2;
            color: white;
        }

        .drawer-item.active .drawer-item-icon {
            background: rgba(255, 255, 255, 0.2);
        }

        .drawer-item-icon {
            font-size: 24px;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: white;
            border-radius: 50%;
            flex-shrink: 0;
            overflow: hidden;
        }

        .drawer-item-icon img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .drawer-item-text {
            flex: 1;
        }

        .drawer-item-text .name {
            font-weight: 600;
            font-size: 14px;
            margin-bottom: 2px;
        }

        .drawer-item-text .status {
            font-size: 12px;
            opacity: 0.7;
        }

        /* Main Chat Area */
        .main-chat-area {
            flex: 1;
            display: flex;
            flex-direction: column;
            min-width: 0;
            min-height: 0;
            overflow: hidden;
        }

        
        /* Clue detail styles */
        .clue-detail-image {
            width: 100%;
            max-width: 100%;
            border-radius: 10px;
            margin-bottom: 15px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
        }
        
        .clue-detail-image:hover {
            transform: scale(1.02);
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
        }
        
        .clue-detail-text {
            padding: 15px;
            background: #f8f9fa;
            border-radius: 10px;
            font-size: 14px;
            line-height: 1.6;
            white-space: pre-wrap;
        }
        
        .clue-detail-text strong {
            font-weight: 600;
            color: #333;
        }
        
        .clue-detail-text em {
            font-style: italic;
        }
        
        /* Full-size image modal */
        .image-modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.9);
            z-index: 10001;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease;
        }
        
        .image-modal-overlay.active {
            opacity: 1;
            pointer-events: all;
        }
        
        .image-modal-content {
            max-width: 90%;
            max-height: 90%;
            object-fit: contain;
            border-radius: 10px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
        }
        
        .image-modal-close {
            position: absolute;
            top: 20px;
            right: 30px;
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            font-size: 32px;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s;
            z-index: 10002;
        }
        
        .image-modal-close:hover {
            background: rgba(255, 255, 255, 0.3);
        }
        
        /* Tutorial/Spotlight Styles */
        .tutorial-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 100000;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease;
        }
        
        .tutorial-overlay.active {
            opacity: 1;
            pointer-events: all;
        }
        
        .tutorial-spotlight {
            position: fixed;
            border: 3px solid #0097b2;
            border-radius: 12px;
            box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5), 
                        0 0 20px rgba(0, 151, 178, 0.6),
                        inset 0 0 20px rgba(0, 151, 178, 0.2);
            background: transparent;
            z-index: 100001;
            transition: all 0.3s ease;
            pointer-events: none;
            display: none;
        }
        
        .tutorial-spotlight.active {
            display: block;
        }

        .tutorial-overlay-light {
            background: rgba(0, 0, 0, 0.2) !important;
        }

        .tutorial-spotlight-light {
            box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.25),
                        0 0 25px rgba(0, 151, 178, 0.7),
                        inset 0 0 24px rgba(0, 151, 178, 0.25) !important;
        }
        
        .tutorial-tooltip {
            position: fixed;
            background: white;
            border-radius: 12px;
            padding: 20px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
            z-index: 100002;
            max-width: 350px;
            min-width: 280px;
            font-size: 15px;
            line-height: 1.6;
            color: #333;
            pointer-events: auto;
        }
        
        .tutorial-tooltip::before {
            content: '';
            position: absolute;
            width: 0;
            height: 0;
            border: 12px solid transparent;
        }
        
        .tutorial-tooltip.tooltip-top::before {
            bottom: -24px;
            left: 50%;
            transform: translateX(-50%);
            border-top-color: white;
        }
        
        .tutorial-tooltip.tooltip-bottom::before {
            top: -24px;
            left: 50%;
            transform: translateX(-50%);
            border-bottom-color: white;
        }
        
        .tutorial-tooltip.tooltip-left::before {
            right: -24px;
            top: 50%;
            transform: translateY(-50%);
            border-left-color: white;
        }
        
        .tutorial-tooltip.tooltip-right::before {
            left: -24px;
            top: 50%;
            transform: translateY(-50%);
            border-right-color: white;
        }
        
        .tutorial-tooltip-title {
            font-weight: 600;
            font-size: 18px;
            margin-bottom: 10px;
            color: #0097b2;
        }
        
        .tutorial-tooltip-text {
            margin-bottom: 15px;
        }
        
        .tutorial-tooltip-button {
            background: #0097b2;
            color: white;
            border: none;
            padding: 12px 24px;
            border-radius: 8px;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            width: 100%;
            transition: background 0.2s;
            font-family: Georgia, 'Times New Roman', Times, serif;
        }
        
        .tutorial-tooltip-button:hover {
            background: #007a91;
        }
        
        .tutorial-tooltip-skip {
            background: transparent;
            color: #666;
            border: none;
            padding: 8px;
            margin-top: 10px;
            cursor: pointer;
            font-size: 13px;
            text-decoration: underline;
        }
        
        .tutorial-tooltip-skip:hover {
            color: #333;
        }
        
        /* Word highlighting styles */
        .highlight {
            border-bottom: 2px dotted rgba(212, 175, 100, 0.5);
            background: linear-gradient(180deg, 
                transparent 0%, 
                transparent 50%, 
                rgba(212, 175, 100, 0.2) 50%, 
                rgba(212, 175, 100, 0.2) 95%, 
                transparent 95%);
            cursor: pointer;
            position: relative;
            transition: all 0.2s ease;
            user-select: none;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
        }

        .highlight::after {
            content: '*';
            position: absolute;
            top: -0.2em;
            right: -0.4em;
            color: #d4af64;
            font-size: 0.65em;
            font-weight: 600;
            pointer-events: none;
        }
        
        .highlight:hover {
            background: linear-gradient(180deg, 
                transparent 0%, 
                transparent 50%, 
                rgba(212, 175, 100, 0.35) 50%, 
                rgba(212, 175, 100, 0.35) 95%, 
                transparent 95%);
            border-bottom-color: rgba(212, 175, 100, 0.8);
        }
        
        .highlight.loading {
            cursor: wait;
            opacity: 0.6;
            /* Override any animation from .loading class */
            animation: none !important;
            transform: none !important;
            width: auto !important;
            height: auto !important;
            border: none !important;
            border-radius: 0 !important;
            margin: 0 !important;
        }
        
        .explain-inline {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            color: #d4af64;
            font-size: 0.8em;
            font-weight: 500;
            margin-left: 4px;
            cursor: pointer;
            vertical-align: middle;
            opacity: 0;
            transition: opacity 0.2s ease;
        }
        
        .highlight:hover .explain-inline,
        .highlight.active .explain-inline {
            opacity: 1;
        }
        
        .explain-inline:hover {
            color: #1a5563;
        }
        
        .explain-inline::before {
            content: "💡";
            font-size: 0.9em;
        }
        
        /* Allow text selection in message text, but handle highlights specially */
        .message-text {
            user-select: text;
            -webkit-user-select: text;
            -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
            /* Don't use touch-action: manipulation here as it blocks text selection */
        }
        
        /* Prevent context menu on highlights only */
        .highlight {
            -webkit-touch-callout: none; /* Prevent context menu on iOS */
            touch-action: manipulation; /* Improve touch responsiveness */
        }
        
        /* Improve touch target size on mobile */
        @media (max-width: 768px) {
            .highlight {
                min-height: 24px; /* Ensure touch target is large enough */
                padding: 2px 0; /* Add some padding for easier tapping */
            }
        }
    