/* Keep Elastic's layout and controls, with a separate TechnoMoney palette. */
html {
    --tm-canvas: #edf1f6;
    --tm-surface: #fff;
    --tm-sidebar: #f6f8fc;
    --tm-field: #f1f4f8;
    --tm-border: #e0e6ef;
    --tm-ink: #1d2b40;
    --tm-muted: #526279;
    --tm-blue: #175ad0;
    --tm-active: #e2ecff;
    --tm-shadow: 0 18px 60px rgb(37 58 88 / 12%);
}

html.dark-mode {
    --tm-canvas: #101721;
    --tm-surface: #192330;
    --tm-sidebar: #151e2a;
    --tm-field: #222f40;
    --tm-border: #334154;
    --tm-ink: #edf3ff;
    --tm-muted: #b2c0d4;
    --tm-blue: #9dbfff;
    --tm-active: #263b5e;
    --tm-shadow: 0 18px 60px rgb(0 0 0 / 28%);
}

html body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    color: var(--tm-ink);
    background: var(--tm-canvas);
}

html body.task-login #layout-content {
    background: radial-gradient(ellipse at 50% 0%, var(--tm-active), transparent 70%),
        var(--tm-canvas);
    padding: clamp(32px, 14vh, 130px) 24px 24px;
    overflow: auto;
}

.task-login #logo {
    top: auto;
    width: 76px;
    height: 76px;
    object-fit: contain;
    margin: 0 auto 20px;
}

.task-login #login-form {
    display: flex;
    flex-direction: column;
    top: auto;
    width: min(100%, 370px);
    max-width: none;
    margin: 0 auto;
    padding: 28px;
    border: 1px solid var(--tm-border);
    border-radius: 24px;
    background: var(--tm-surface);
    box-shadow: var(--tm-shadow);
}

html .task-login #login-footer {
    order: -1;
    margin-bottom: 22px;
    color: var(--tm-ink);
    font-size: 1.6rem;
    font-weight: 650;
    letter-spacing: -.035em;
}

html .task-login #login-form .form-control,
html .task-login #login-form .input-group-text {
    min-height: 46px;
    color: var(--tm-ink);
    background: var(--tm-field);
    border-color: var(--tm-border);
}

.task-login #login-form .form-control::placeholder {
    color: var(--tm-muted);
}

html .task-login #rcmloginsubmit {
    min-height: 46px;
    border-radius: 10px;
    border-color: #175ad0;
    background: #175ad0;
    color: white;
    font-weight: 650;
    text-transform: none;
}

html .task-login #rcmloginsubmit:hover {
    background: #104db8;
}

.task-login #login-footer:empty {
    display: none;
}

html #layout-menu,
html #layout-sidebar {
    background: var(--tm-sidebar);
    border-color: var(--tm-border);
}

html #layout-menu .popover-header {
    background: var(--tm-sidebar) !important;
}

html #layout-list,
html #layout-content {
    background: var(--tm-surface);
    border-color: var(--tm-border);
}

html #layout-menu #taskmenu a {
    color: var(--tm-muted);
}

html #layout-menu #taskmenu a.selected,
html #layout-menu #taskmenu a:hover,
html #layout-sidebar .listing li.selected > a,
html #messagelist tr.selected td {
    color: var(--tm-blue);
    background: var(--tm-active);
}

html #layout-menu #taskmenu a.compose {
    background: #175ad0;
    color: white;
}

#layout-menu #logo {
    width: 44px;
    object-fit: contain;
}

html #layout > div > .header,
html #layout > div > .footer {
    background: var(--tm-surface);
    border-color: var(--tm-border);
    color: var(--tm-ink);
}

html #layout .searchbar {
    background: var(--tm-field);
    border-color: var(--tm-border);
}

html #messagelist tr.message td {
    border-color: var(--tm-border);
}

html #messagelist tr.message:hover:not(.selected) td {
    background: var(--tm-sidebar);
}

html #layout-menu #taskmenu .special-buttons {
    width: 100%;
    background: var(--tm-sidebar);
}

html.dark-mode #layout-menu #taskmenu .special-buttons a:not(:hover, :focus, .selected) {
    background: transparent;
}

html .task-mail.action-compose .form-control,
html .task-mail.action-compose .custom-select,
html .task-mail.action-compose #composebody {
    border-color: var(--tm-border);
    background-color: var(--tm-surface);
    color: var(--tm-ink);
}

html .task-mail.action-compose .btn-primary {
    border-radius: 9px;
    border-color: #175ad0;
    background-color: #175ad0;
    color: white;
}

html .task-mail.action-compose .btn-primary:hover {
    background-color: #104db8;
}

@media (min-width: 481px) {
    html #layout-menu {
        position: relative;
    }

    html #layout-menu #taskmenu a {
        box-sizing: border-box;
        width: calc(100% - 8px);
        max-width: none;
        margin: 3px 4px;
        border-radius: 10px;
    }
}

@media (min-width: 1025px) {
    html #layout-menu #taskmenu a {
        min-height: 54px;
        height: auto;
        line-height: 1.2;
        white-space: normal;
    }

    html #layout-menu #taskmenu a .inner {
        display: block;
        padding: 0 1px 2px;
        font-size: .85rem;
        line-height: 1.15;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 420px) {
    .task-login #login-form {
        padding: 20px;
    }
}
