html,
    body {
        height: 100%;
        overflow: hidden;
    }

    #app {
        height: 100vh;
    }

    .sidebar,
    .main-panel,
    .right-panel {
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .sidebar {
        border-right: 1px solid rgba(0, 0, 0, .1);
    }

    .controls {
        padding: .75rem;
        border-bottom: 1px solid rgba(0, 0, 0, .1);
    }

    .messages-list {
        flex: 1 1 0;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .message-wrap {
        flex: 1 1 0;
        overflow: auto;
        padding: 1rem;
    }

    .right-wrap {
        flex: 1 1 0;
        overflow: auto;
        padding: 1rem;
    }

    .list-item-sub {
        font-size: .85rem;
        color: #666;
    }

    .unread-dot {
        font-size: .5rem;
        line-height: 1;
    }

    .min-w-0 {
        min-width: 0;
    }

    .wrap {
        white-space: pre-wrap;
    }

    .list-group-item.active .list-item-sub {
        color: #fff;
    }

    .list-group-item.active .bi-reply {
        color: #fff !important;
    }

    .list-group-item {
        cursor: pointer;
    }

    .quill-wrapper {
        display: flex;
        flex-direction: column;
        min-height: 280px;
    }

    .quill-wrapper .ql-toolbar {
        flex: 0 0 auto;
    }

    .quill-wrapper .ql-container {
        flex: 1 1 auto;
        height: auto;
    }

    .original-preview {
        border-top: 1px solid rgba(0, 0, 0, .1);
        padding-top: 1rem;
        margin-top: .5rem;
    }

    .forward-headers {
        font-size: .9rem;
        border: 1px solid rgba(0, 0, 0, .1);
        padding: .5rem .75rem;
        background: #f8f9fa;
    }

    .forward-headers dt {
        width: 4.5rem;
    }

    .forward-headers dd {
        margin-left: 5.5rem;
    }

    .small-muted {
        font-size: .875rem;
        color: #6c757d;
    }

    textarea.merge-json {
        font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    }

    /* Mobile responsiveness */
    @media (max-width: 767.98px) {
        .sidebar, .main-panel, .right-panel {
            transition: all 0.3s ease-in-out;
        }

        .card-header .btn-sm {
            font-size: 0.75rem;
            padding: 0.25rem 0.5rem;
        }

        .message-wrap {
            padding: 0.5rem;
        }

        .right-wrap {
            padding: 0.5rem;
        }
    }

    .settings-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1050;
    }

    .settings-modal {
        background: white;
        border-radius: 0.375rem;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
        max-width: 90vw;
        max-height: 90vh;
        width: 800px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .settings-header {
        padding: 1rem 1.5rem;
        border-bottom: 1px solid #dee2e6;
        display: flex;
        justify-content: between;
        align-items: center;
    }

    .settings-header h5 {
        margin: 0;
        flex: 1;
    }

    .settings-header .btn-close {
        margin-left: auto;
    }

    .settings-body {
        padding: 1.5rem;
        overflow-y: auto;
        flex: 1;
    }

    .settings-footer {
        padding: 1rem 1.5rem;
        border-top: 1px solid #dee2e6;
        display: flex;
        justify-content: flex-end;
        gap: 0.5rem;
    }