.mekon-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    color: #1f2937;
}

.mekon-brand-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.02em;
    white-space: nowrap;
}

.mekon-brand-subtitle {
    font-size: .95rem;
    color: #6b7280;
}

body.task-login {
    background: linear-gradient(180deg, #f7f9fc 0%, #eef3fb 100%);
}

body.task-login #layout-content {
    max-width: 460px;
    margin: 0 auto;
    padding: 6rem 1.5rem 2rem;
}

body.task-login #logo {
    display: none !important;
}

body.task-login .mekon-brand-login {
    flex-direction: row;
    margin: 0 0 1.5rem;
}

body.task-login .mekon-brand-login .mekon-brand-title {
    font-size: 2rem;
}

body.task-login #login-form {
    top: auto;
    width: 100%;
    max-width: 420px;
    padding: 1.5rem 1.5rem 1rem;
    border: 1px solid #dbe4f0;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

body.task-login #login-form table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 1rem;
}

body.task-login #login-form tbody {
    display: table-row-group;
}

body.task-login #login-form tr {
    display: table-row;
}

body.task-login #login-form td {
    display: table-cell;
    width: auto;
    text-align: left;
    vertical-align: middle;
}

body.task-login #login-form td.title {
    position: relative;
    width: 52px;
    padding: 0 .75rem 0 0;
    font-weight: 600;
    color: #334155;
    background: transparent !important;
    border: 0 !important;
}

body.task-login #login-form td.title:before {
    content: "";
    display: block;
    width: 44px;
    height: 44px;
    border: 1px solid #cfd9e6;
    border-radius: 12px;
    background-color: #f8fafc;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 18px 18px;
}

body.task-login #login-form td.title label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.task-login #login-form tr:nth-child(1) td.title:before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21a8 8 0 0 0-16 0'/%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3C/svg%3E");
}

body.task-login #login-form tr:nth-child(2) td.title:before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 1 1 8 0v3'/%3E%3C/svg%3E");
}

body.task-login #login-form td.input {
    display: table-cell;
    width: 100%;
    padding: 0;
}

body.task-login #login-form .form-control {
    display: block;
    width: 100% !important;
    min-width: 0;
    height: 44px;
    border: 1px solid #cfd9e6;
    border-radius: 12px;
    box-shadow: none;
}

body.task-login #login-form .form-control:focus {
    border-color: #f04e23;
    box-shadow: 0 0 0 3px rgba(240, 78, 35, 0.14);
}

body.task-login #rcmloginsubmit {
    width: 100%;
    height: 46px;
    border: 0;
    border-radius: 12px;
    background: #f04e23;
    color: #fff;
    font-weight: 700;
}

body.task-login #login-footer {
    margin-top: 1rem;
    text-align: center;
    color: #64748b;
}

body.task-login #login-footer > div {
    padding: 0;
    background: transparent;
}

#layout-menu .popover-header {
    align-items: center;
    justify-content: center;
    background: #fff !important;
    border-bottom: 1px solid #e5e7eb;
}

#layout-menu .popover-header #logo {
    display: none !important;
}

#layout-menu .mekon-brand-menu {
    align-items: center;
    flex: 1;
    height: 100%;
    justify-content: center;
}

body.task-mail #layout-menu {
    width: 88px;
    min-width: 88px;
    flex: 0 0 88px;
}

body.task-mail #layout-menu .popover-header {
    padding: .5rem .25rem;
}

body.task-mail #layout-menu .mekon-brand-title {
    font-size: .92rem;
    line-height: 1.15;
    white-space: normal;
    text-align: center;
}

body.task-mail #layout-sidebar,
body.task-mail #layout-list,
body.task-mail #layout-content {
    background: #ffffff;
}

body.task-mail #layout {
    background: #f3f6fb;
}

body.task-mail #layout-sidebar {
    min-width: 250px;
    max-width: 340px;
    flex: 0 0 250px;
    border-right: 1px solid #e5e7eb;
}

body.task-mail #layout-list {
    max-width: 33%;
    border-right: 1px solid #e5e7eb;
}

body.task-mail .mekon-remote-pane {
    display: none;
    height: 100%;
    background: #fff;
}

body.task-mail.mekon-remote-active #messagelist,
body.task-mail.mekon-remote-active #layout-list .pagenav,
body.task-mail.mekon-remote-active #layout-content .iframe-wrapper iframe {
    display: none !important;
}

body.task-mail.mekon-remote-active #mekon-remote-list,
body.task-mail.mekon-remote-active #mekon-remote-preview {
    display: block !important;
}

body.task-mail.mekon-remote-active #layout-list .searchbar {
    display: none;
}

body.task-mail #mekon-remote-list {
    overflow: auto;
}

body.task-mail #mekon-remote-preview {
    overflow: auto;
    background: #fbfdff;
    height: 100%;
    max-height: calc(100vh - 128px);
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

body.task-mail .mekon-remote-empty {
    padding: 1.25rem 1rem;
    color: #64748b;
    font-size: .9rem;
}

body.task-mail .mekon-remote-message {
    display: block;
    padding: .85rem 1rem;
    color: #0f172a;
    text-decoration: none;
    border-bottom: 1px solid #eef2f7;
}

body.task-mail .mekon-remote-message:hover,
body.task-mail .mekon-remote-message:focus,
body.task-mail .mekon-remote-message.active {
    background: #eef4ff;
    color: #1d4ed8;
}

body.task-mail .mekon-remote-message-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .25rem;
}

body.task-mail .mekon-remote-message-subject {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .45rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.task-mail .mekon-remote-message-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .25rem;
    flex: 0 0 auto;
}

body.task-mail .mekon-remote-attachment-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: .82rem;
    font-weight: 700;
    flex: 0 0 auto;
}

body.task-mail .mekon-remote-message-from,
body.task-mail .mekon-remote-message-meta {
    color: #64748b;
    font-size: .82rem;
}

body.task-mail .mekon-remote-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid #eef2f7;
    background: #fff;
    position: sticky;
    top: 56px;
    z-index: 2;
}

body.task-mail .mekon-remote-search {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid #eef2f7;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 3;
}

body.task-mail .mekon-remote-search-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 38px;
    padding: 0 .9rem;
    border: 1px solid #d9e2ee;
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
}

body.task-mail .mekon-remote-search-input:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

body.task-mail .mekon-remote-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 .9rem;
    border: 1px solid #d9e2ee;
    border-radius: 999px;
    background: #fff;
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 600;
}

body.task-mail .mekon-remote-search-btn:hover,
body.task-mail .mekon-remote-search-btn:focus {
    background: #eef4ff;
    border-color: #bfd3ff;
}

body.task-mail .mekon-remote-search-clear {
    color: #64748b;
}

body.task-mail .mekon-remote-pagination-info {
    color: #64748b;
    font-size: .82rem;
}

body.task-mail .mekon-remote-pagination-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
}

body.task-mail .mekon-remote-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 .7rem;
    border: 1px solid #d9e2ee;
    border-radius: 999px;
    background: #fff;
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 600;
}

body.task-mail .mekon-remote-page-btn.disabled {
    opacity: .45;
    pointer-events: none;
}

body.task-mail .mekon-remote-preview-card {
    padding: 1.1rem 1.25rem;
    min-height: 100%;
    box-sizing: border-box;
    padding-bottom: 2rem;
}

body.task-mail .mekon-remote-preview-top {
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1rem;
}

body.task-mail .mekon-remote-preview-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: .75rem;
}

body.task-mail .mekon-remote-preview-meta {
    color: #64748b;
    font-size: .85rem;
    margin-bottom: .35rem;
}

body.task-mail .mekon-remote-preview-actions {
    margin-top: .85rem;
}

body.task-mail .mekon-remote-compose {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 .8rem;
    border: 1px solid #d9e2ee;
    border-radius: 999px;
    background: #fff;
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 600;
}

body.task-mail .mekon-remote-compose:hover,
body.task-mail .mekon-remote-compose:focus {
    background: #eef4ff;
    border-color: #bfd3ff;
}

body.task-mail .mekon-remote-compose.disabled {
    opacity: .6;
    pointer-events: none;
}

body.task-mail .mekon-remote-translate-btn {
    margin-left: .5rem;
}

body.task-mail .mekon-remote-translation-card {
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    background: #f8fbff;
}

body.task-mail .mekon-remote-translation-title {
    margin-bottom: .6rem;
    color: #1e3a8a;
    font-size: .84rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

body.task-mail .mekon-remote-translation-error {
    color: #991b1b;
    background: #fff5f5;
    border-color: #fecaca;
}

body.task-mail .mekon-remote-attachments {
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
}

body.task-mail .mekon-remote-attachments-title {
    margin-bottom: .75rem;
    color: #0f172a;
    font-size: .9rem;
    font-weight: 700;
}

body.task-mail .mekon-remote-attachment-item {
    display: block;
    padding: .7rem .8rem;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    background: #f8fafc;
}

body.task-mail .mekon-remote-attachment-item + .mekon-remote-attachment-item {
    margin-top: .6rem;
}

body.task-mail .mekon-remote-attachment-item:hover,
body.task-mail .mekon-remote-attachment-item:focus {
    background: #eef4ff;
    border-color: #bfd3ff;
}

body.task-mail .mekon-remote-attachment-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .75rem;
    flex-wrap: wrap;
}

body.task-mail .mekon-remote-attachment-name {
    color: #0f172a;
    font-size: .92rem;
    font-weight: 600;
    word-break: break-word;
}

body.task-mail .mekon-remote-attachment-meta {
    margin-top: .2rem;
    color: #64748b;
    font-size: .8rem;
    word-break: break-word;
}

body.task-mail .mekon-remote-preview-html {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1rem;
    overflow: auto;
    margin-bottom: 1rem;
}

body.task-mail .mekon-remote-preview-html img {
    max-width: 100%;
    height: auto;
}

body.task-mail .mekon-remote-preview-text {
    white-space: pre-wrap;
    word-break: break-word;
}

body.task-mail #layout-content .iframe-wrapper {
    height: calc(100vh - 112px);
    min-height: 0;
}

body.task-mail #mekon-remote-preview::-webkit-scrollbar {
    width: 8px;
}

body.task-mail #mekon-remote-preview::-webkit-scrollbar-track {
    background: transparent;
}

body.task-mail #mekon-remote-preview::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

body.task-mail #mekon-remote-preview::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
    background-clip: padding-box;
}

body.task-mail #layout-sidebar > .header,
body.task-mail #layout-list > .header,
body.task-mail #layout-content > .header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

body.task-mail #mekon-remote-mail {
    margin-top: .65rem;
    padding-top: .65rem;
    border-top: 1px solid #e5e7eb;
}

body.task-mail .mekon-remote-sidebar-empty {
    margin: 0 .75rem;
    padding: .85rem .95rem;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    color: #64748b;
    font-size: .84rem;
    line-height: 1.45;
}

body.task-mail .mekon-remote-sidebar-empty a {
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 600;
}

body.task-mail .mekon-remote-section {
    padding: 0 0 .35rem;
}

body.task-mail .mekon-remote-title {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .55rem 1rem .35rem;
    font-size: .78rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .04em;
}

body.task-mail .mekon-remote-title:before {
    content: "\25BE";
    font-size: .72rem;
    color: #94a3b8;
}

body.task-mail .mekon-remote-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

body.task-mail .mekon-remote-list li {
    margin: 0;
    padding: 0;
}

body.task-mail .mekon-remote-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-height: 36px;
    padding: .45rem 1rem .45rem 1.35rem;
    color: #334155;
    text-decoration: none;
    border-radius: 10px;
    margin: 0 .45rem;
}

body.task-mail .mekon-remote-link:hover,
body.task-mail .mekon-remote-link:focus {
    background: #eef4ff;
    color: #1d4ed8;
}

body.task-mail .mekon-remote-link.active {
    background: #eef4ff;
    color: #1d4ed8;
    font-weight: 600;
}

body.task-mail .mekon-remote-link:before {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid #cbd5e1;
    border-radius: 3px;
    background: #fff;
    flex: 0 0 14px;
}

body.task-mail #mailsearchform {
    margin: .75rem;
    border: 1px solid #d9e2ee;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

body.task-mail #mailsearchform input,
body.task-mail #mailsearchform .form-control {
    border-radius: 14px;
}

body.task-mail #messagelist tbody tr td,
body.task-mail #mailboxlist li a {
    transition: background-color .15s ease, color .15s ease;
}

body.task-mail #messagelist tbody tr.selected td,
body.task-mail #messagelist tbody tr:hover td {
    background: #eef4ff;
}

body.task-mail #messagelist tbody tr.mekon-group-master .mekon-group-subject {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

body.task-mail #messagelist tbody tr.mekon-group-master .mekon-thread-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #eef2ff;
    color: #1d4ed8;
    cursor: pointer;
    flex: 0 0 22px;
}

body.task-mail #messagelist tbody tr.mekon-group-master .mekon-thread-toggle:hover {
    background: #dbeafe;
}

body.task-mail #messagelist tbody tr.mekon-group-master .mekon-thread-toggle .inner {
    display: none;
}

body.task-mail #messagelist tbody tr.mekon-group-master .mekon-thread-toggle-icon {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    margin-top: -1px;
}

body.task-mail #messagelist tbody tr.mekon-group-expanded .mekon-thread-toggle-icon {
    transform: rotate(45deg);
    margin-top: -3px;
}

body.task-mail #messagelist tbody tr.mekon-group-master .mekon-thread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    padding: 0 .45rem;
    border-radius: 999px;
    background: #f04e23;
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    line-height: 1;
}

body.task-mail #messagelist tbody tr.mekon-group-master .mekon-group-subject > a {
    min-width: 0;
}

body.task-mail #messagelist tbody tr.mekon-group-child td {
    background: #fbfdff;
}

body.task-mail #mailboxlist li.selected > a,
body.task-mail #mailboxlist li > a:hover {
    background: #eef4ff;
    color: #1d4ed8;
    border-radius: 10px;
}

body.task-mail #layout-content .iframe-wrapper {
    background: #fff;
}

body.task-mail .mekon-sidebar-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

body.task-mail .mekon-sidebar-toggle:before {
    content: "\2630";
    font-size: 1rem;
    line-height: 1;
}

body.task-mail .mekon-sidebar-toggle .inner {
    display: none;
}

body.task-mail.mekon-sidebar-collapsed #layout-sidebar {
    display: none;
}

body.task-mail.mekon-sidebar-collapsed #layout-list {
    max-width: 38%;
}

body.task-mail.mekon-sidebar-collapsed .mekon-sidebar-toggle {
    color: #f04e23;
}

body.task-mail.mekon-remote-attachment-open {
    overflow: hidden;
}

body.task-mail .mekon-remote-attachment-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

body.task-mail .mekon-remote-attachment-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
}

body.task-mail .mekon-remote-attachment-dialog {
    position: absolute;
    inset: 4vh 4vw;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    overflow: hidden;
}

body.task-mail .mekon-remote-attachment-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

body.task-mail .mekon-remote-attachment-title-wrap {
    min-width: 0;
}

body.task-mail .mekon-remote-attachment-title {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 700;
    word-break: break-word;
}

body.task-mail .mekon-remote-attachment-subtitle {
    margin-top: .25rem;
    color: #64748b;
    font-size: .82rem;
    word-break: break-word;
}

body.task-mail .mekon-remote-attachment-header-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

body.task-mail .mekon-remote-attachment-close {
    width: 38px;
    height: 38px;
    border: 1px solid #d9e2ee;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

body.task-mail .mekon-remote-attachment-close:hover,
body.task-mail .mekon-remote-attachment-close:focus {
    background: #eef4ff;
    border-color: #bfd3ff;
}

body.task-mail .mekon-remote-attachment-content {
    flex: 1 1 auto;
    min-height: 0;
    background: #fff;
}

body.task-mail .mekon-remote-attachment-frame {
    width: 100%;
    height: 100%;
    min-height: 70vh;
    border: 0;
    background: #fff;
}

body.task-mail .mekon-remote-attachment-empty {
    padding: 2rem 1.5rem;
}

body.task-mail .mekon-remote-attachment-empty-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 0 1rem 1rem;
    flex-wrap: wrap;
}

@media (max-width: 900px) {
    body.task-mail .mekon-remote-attachment-dialog {
        inset: 2vh 2vw;
    }

    body.task-mail .mekon-remote-attachment-header {
        flex-direction: column;
    }

    body.task-mail .mekon-remote-attachment-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    body.task-mail .mekon-remote-attachment-frame {
        min-height: 60vh;
    }
}
