        /* RESET & BASE */
        * { box-sizing: border-box; }
        /* LAYOUT CONTAINER */
        .app-container {
            display: flex;
            height: 100%;
            width: 100%;
        }

        /* LEFT SIDE (Main Channel Context) */
        .main-channel {
            flex: 1;
            background-color: #f8f8f8;
            display: flex;
            align-items: center;
            justify-content: center;
            border-right: 1px solid #ddd;
            flex-direction: column;
            gap: 15px;
        }
        .placeholder-text { color: #888; font-size: 1.2rem; }
        .open-btn {
            padding: 10px 20px;
            background-color: #007a5a;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-weight: bold;
        }

        /* RIGHT SIDEBAR (The Thread) */
        .thread-sidebar {
            width: 400px; /* Fixed width for sidebar */
            background-color: white;
            display: flex;
            flex-direction: column;
            border-left: 1px solid #e2e2e2;
            box-shadow: -2px 0 5px rgba(0,0,0,0.02);
            transition: margin-right 0.3s ease; /* For animation */
            position: fixed;
            top: 0;
            bottom: 0;
            right: 0;
        }
        
        .thread-sidebar.closed {
            margin-right: -400px; /* Hide off-screen */
        }

        /* SIDEBAR HEADER */
        .sidebar-header {
            padding: 12px 20px;
            border-bottom: 1px solid #ddd;
            display: flex;
            justify-content: space-between;
            align-items: center;
            background-color: #fff;
        }
        .sidebar-title {
            font-weight: 700;
            font-size: 16px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .channel-name { font-weight: 400; color: #616061; font-size: 13px; }
        .close-btn {
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: #616061;
            padding: 0 5px;
            border-radius: 4px;
        }
        .close-btn:hover { background-color: #f2f2f2; }

        /* SIDEBAR SCROLLABLE CONTENT */
        .sidebar-content {
            flex: 1;
            overflow-y: auto;
            padding: 0;
        }

        /* MESSAGES */
        .message-item {
            padding: 8px 20px;
            display: flex;
            gap: 10px;
            font-size: 15px;
            line-height: 1.46668;
        }
        .message-item:hover { background-color: #f8f8f8; }

        .avatar {
            width: 36px;
            height: 36px;
            border-radius: 4px;
            background-color: #e0e0e0;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            color: #555;
            font-size: 14px;
        }

        .msg-body { flex: 1; min-width: 0; }
        
        .msg-meta {
            display: flex;
            align-items: baseline;
            gap: 8px;
            margin-bottom: 2px;
        }
        .username { font-weight: 900; color: #1d1c1d; }
        .timestamp { font-size: 12px; color: #616061; }
        
        .msg-text { word-wrap: break-word; color: #1d1c1d; }

        /* PARENT MESSAGE STYLING */
        .parent-message-container {
            padding: 15px 0;
            border-bottom: 1px solid #ddd;
        }
        
        /* REPLY SEPARATOR */
        .reply-separator {
            display: flex;
            align-items: center;
            padding: 15px 20px 5px;
            color: #616061;
            font-size: 13px;
        }
        .separator-line {
            flex: 1;
            height: 1px;
            background-color: #ddd;
            margin-left: 10px;
        }

        /* INPUT AREA */
        .sidebar-input-area {
            padding: 20px;
            border-top: 1px solid #ddd;
        }
        .input-box {
            border: 1px solid #868686;
            border-radius: 8px;
            padding: 10px;
            display: flex;
            flex-direction: column;
        }
        .input-box:focus-within { border-color: #000; box-shadow: 0 0 0 1px #000; }
        
        textarea {
            width: 100%;
            border: none;
            resize: none;
            outline: none;
            font-family: inherit;
            height: 40px;
            font-size: 15px;
        }

        .input-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 5px;
        }
        
        .action-icons { color: #616061; font-size: 14px; display: flex; gap: 10px; }
        
        .send-btn {
            background-color: #007a5a;
            color: white;
            border: none;
            border-radius: 4px;
            padding: 4px 12px;
            font-weight: 600;
            cursor: pointer;
            opacity: 0.5; /* Disabled look */
            pointer-events: none;
            transition: opacity 0.2s;
        }
        
        textarea:valid + .input-actions .send-btn {
            opacity: 1;
            pointer-events: auto;
        }
