/* Block 0 */

        /* Chat-specific styles */
        .chat-container {
            display: flex;
            flex-direction: column;
            height: calc(100vh - 80px);
            max-width: 1200px;
            margin: 0 auto;
            padding: 1rem;
            padding-bottom: 90px;
        }
        
        .chat-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.85rem 1rem;
            background: rgba(255,255,255,.04);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid var(--bdr);
            border-radius: 1rem 1rem 0 0;
        }
        
        .chat-header-info {
            display: flex;
            align-items: center;
            gap: 1rem;
        }
        
        .chat-header-info h1 {
            font-size: 1.1rem;
            margin: 0;
            color: var(--t1);
        }
        
        .chat-header-info .participants {
            font-size: 0.82rem;
            color: var(--t2);
        }
        
        .chat-header-actions {
            display: flex;
            gap: 0.5rem;
            align-items: center;
        }

        /* Prominent invite/copy-link button in the header */
        .chat-invite-btn {
            display: flex;
            align-items: center;
            gap: 0.4rem;
            padding: 6px 12px;
            background: rgba(250,56,0,.12);
            border: 1px solid rgba(250,56,0,.35);
            color: var(--a);
            border-radius: var(--r99, 999px);
            font-size: 0.8rem;
            font-weight: 600;
            cursor: pointer;
            transition: background .15s, border-color .15s;
            white-space: nowrap;
        }

        .chat-invite-btn:hover {
            background: rgba(250,56,0,.22);
            border-color: var(--a);
        }

        .chat-invite-btn svg {
            width: 13px;
            height: 13px;
            stroke: currentColor;
            fill: none;
            stroke-width: 2;
            flex-shrink: 0;
        }
        
        .chat-header-actions .btn-ghost {
            background: rgba(255,255,255,.06);
            border: 1px solid var(--bdr);
            color: var(--t2);
        }
        
        .chat-header-actions .btn-ghost:hover {
            background: rgba(255,255,255,.1);
            color: var(--t1);
            border-color: rgba(255,255,255,.2);
        }
        
        .chat-messages {
            flex: 1;
            overflow-y: auto;
            padding: 1rem;
            background: rgba(0,0,0,.15);
            border-left: 1px solid var(--bdr);
            border-right: 1px solid var(--bdr);
            display: flex;
            flex-direction: column;
            gap: 0.6rem;
            min-height: 0;
        }

        /* Scrollbar theming */
        .chat-messages,
        .participant-list {
            scrollbar-width: thin;
            scrollbar-color: rgba(148, 163, 184, 0.28) transparent;
        }

        .chat-messages::-webkit-scrollbar,
        .participant-list::-webkit-scrollbar {
            width: 6px;
        }

        .chat-messages::-webkit-scrollbar-track,
        .participant-list::-webkit-scrollbar-track {
            background: transparent;
        }

        .chat-messages::-webkit-scrollbar-thumb,
        .participant-list::-webkit-scrollbar-thumb {
            background: rgba(148, 163, 184, 0.22);
            border-radius: 999px;
        }
        
        .message {
            display: flex;
            gap: 0.6rem;
            max-width: 78%;
            animation: fadeIn 0.2s ease;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(8px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        .message.own {
            margin-left: auto;
            flex-direction: row-reverse;
        }
        
        .message-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: 600;
            font-size: 0.8rem;
            flex-shrink: 0;
        }
        
        .message-content {
            background: rgba(255,255,255,.07);
            border: 1px solid rgba(255,255,255,.1);
            border-radius: 0.75rem;
            padding: 0.55rem 0.85rem;
            max-width: 100%;
        }
        
        /* Own messages: dark with orange accent border â€” readable, clearly distinct */
        .message.own .message-content {
            background: rgba(250,56,0,.14);
            border-color: rgba(250,56,0,.45);
            color: var(--t1);
        }
        
        .message-sender {
            font-size: 0.72rem;
            font-weight: 600;
            color: var(--t2);
            margin-bottom: 0.2rem;
        }
        
        .message.own .message-sender {
            color: rgba(250,130,60,.9);
            text-align: right;
        }
        
        .message-text {
            word-wrap: break-word;
            white-space: pre-wrap;
            font-size: 0.92rem;
            line-height: 1.45;
            color: var(--t1);
        }
        
        .message-time {
            font-size: 0.7rem;
            color: var(--t2);
            margin-top: 0.2rem;
        }
        
        .message.own .message-time {
            color: rgba(250,130,60,.7);
            text-align: right;
        }
        
        .message-reactions {
            display: flex;
            gap: 0.25rem;
            margin-top: 0.4rem;
            flex-wrap: wrap;
        }

        /* Reaction add button */
        .reaction-add-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 26px;
            height: 26px;
            padding: 0;
            border-radius: 999px;
            border: 1px solid var(--bdr);
            background: rgba(255,255,255,.06);
            color: var(--t2);
            cursor: pointer;
            flex-shrink: 0;
            transition: all 0.15s ease;
        }

        .message.own .reaction-add-btn {
            border-color: rgba(250,56,0,.35);
            background: rgba(250,56,0,.1);
            color: rgba(250,130,60,.85);
        }

        .reaction-add-btn:hover {
            border-color: var(--a);
            background: rgba(250,56,0,.12);
            color: var(--t1);
        }

        .reaction-add-btn svg {
            width: 14px;
            height: 14px;
        }

        .reaction-picker {
            position: fixed;
            z-index: 6000;
            padding: 0.5rem;
            background: rgba(10,10,12,.92);
            border: 1px solid rgba(255,255,255,.12);
            border-radius: 0.75rem;
            box-shadow: 0 18px 48px rgba(0,0,0,.6);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
        }

        .reaction-picker-grid {
            display: grid;
            grid-template-columns: repeat(8, minmax(0, 1fr));
            gap: 0.25rem;
        }

        @media (max-width: 520px) {
            .reaction-picker-grid {
                grid-template-columns: repeat(6, minmax(0, 1fr));
            }
        }

        .reaction-picker-emoji {
            width: 34px;
            height: 34px;
            border-radius: 0.5rem;
            border: 1px solid transparent;
            background: transparent;
            cursor: pointer;
            font-size: 18px;
            line-height: 1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .reaction-picker-emoji:hover {
            border-color: var(--a);
            background: rgba(250, 56, 0, 0.12);
        }
        
        .reaction {
            background: rgba(255,255,255,.07);
            border: 1px solid var(--bdr);
            border-radius: 999px;
            padding: 0.12rem 0.45rem;
            font-size: 0.72rem;
            cursor: pointer;
            transition: all 0.15s;
        }
        
        .reaction:hover {
            border-color: var(--a);
        }
        
        .reaction.active {
            background: rgba(250,56,0,.2);
            border-color: rgba(250,56,0,.6);
        }
        
        .typing-indicator {
            display: none;
            padding: 0.4rem 1rem;
            font-size: 0.82rem;
            color: var(--t2);
            font-style: italic;
        }
        
        .typing-indicator.visible {
            display: block;
        }
        
        .chat-input-area {
            padding: 0.85rem 1rem;
            background: rgba(255,255,255,.04);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid var(--bdr);
            border-radius: 0 0 1rem 1rem;
            display: flex;
            gap: 0.6rem;
            align-items: flex-end;
        }
        
        .chat-input-area .btn-ghost {
            background: rgba(255,255,255,.07);
            border: 1px solid var(--bdr);
            color: var(--t2);
            border-radius: 0.65rem;
            padding: 8px 10px;
            width: 38px;
            height: 38px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        
        .chat-input-area .btn-ghost:hover {
            background: rgba(255,255,255,.12);
            color: var(--t1);
            border-color: rgba(255,255,255,.2);
        }
        
        .chat-input-wrapper {
            flex: 1;
            position: relative;
        }
        
        #chatInput {
            width: 100%;
            min-height: 42px;
            max-height: 120px;
            padding: 0.65rem 1rem;
            border: 1px solid var(--bdr);
            border-radius: 1.5rem;
            background: rgba(255,255,255,.05);
            color: var(--t1);
            font-size: 0.92rem;
            resize: none;
            overflow-y: auto;
        }
        
        #chatInput:focus {
            outline: none;
            border-color: rgba(255,255,255,.25);
            background: rgba(255,255,255,.07);
        }
        
        .chat-send-btn {
            width: 38px;
            height: 38px;
            border-radius: 50%;
            background: linear-gradient(180deg, var(--btn-orange-top, #ff5a1f), var(--btn-orange-bottom, #d93200));
            border: none;
            color: white;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
            flex-shrink: 0;
        }
        
        .chat-send-btn:hover {
            opacity: .88;
            transform: scale(1.06);
        }
        
        .chat-send-btn:disabled {
            background: rgba(255,255,255,.08);
            cursor: not-allowed;
            transform: none;
        }
        
        /* Create Room Modal */
        .chat-modal {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 2000;
            background: rgba(0, 0, 0, 0.55);
            backdrop-filter: blur(8px) saturate(1.1);
            -webkit-backdrop-filter: blur(8px) saturate(1.1);
            align-items: center;
            justify-content: center;
            padding: 1rem;
        }
        
        .chat-modal.active {
            display: flex;
        }
        
        .chat-modal-content {
            background: rgba(14,14,18,.95);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            color: var(--t1);
            border-radius: 1rem;
            width: 100%;
            max-width: 500px;
            max-height: 90vh;
            overflow-y: auto;
            padding: 1.5rem;
            border: 1px solid rgba(255,255,255,.1);
            box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
        }
        
        .chat-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }
        
        .chat-modal-header h2 {
            margin: 0;
            font-size: 1.2rem;
            color: var(--t1);
        }
        
        .chat-modal-close {
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: var(--t2);
            padding: 0.5rem;
            line-height: 1;
        }
        
        .chat-form-group {
            margin-bottom: 1rem;
        }
        
        .chat-form-group label {
            display: block;
            margin-bottom: 0.5rem;
            font-size: 0.88rem;
            font-weight: 600;
            color: var(--t1);
        }
        
        .chat-form-group input,
        .chat-form-group select,
        .chat-form-group textarea {
            width: 100%;
            padding: 0.7rem 0.85rem;
            border: 1px solid var(--bdr);
            border-radius: 0.5rem;
            background: rgba(255,255,255,.05);
            color: var(--t1);
            font-size: 0.92rem;
        }
        
        .chat-form-group input:focus,
        .chat-form-group select:focus,
        .chat-form-group textarea:focus {
            outline: none;
            border-color: rgba(255,255,255,.25);
        }
        
        .chat-toggle-option {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.75rem;
            background: rgba(255,255,255,.04);
            border: 1px solid var(--bdr);
            border-radius: 0.5rem;
            margin-bottom: 0.5rem;
        }
        
        .chat-toggle-option label {
            margin: 0;
            display: flex;
            flex-direction: column;
        }
        
        .chat-toggle-option .toggle-desc {
            font-size: 0.78rem;
            font-weight: normal;
            color: var(--t2);
        }
        
        /* Toggle switch */
        .toggle-switch {
            position: relative;
            width: 48px;
            height: 26px;
        }
        
        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }
        
        .toggle-slider {
            position: absolute;
            cursor: pointer;
            inset: 0;
            background-color: rgba(255,255,255,.1);
            transition: 0.3s;
            border-radius: 26px;
        }
        
        .toggle-slider:before {
            position: absolute;
            content: "";
            height: 20px;
            width: 20px;
            left: 3px;
            bottom: 3px;
            background-color: white;
            transition: 0.3s;
            border-radius: 50%;
        }
        
        .toggle-switch input:checked + .toggle-slider {
            background-color: var(--a);
        }
        
        .toggle-switch input:checked + .toggle-slider:before {
            transform: translateX(22px);
        }
        
        /* Landing page for creating rooms */
        .chat-landing {
            max-width: 900px;
            margin: 0 auto;
            padding: 3rem 1rem;
            text-align: center;
        }
        
        .chat-landing h1 {
            font-size: 2.5rem;
            margin-bottom: 1rem;
            color: var(--t1);
        }
        
        .chat-landing p {
            font-size: 1.05rem;
            color: var(--t2);
            margin-bottom: 2rem;
        }
        
        .chat-features {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 1rem;
            margin: 2rem 0;
            text-align: left;
        }
        
        @media (max-width: 900px) {
            .chat-features {
                grid-template-columns: repeat(2, 1fr);
            }
        }
        
        @media (max-width: 500px) {
            .chat-features {
                grid-template-columns: 1fr;
            }
        }
        
        .chat-feature {
            padding: 1.1rem;
            background: rgba(255,255,255,.05);
            border: 1px solid var(--bdr);
            border-radius: 0.75rem;
        }
        
        .chat-feature h2, .chat-feature h3 {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin: 0 0 0.5rem;
            font-size: 0.92rem;
            color: var(--t1);
        }
        
        .chat-feature-icon {
            width: 18px;
            height: 18px;
            color: var(--a);
            flex-shrink: 0;
        }
        
        .chat-feature p {
            margin: 0;
            font-size: 0.82rem;
            color: var(--t2);
            line-height: 1.45;
        }
        
        .chat-cta {
            display: flex;
            gap: 1rem;
            justify-content: center;
            flex-wrap: wrap;
        }
        
        .chat-cta .btn-primary {
            padding: 1rem 2rem;
            font-size: 1.1rem;
        }
        
        .join-room-input {
            display: flex;
            gap: 0.5rem;
            max-width: 400px;
            margin: 1.5rem auto 0;
        }
        
        .join-room-input input {
            flex: 1;
            padding: 0.7rem 1rem;
            border: 1px solid var(--bdr);
            border-radius: 0.5rem;
            background: rgba(255,255,255,.05);
            color: var(--t1);
        }
        
        /* System messages */
        .system-message {
            text-align: center;
            color: var(--t2);
            font-size: 0.82rem;
            padding: 0.4rem 0.75rem;
            background: rgba(255,255,255,.05);
            border-radius: 999px;
            display: inline-block;
            align-self: center;
        }
        
        /* Participants sidebar */
        .chat-with-sidebar {
            display: flex;
            gap: 1rem;
            height: calc(100vh - 80px - 74px);
            max-width: 1400px;
            margin: 72px auto 0;
            padding: 1rem;
            position: relative;
            z-index: 1;
        }
        
        .chat-main {
            flex: 1;
            display: flex;
            flex-direction: column;
            min-width: 0;
        }
        
        .chat-sidebar {
            width: 240px;
            background: rgba(255,255,255,.04);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid var(--bdr);
            border-radius: 1rem;
            padding: 1rem;
            display: flex;
            flex-direction: column;
        }
        
        .chat-sidebar h3 {
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--t2);
            margin: 0 0 0.85rem;
            padding-bottom: 0.5rem;
            border-bottom: 1px solid var(--bdr);
        }
        
        .participant-list {
            flex: 1;
            overflow-y: auto;
        }
        
        .participant {
            display: flex;
            align-items: center;
            gap: 0.65rem;
            padding: 0.45rem 0.5rem;
            border-radius: 0.5rem;
            margin-bottom: 0.2rem;
        }
        
        .participant:hover {
            background: rgba(255,255,255,.04);
        }
        
        .participant-avatar {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: 600;
            font-size: 0.75rem;
            position: relative;
        }
        
        .participant-avatar .online-indicator {
            position: absolute;
            bottom: -2px;
            right: -2px;
            width: 9px;
            height: 9px;
            background: #22c55e;
            border: 2px solid rgba(0,0,0,.4);
            border-radius: 50%;
        }
        
        .participant-info {
            flex: 1;
            min-width: 0;
        }
        
        .participant-name {
            font-size: 0.85rem;
            font-weight: 500;
            color: var(--t1);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .participant-role {
            font-size: 0.72rem;
            color: var(--t2);
        }
        
        @media (max-width: 768px) {
            .chat-with-sidebar {
                flex-direction: column;
            }
            
            .chat-sidebar {
                width: 100%;
                max-height: 180px;
            }
            
            .chat-landing h1 {
                font-size: 1.5rem;
            }
            
            .chat-landing {
                padding: 2rem 1rem;
            }
            
            .chat-cta {
                flex-direction: column;
                align-items: stretch;
            }
            
            .chat-cta button {
                width: 100%;
            }
            
            .message {
                max-width: 90%;
            }

            .chat-invite-btn span {
                display: none;
            }
        }
    
/* Block 1 */
@font-face{font-display:swap;src:local('system-ui')}

