
        :root {
            --whatsapp-green: #075e54;
            --messenger-blue: #0084ff;
            --instagram-gradient-start: #f09433;
            --instagram-gradient-end: #bc1888;
            --imessage-blue: #007aff;
            --tiktok-red: #fe2c55;
            --threads-black: #000000;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
        }

        body {
            background: #fafafa;
            padding: 20px;
            display: flex;
            justify-content: center;
            /* Center the main content horizontally */
            align-items: flex-start;
            /* Align content to the top */
            min-height: 100vh;
            gap: 20px;
            /* Space between chat and controls */
            flex-wrap: wrap;
            /* Allow wrapping on smaller screens */
        }

        .container {
            width: 100%;
            max-width: 500px;
            /* Fixed max width for chat display */
            background: white;
            border-radius: 12px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            overflow: hidden;
            flex-shrink: 0;
            /* Prevent chat from shrinking too much */
            display: flex;
            flex-direction: column;
            /* Ensure header, body are stacked */
            position: relative;
            /* For the reply options overlay */
        }

        .controls-column {
            width: 100%;
            max-width: 400px;
            /* Fixed max width for controls */
            background: white;
            border-radius: 12px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            padding: 15px;
            flex-shrink: 0;
            /* Prevent controls from shrinking too much */
        }

        /* Platform Selector */
        .platform-selector {
            display: flex;
            overflow-x: auto;
            padding: 10px;
            background: #f8f8f8;
            border-bottom: 1px solid #eee;
        }

        .platform-tab {
            padding: 8px 15px;
            border-radius: 20px;
            margin-right: 8px;
            font-size: 14px;
            font-weight: 500;
            white-space: nowrap;
            cursor: pointer;
            border: 1px solid transparent;
            transition: all 0.2s;
        }

        .platform-tab.active {
            border-color: currentColor;
        }

        .platform-tab.whatsapp {
            color: var(--whatsapp-green);
        }

        .platform-tab.messenger {
            color: var(--messenger-blue);
        }

        .platform-tab.instagram {
            background: linear-gradient(45deg, var(--instagram-gradient-start), var(--instagram-gradient-end));
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .platform-tab.imessage {
            color: var(--imessage-blue);
        }

        .platform-tab.tiktok {
            color: var(--tiktok-red);
        }

        .platform-tab.threads {
            color: var(--threads-black);
        }

        /* Chat Header */
        .chat-header {
            padding: 15px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            /* Space out items */
            border-bottom: 1px solid #eee;
            position: relative;
            /* For absolutely positioned icons */
        }

        .chat-header-left {
            display: flex;
            align-items: center;
        }

        .chat-header img {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            margin-right: 12px;
            object-fit: cover;
        }

        .chat-header-info h2 {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 2px;
        }

        .chat-header-info p {
            font-size: 12px;
            color: #999;
        }

        .chat-header-actions {
            display: flex;
            gap: 15px;
            font-size: 18px;
            color: #666;
        }

        .chat-header-actions i {
            cursor: pointer;
            transition: color 0.2s;
        }

        .chat-header-actions i:hover {
            color: #333;
        }

        /* Platform specific header colors for icons */
        .whatsapp .chat-header {
            background-color: var(--whatsapp-green);
            color: white;
        }

        .whatsapp .chat-header-info p {
            color: rgba(255, 255, 255, 0.8);
        }

        .whatsapp .chat-header-actions {
            color: white;
        }

        .messenger .chat-header {
            background-color: var(--messenger-blue);
            color: white;
        }

        .messenger .chat-header-info p {
            color: rgba(255, 255, 255, 0.8);
        }

        .messenger .chat-header-actions {
            color: white;
        }

        .imessage .chat-header-actions {
            color: var(--imessage-blue);
        }

        .tiktok .chat-header-actions {
            color: var(--tiktok-red);
        }

        /* Chat Body */
        .chat-body {
            padding: 10px;
            min-height: 400px;
            background-size: 100px;
            background-repeat: repeat;
            display: flex;
            flex-direction: column;
            overflow-y: auto;
            /* Enable scrolling for messages */
            flex-grow: 1;
            /* Allow chat body to expand */
        }

        .chat-body.whatsapp {
            background-image: url('https://web.whatsapp.com/img/bg-chat-tile-light_a4be512e7195b6b733d9110b408f075d.png');
            background-color: #e5ddd5;
        }

        .chat-body.messenger {
            background-color: #f0f2f5;
        }

        .chat-body.instagram {
            background-color: #fafafa;
        }

        .chat-body.imessage {
            background-color: #f6f6f6;
        }

        .chat-body.tiktok {
            background-color: #f8f8f8;
        }

        .chat-body.threads {
            background-color: #ffffff;
        }

        /* Messages */
        .message {
            max-width: 70%;
            padding: 8px 12px;
            border-radius: 18px;
            margin-bottom: 8px;
            position: relative;
            word-wrap: break-word;
            font-size: 14px;
            line-height: 1.4;
            cursor: pointer;
            /* To trigger reply options */
        }

        .received {
            align-self: flex-start;
            background: white;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        }

        .sent {
            align-self: flex-end;
        }

        /* Platform-specific message styles */
        .whatsapp .sent {
            background: #d9fdd3;
        }

        .messenger .sent {
            background: var(--messenger-blue);
            color: white;
        }

        .instagram .sent {
            /* Instagram gradient */
            background: linear-gradient(to right, #833ab4, #fd1d1d, #fcb045);
            color: white;
            border-radius: 25px;
            /* More pill-like */
            padding: 10px 16px;
        }

        .instagram .received {
            background: white;
            border: 1px solid #dbdbdb;
            border-radius: 25px;
            /* More pill-like */
            padding: 10px 16px;
        }

        .imessage .sent {
            background: var(--imessage-blue);
            color: white;
        }

        .tiktok .sent {
            background: var(--tiktok-red);
            color: white;
        }

        .threads .sent {
            background: #000;
            color: white;
        }

        .message-time {
            font-size: 11px;
            color: #999;
            float: right;
            margin-left: 8px;
            position: relative;
            bottom: -3px;
            white-space: nowrap;
            /* Prevent time from wrapping */
        }

        .instagram .message-time {
            color: #a8a8a8;
        }

        .tick {
            display: inline-flex;
            align-items: center;
            margin-left: 4px;
            position: relative;
            top: 1px;
        }

        .tick svg {
            width: 12px;
            height: 12px;
        }

        /* WhatsApp single tick (delivered) */
        .whatsapp .tick.single-tick svg {
            fill: #667781;
        }

        /* WhatsApp double tick (read) - enhanced for authenticity */
        .whatsapp .tick.double-tick {
            position: relative;
        }

        .whatsapp .tick.double-tick .tick-1 {
            position: relative;
            z-index: 1;
            fill: #4fc3f7;
        }

        .whatsapp .tick.double-tick .tick-2 {
            position: absolute;
            left: 4px;
            z-index: 2;
            fill: #4fc3f7;
        }

        .whatsapp .tick.read svg {
            fill: #4fc3f7;
        }

        /* Messenger tick styles */
        .messenger .tick svg {
            fill: rgba(255, 255, 255, 0.8);
            width: 10px;
            height: 10px;
        }

        /* iMessage tick styles */
        .imessage .tick svg {
            fill: #007aff;
            width: 10px;
            height: 10px;
        }

        /* Instagram tick styles */
        .instagram .tick svg {
            fill: #8e8e8e;
            width: 10px;
            height: 10px;
        }

        /* TikTok tick styles */
        .tiktok .tick svg {
            fill: rgba(255, 255, 255, 0.7);
            width: 10px;
            height: 10px;
        }

        /* Threads tick styles */
        .threads .tick svg {
            fill: #65676b;
            width: 10px;
            height: 10px;
        }

        /* iMessage text-based delivery indicator */
        .imessage .tick.imessage-tick {
            font-size: 10px;
            color: #8e8e93;
            font-weight: 400;
            margin-left: 8px;
        }

        /* Instagram specific styles */
        .instagram .chat-header {
            border-bottom: none;
            padding-bottom: 5px;
            background: white;
            /* Instagram header is typically white */
            color: black;
        }

        .instagram .chat-header-actions {
            color: black;
        }

        /* Instagram Reply Options Overlay */
        .instagram-reply-options {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            /* Semi-transparent overlay */
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 10;
            /* Above chat messages */
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.3s ease, visibility 0.3s ease;
        }

        .instagram-reply-options.show {
            opacity: 1;
            visibility: visible;
        }

        .instagram-reply-menu {
            background: white;
            border-radius: 12px;
            padding: 10px 0;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
            width: 80%;
            max-width: 250px;
        }

        .instagram-reply-menu-item {
            padding: 12px 20px;
            display: flex;
            align-items: center;
            gap: 15px;
            font-size: 15px;
            color: #333;
            cursor: pointer;
            transition: background-color 0.2s;
        }

        .instagram-reply-menu-item:hover {
            background-color: #f0f0f0;
        }

        .instagram-reply-menu-item i {
            width: 20px;
            /* Align icons */
            text-align: center;
        }

        /* Typing Indicator */
        .typing-indicator {
            background: white;
            padding: 10px 15px;
            border-radius: 18px;
            align-self: flex-start;
            display: inline-flex;
            gap: 5px;
            margin-bottom: 8px;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
            max-width: 60px;
            align-items: center;
            justify-content: center;
        }

        .typing-dot {
            width: 8px;
            height: 8px;
            background: #999;
            border-radius: 50%;
            animation: typingAnimation 1.4s infinite ease-in-out;
        }

        @keyframes typingAnimation {
            0%, 80%, 100% {
                transform: scale(0.6);
                opacity: 0.4;
            }
            40% {
                transform: scale(1);
                opacity: 1;
            }
        }

        .typing-dot:nth-child(2) {
            animation-delay: 0.2s;
        }

        .typing-dot:nth-child(3) {
            animation-delay: 0.4s;
        }

        /* Platform-specific typing indicator styles */
        .whatsapp .typing-indicator {
            background: #DCF8C6;
            border-radius: 7.5px 7.5px 7.5px 0;
        }

        .whatsapp .typing-dot {
            background: #128C7E;
        }

        .messenger .typing-indicator {
            background: #0084ff;
            border-radius: 18px;
        }

        .messenger .typing-dot {
            background: white;
        }

        .instagram .typing-indicator {
            background: #f0f0f0;
            border-radius: 18px;
            border: 1px solid #dbdbdb;
        }

        .instagram .typing-dot {
            background: #262626;
        }

        .imessage .typing-indicator {
            background: #e5e5ea;
            border-radius: 18px;
        }

        .imessage .typing-dot {
            background: #8e8e93;
        }

        .tiktok .typing-indicator {
            background: #161823;
            border-radius: 12px;
        }

        .tiktok .typing-dot {
            background: #fe2c55;
        }

        .threads .typing-indicator {
            background: #f3f4f6;
            border-radius: 18px;
            border: 1px solid #e5e7eb;
        }

        .threads .typing-dot {
            background: #000;
        }

        /* Controls */
        .controls-column .form-group {
            display: flex;
            flex-direction: column;
            gap: 6px;
            margin-bottom: 12px;
        }

        label {
            font-size: 13px;
            font-weight: 500;
            color: #333;
        }

        input[type="text"],
        input[type="date"],
        input[type="time"],
        textarea,
        select {
            padding: 10px 12px;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-size: 14px;
            background: white;
        }

        input[type="file"] {
            padding: 6px 0;
            /* Adjust padding for file input */
        }

        textarea {
            min-height: 120px;
            /* Increased height for messages */
            resize: vertical;
        }

        .emoji-picker {
            display: flex;
            flex-wrap: wrap;
            gap: 5px;
            margin-bottom: 10px;
            max-height: 100px;
            overflow-y: auto;
            padding: 5px;
            border: 1px solid #eee;
            /* Add border for emoji picker */
            border-radius: 8px;
        }

        .emoji-btn {
            font-size: 20px;
            background: none;
            border: none;
            cursor: pointer;
            padding: 2px;
        }

        .emoji-btn:hover {
            transform: scale(1.2);
        }

        button {
            padding: 12px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            transition: all 0.2s;
            border: none;
        }

        .generate-btn {
            background: #3897f0;
            color: white;
            width: 100%;
            margin-bottom: 10px;
        }

        .generate-btn:hover {
            background: #2684f0;
        }

        .share-buttons {
            display: flex;
            flex-wrap: wrap;
            /* Allow wrapping of share buttons */
            gap: 8px;
        }

        .share-btn {
            flex: 1 1 calc(50% - 4px);
            /* Two buttons per row */
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            background: white;
            border: 1px solid #ddd;
            color: #333;
            text-decoration: none;
            /* For link buttons */
        }

        @media (min-width: 600px) {
            .share-btn {
                flex: 1;
                /* More flexible on wider screens */
            }
        }

        .share-btn:hover {
            background: #f0f0f0;
        }

        /* Platform color overrides */
        .whatsapp .generate-btn {
            background: var(--whatsapp-green);
        }

        .messenger .generate-btn {
            background: var(--messenger-blue);
        }

        .instagram .generate-btn {
            background: linear-gradient(45deg, var(--instagram-gradient-start), var(--instagram-gradient-end));
        }

        .imessage .generate-btn {
            background: var(--imessage-blue);
        }

        .tiktok .generate-btn {
            background: var(--tiktok-red);
        }

        .threads .generate-btn {
            background: var(--threads-black);
            color: white;
        }

        /* Website Description */
        .website-description {
            font-size: 14px;
            color: #555;
            margin-top: 20px;
            padding: 15px;
            background: #e9e9e9;
            border-radius: 8px;
            line-height: 1.5;
            max-width: 800px;
            /* Match disclaimer width */
        }

        /* Disclaimer */
        .disclaimer {
            font-size: 11px;
            color: #888;
            margin-top: 20px;
            text-align: center;
            max-width: 800px;
        }

        /* Responsive adjustments */
        @media (max-width: 900px) {
            body {
                flex-direction: column;
                /* Stack columns on small screens */
                align-items: center;
                gap: 20px;
            }

            .container,
            .controls-column {
                max-width: 95%;
                /* Adjust max-width for better fit on smaller screens */
            }
        }
    