:root {
    --compose-title-exit: rgba(255, 255, 255, 0.853);
    --top-bottom-bg: #2b2b2be1;
    --top-bottom: #ffffff;
    --send-progress-bg: #00ffb3;
    --send-progress: #e8e8e8;
    
}
.light {
    --compose-title-exit: rgba(0, 0, 0, 0.853);
    --top-bottom-bg: #dfdfdfe1;
    --top-bottom: #000000;
    --send-progress-bg: #00ffb3;
    --send-progress: #000000;
}

#quest-container {
    display: flex;
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    transition: opacity var(--aspeed) ease;
    justify-content: center;
    align-items: center;
    background: var(--shadow-bg);
    -moz-user-select: none;
    user-select: none;
}
#quest-container.show {
    opacity: 1;
    pointer-events: auto;
}
#quest-container.show, #quest-container.show .top-bottom {
    opacity: 1;
    pointer-events: auto;
}

#quest-container .top-bottom {
    width: 300px;
    min-height: 0;
    max-height: 250px;
    margin: auto;
    display: flex;
    flex-direction: column;
    background: var(--top-bottom-bg);
    color: var(--top-bottom);
    border-radius: var(--border-radius);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--aspeed) ease;
}
#quest-container .top {
    min-height: 0;
    max-height: 200px;
    /* margin: auto; */
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    font-size: 16px;
    padding: 21px 28px 21px 28px;
    overflow: auto;
}
#quest-container .bottom {
    min-height: 50px;
    max-height: 50px;
    display: flex;
    align-items: flex-end;
    
}

#quest-container .bottom--left-right {
    width: 100%;
    display: flex;
    gap: 7px;
}
#quest-container .bottom--left {
    width: 100%;
}
#quest-container .bottom--right {
    width: 100%;
}

#quest-container button {
    padding: 0 0 3px 0;
    width: 100%;
    margin: auto;
    transition: background var(--aspeed) ease, color var(--aspeed) ease;
}
#quest-container button:hover {
    background: var(--button-bg-hover);
    color: var(--button-hover);
}
/* 


    const tb = document.createElement('div');
    tb.className = 'top-bottom';
    const t = document.createElement('div');
    t.className = 'top';
    const b = document.createElement('div');
    b.className = 'bottom';
    const b_lr = document.createElement('div');
    b_lr.className = 'bottom--left-right'
    const b_l = document.createElement('div');
    b_l.className = 'bottom--left'
    const b_r = document.createElement('div');
    b_r.className = 'bottom--right' 
    
    */
    
#compose-title-exit {
    position: absolute;
    top: 14px;
    right: 14px;

    width: 28px;
    height: 28px;

    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;

    border-radius: 50%;
}

#compose-title-exit::before,
#compose-title-exit::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;

    width: 16px;
    height: 2px;

    background: var(--compose-title-exit);
    border-radius: 1px;

    transform-origin: center;
}

#compose-title-exit::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

#compose-title-exit::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.compose-title {
    min-height: var(--compose-title-height);
    max-height: var(--compose-title-height);
    display: flex;
    align-items: center;
    /* padding: calc(var(--compose-title-padding)/4) var(--compose-title-padding) 0 var(--compose-title-padding); */
}
#compose-title-exit {
    border-radius: 50%;
    height: var(--compose-title-exit-size);
    width: var(--compose-title-exit-size);
}

.compose-wrapper #compose {
    background: var(--compose-bg);
    color: var(--compose);
}

.compose-container {
    position: fixed;
    left: 0;
    top: 0;
    width: 100dvw;
    height: 100dvh;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--aspeed) ease;
    background: var(--shadow-bg);
    z-index: 10;
}
.compose-container.show {
    pointer-events: auto;
    opacity: 1;
}
.compose-container.show .compose-wrapper, #compose-container.show .compose-wrapper {
    pointer-events: auto;
    transform: translateX(calc(-100vw - 24px));
}
.compose-wrapper {
    position: fixed;
    bottom: var(--actions-sub-padding);
    right: calc(-100vw);
    
    display: flex;
    justify-content: flex-end;
    flex-direction: column;
    gap: var(--gap2x);
    transition: transform var(--aspeed) ease;
    max-height: 90dvh;
    min-width: 500px;
    max-width: 500px;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--compose-bg);

}
.compose-wrapper input {
    padding: 0 16px 0 16px;
}
#compose {
    margin: 14px auto 14px auto;
    background: var(--compose-bg);
    color: var(--compose);
    padding: 0 32px 0 32px;
    border-radius: 32px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: var(--gap3x);
    font-weight: 600;
    /* font-size: 15px; */
}

#compose img {
    width: 32px;
    margin: auto 0 auto 0;
}

.reply-message {
    cursor: text;
    background: var(--reply-message-bg);
    color: var(--reply-message);
    border-radius: calc(var(--border-radius)/2);
    padding: 14px;
    margin-bottom: 7px;
}

.to-container {
    display: flex;
    flex-direction: row;
}

.flex {
    display: flex;
}
.margin-auto {
    margin: auto;
}
.width-100 {
    width: 100%;
}

.flex-grow {
    flex-grow: 1;
}

.to-sub {
    display: flex;
    flex-direction: column;
    transition: flex-direction 1s ease;
    align-items: center;
    gap: var(--gap2x);
}
.to-sub div div {
    background: var(--to-sub-bg);
    display: flex;
    align-items: center;
    padding: 16px;
}


#to, #sub, #body {
    padding: 16px;
}
#to, #sub {
    min-height: 50px;
    max-height: 50px;

    overflow-x: auto;
    overflow-y: hidden;
    /* display: block; */
    white-space: nowrap;
    /* text-overflow: ellipsis; */
}


#body {
    max-height: 50vh;
    overflow-y: auto;
    overflow-x: hidden;
}

#send {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: relative;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    margin-right: 0;
    margin-left: auto;
    width: 100%;


}
#send img {
    margin-left: auto;
    width: 32px;
    margin-right: 14px;
}


.send-progress {
    display: flex;
    position: absolute;
    left: 0;
    top: 0;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
    min-height: 100%;
    opacity: 0;
    min-width: 0;
    width: 0;
    pointer-events: none;
    transition: min-width 1s ease;
    background: var(--send-progress-bg);
    color: var(--send-progress);
}
.send-progress.progress {
    opacity: 1;
    min-width: 100%;
}
.send-progress img {
    margin-left: auto;
    width: 32px;
    margin-right: 14px;

}



@media (max-width: 768px) {
    .to-sub {
        flex-direction: column;
    }
}


@media (max-width: 768px) {
    #main {
        /* flex-direction: column; */
    }
    #compose {
        margin: 0;
        /* padding: 0; */
    }
    
    .view-container {
        width: 100%;

    }

    #folders-ext {
        width: auto;
    }

    .compose-wrapper {
        min-width: calc(100vw - 14px);
        max-width: calc(100vw - 14px);
    }
    #compose-container.show .compose-wrapper {
        transform: translateX(calc(-100vw - 7px));

    }
}
.attachments-container {
    display: flex;
    min-height: 0;
    flex-direction: column;
}
.send-attach {
    display: flex;
    width: 100%;
    overflow: hidden;
    gap: var(--gap2x);
}
.attachments-container input[type="file"] {
    opacity: 0;
    height: 0;
}
.attachments-container button {
}
#attach-btn {
    display: flex;
    align-items: center;
    gap: 14px;
}
#attach-btn img {
    width: 32px;
    margin-left: 14px;
}
.attachment span {
    display: inline-block;
    margin: auto;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-left: 14px;
}
.attachment {
}