#compose-body {
    flex-grow: 1;
    border-bottom: 1px solid #e1e3e1;
    padding: 15px;
    background-color: #fff;
    overflow: auto;
    
    /* CSS Custom Properties for easy maintenance */
    --scrollbar-thumb: #c1c1c1;
    --scrollbar-track: #f1f1f1;
    --scrollbar-width: 8px;
}

/* Modern browsers with scrollbar-* support (Firefox, Chrome 121+) */
@supports (scrollbar-width: auto) {
    #compose-body {
        scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
        scrollbar-width: thin;
    }
}

/* Webkit browsers with more detailed control */
@supports selector(::-webkit-scrollbar) {
    #compose-body::-webkit-scrollbar {
        width: var(--scrollbar-width);
        height: var(--scrollbar-width);
    }
    
    #compose-body::-webkit-scrollbar-track {
        background: var(--scrollbar-track);
        border-radius: 10px;
    }
    
    #compose-body::-webkit-scrollbar-thumb {
        background: var(--scrollbar-thumb);
        border-radius: 10px;
        border: 2px solid var(--scrollbar-track);
    }
    
    #compose-body::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }
}
        
#compose-body a {
    color: #2563eb;
    text-decoration: underline;
}
        
        .modal-compose-backdrop {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            z-index: 9999;
            display: none;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .modal-compose-backdrop.show {
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 1;
        }

        .modal-compose-container {
            background: white;
            border-radius: 6px;
            box-shadow: 0 8px 10px 1px rgba(0, 0, 0, .14), 0 3px 14px 2px rgba(0, 0, 0, .12), 0 5px 5px -3px rgba(0, 0, 0, .2);
            width: 90%;
            max-width: 1300px;
            max-height: 90vh;
            overflow: auto;
            transform: scale(0.9) translateY(20px);
            transition: transform 0.3s ease;
        }

        .modal-compose-backdrop.show .modal-compose-container {
            transform: scale(1) translateY(0);
        }

        .modal-compose-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding-bottom: 10px;
            padding-top: 10px;
            height: auto;
            line-height: 20px;
            padding-left: 16px;
            padding-right: 10px;
            background-color: #f2f6fc;
        }

        .modal-compose-title {
            font-size: 18px;
            font-weight: 500;
            margin: 0;
            color: #333;
            padding: 0;
            font-family: arial;
        }

        .modal-compose-close {
            background: none;
            border: none;
            font-size: 20px;
            padding: 0;
            margin: 0;
            cursor: pointer;
            color: #666;
            border-radius: 4px;
            transition: background-color 0.2s ease;
        }

        .modal-compose-close:hover {
            background: rgba(0, 0, 0, 0.1);
        }

        .modal-compose-body {
            height: calc(90vh - 80px);
            display: flex;
            flex-direction: column;
            padding: 10px;
        }


        /* Apple Mail Style Compose Header */
        .email-token-container{
            display: flex;
        }
        .compose-header {
            border-bottom: 1px solid #e5e5e5;
            margin-bottom: 20px;
        }

        .compose-header .compose-table {
            width: 100%;
            border-collapse: collapse;

        }

        .compose-header .compose-table tr {
            border-bottom: 1px solid #e5e5e5;
        }

        .compose-header .compose-table tr:last-child {
            border-bottom: none;
        }

        .compose-header .compose-table td {
            padding: 0;
            vertical-align: middle;
            height: 35px;
        }

        .compose-header .compose-field {
            display: flex;
            align-items: center;
            height: 35px;
            padding: 0 16px;
        }

        .compose-header .compose-field span {
            font-size: 15px;
            color: #333;
            min-width: 80px;
            flex-shrink: 0;
        }

        .compose-header .compose-field input,
        .compose-header .compose-field select {
            flex: 1;
            border: none;
            background: none;
            width: 100%;
            font-size: 15px;
            color: #333;
            outline: none;
            padding: 12px 8px;
        }

        .compose-header .compose-field input::placeholder {
            color: #999;
        }

        /* From row with CC/BCC on right */
        .compose-header .compose-from-row .compose-field {
            justify-content: space-between;
        }

        .compose-header .compose-from-row select {
            flex: 1;
            margin-right: 16px;
        }

        .compose-header .compose-actions {
            display: flex;
            gap: 12px;
            flex-shrink: 0;
        }

        .compose-header .compose-toggle {
            background: none;
            border: none;
            font-size: 15px;
            color: #007aff;
            cursor: pointer;
            padding: 0;
            text-decoration: none;
        }

        .compose-header .compose-toggle:hover {
            opacity: 0.7;
        }

        /* CC/BCC rows when shown */
        .compose-header .compose-cc-row,
        .compose-header .compose-bcc-row {
            display: none;
        }

        .compose-header .compose-cc-row.show,
        .compose-header .compose-bcc-row.show {
            display: table-row;
        }
        .textbox{
            display: flex; flex-direction: column; flex: 1; min-height: 0;
        }
        /* Email tokens - Apple Mail style */
        .compose-token {
            display: inline-flex;
            align-items: center;
            background: #e5e5ea;
            border-radius: 12px;
            padding: 4px 8px;
            margin-right: 6px;
            margin-bottom: 4px;
            font-size: 14px;
        }

        .compose-token .token-text {
            margin-right: 4px;
        }

        .compose-token .token-delete {
            background: none;
            border: none;
            font-size: 14px;
            cursor: pointer;
            color: #666;
            padding: 0;
            margin-left: 4px;
        }

        /* Mobile responsiveness */
        @media (max-height: 1000px) {
            .modal-compose-container{
                max-height: 95vh;
                max-width: 1000px;
            }
        }
        @media (max-width: 768px) {
            .modal-compose-container {
                width: 95%;
                max-height: 95vh;
                border-radius: 8px;
            }
            
            .modal-compose-header {
                padding: 16px 20px;
            }
            
            .modal-compose-body {
                height: calc(95vh - 70px);
            }

            .compose-header {
                border-bottom: 1px solid #e5e5e5;
            }

            .compose-header .compose-field {
                padding: 0 12px;
                height: 40px;
            }

            .compose-header .compose-field span {
                min-width: 70px;
                font-size: 14px;
            }

            .compose-header .compose-field input,
            .compose-header .compose-field select {
                font-size: 14px;
                padding: 10px 6px;
            }

            .compose-header .compose-actions {
                gap: 8px;
            }

            .compose-header .compose-toggle {
                font-size: 14px;
            }
        }