/* Classic MSN Hotmail (~2004) inspired theme */
* { box-sizing: border-box; }

body.hm {
    margin: 0;
    padding: 0;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 11px;
    color: #000;
    background: #fff;
}

a { color: #003399; text-decoration: none; }
a:hover { text-decoration: underline; }

.hm-topnav {
    background: #003399;
    color: #fff;
    padding: 4px 8px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.hm-topnav-links a { color: #fff; margin: 0 4px; }
.hm-topnav-links a:first-child { margin-left: 0; }
.hm-topnav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.hm-topnav .hm-signout-form { margin: 0; }
.hm-topnav .hm-signout-btn {
    display: block;
    line-height: 0;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
}
.hm-topnav .hm-signout-btn img {
    display: block;
    height: 20px !important;
    width: auto !important;
    max-width: 80px !important;
}
.hm-websearch {
    color: #fff;
    font-size: 11px;
    white-space: nowrap;
}
.hm-websearch-input {
    font-size: 11px;
    padding: 2px 4px;
    border: 1px solid #7f9db9;
    margin: 0 4px;
    width: 130px;
}
.hm-websearch-go {
    font-size: 11px;
    padding: 2px 8px;
    cursor: not-allowed;
}

.hm-header {
    background: linear-gradient(180deg, #7eb6ea 0%, #5a9ad8 38%, #3f84c8 72%, #2f6eb5 100%);
    border-bottom: 1px solid #1f5f9f;
    padding: 0;
    position: relative;
}
.hm-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 20px;
    min-height: 104px;
}
.hm-headerlinks {
    flex: 0 0 auto;
    color: #fff;
    font-size: 11px;
    white-space: nowrap;
    padding-bottom: 4px;
}
.hm-headerlinks a { color: #fff; }

.hm-logo-row {
    display: flex;
    align-items: center;
    gap: 28px;
    flex: 1 1 auto;
    min-width: 0;
    max-height: 96px;
    overflow: hidden;
}
.hm-logo-row img {
    display: block;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
}
.hm-logo-combined {
    /* Placement per placer: left 20px (band padding), top 12px (vertical center of 104px band), 80x400px */
    height: 80px !important;
    max-height: 80px !important;
    width: auto !important;
    max-width: 400px !important;
    flex-shrink: 0;
}

.hm-login .hm-logo-row,
body.hm-login .hm-logo-row {
    justify-content: center;
    margin: 0 auto;
    max-width: 340px;
    max-height: 36px;
}

.hm-tabstrip {
    position: relative;
    display: flex;
    align-items: flex-end;
    background: #bcdcf5;
    border-bottom: 1px solid #7fadd6;
    min-height: 24px;
    padding-left: 2px;
}
.hm-tab-decor { display: none; }
.hm-tabs {
    display: flex;
    align-items: flex-end;
    gap: 0;
    padding-top: 2px;
}
.hm-tab {
    display: inline-block;
    padding: 4px 16px 5px;
    font-size: 11px;
    font-weight: bold;
    color: #06407a;
    background: linear-gradient(180deg, #d8ecfb 0%, #bcdcf5 100%);
    border-left: 1px solid #9cc4e8;
    border-right: 1px solid #9cc4e8;
    border-top: 1px solid #9cc4e8;
    margin-left: -1px;
    position: relative;
    line-height: 1.2;
    text-decoration: none;
}
.hm-tab:first-child {
    margin-left: 0;
    border-left: 1px solid #9cc4e8;
}
.hm-tab.active {
    background: #fff;
    color: #000;
    padding: 5px 17px 6px;
    border-top: 2px solid #ffb400;
    border-left: 1px solid #7fadd6;
    border-right: 1px solid #7fadd6;
    z-index: 2;
    margin-bottom: -1px;
}

.hm-userbar {
    background: linear-gradient(180deg, #d8ebfa 0%, #c2dff5 100%);
    border-top: 1px solid #8eb8d8;
    border-bottom: 1px solid #7aa8cc;
    padding: 9px 14px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 22px;
}
.hm-storagebar-label {
    font-weight: bold;
    color: #06407a;
    white-space: nowrap;
    flex: 0 0 auto;
}
.hm-storagebar-track {
    flex: 1 1 auto;
    height: 16px;
    border-radius: 999px;
    background: linear-gradient(180deg, #eef6ff 0%, #dbe8f5 100%);
    border: 1px solid #9fc0dd;
    box-shadow: inset 0 1px 3px rgba(20, 60, 100, 0.25);
    padding: 2px;
    box-sizing: border-box;
}
.hm-storagebar-fill {
    height: 100%;
    min-width: 10px;
    border-radius: 999px;
    background: linear-gradient(180deg, #7bec9c 0%, #3cb371 55%, #2f9c60 100%);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.6), inset 0 -2px 3px rgba(0, 60, 30, 0.25);
    position: relative;
    transition: width 0.4s ease;
}
.hm-storagebar-fill::after {
    content: "";
    position: absolute;
    top: 1px;
    left: 3px;
    right: 3px;
    height: 40%;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
}

.hm-toolbar {
    background: linear-gradient(180deg, #fafdff 0%, #edf5fc 22%, #d4e8f8 62%, #b8d9f0 100%);
    border-top: 1px solid #e8f3fc;
    border-bottom: 2px solid #8eb8d8;
    padding: 4px 8px 5px;
    font-size: 11px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    min-height: 26px;
}
.hm-btn {
    font-family: Verdana, Arial, sans-serif;
    font-size: 11px;
    background: linear-gradient(180deg, #fefefe 0%, #e6f0fa 100%);
    border: 1px solid #7eb0d8;
    border-radius: 2px;
    padding: 3px 10px;
    margin-right: 4px;
    cursor: pointer;
    color: #000;
}
.hm-btn:hover:not(:disabled) {
    background: #fff;
}
.hm-btn:disabled {
    color: #888;
    cursor: default;
}
.hm-btn-caret {
    font-size: 8px;
}
.hm-tool-link,
.hm-toolbar button.hm-tool-link {
    font-family: Verdana, Arial, sans-serif;
    font-size: 11px;
    background: transparent;
    border: none;
    padding: 1px 6px;
    margin: 0;
    cursor: pointer;
    color: #000;
    text-decoration: none;
    line-height: 1.3;
}
.hm-tool-link:hover {
    text-decoration: underline;
}
.hm-tool-danger {
    color: #900;
}
.hm-tool-static {
    padding: 1px 6px;
    color: #000;
}
.hm-tool-form {
    display: inline;
    margin: 0;
    padding: 0;
}
.hm-tool-sep {
    display: inline-block;
    width: 1px;
    height: 14px;
    background: #8a9aa8;
    margin: 0 3px;
    vertical-align: middle;
}
.hm-toolbar button,
.hm-toolbar .tb {
    font-family: Verdana, Arial, sans-serif;
    font-size: 11px;
    background: #eef5fc;
    border: 1px solid #7eb0d8;
    padding: 2px 8px;
    margin-right: 4px;
    cursor: pointer;
    color: #000;
}
.hm-toolbar button:hover,
.hm-toolbar .tb:hover { background: #fff; }
.hm-toolbar .tb-danger { color: #900; }

.hm-layout {
    width: 100%;
    border-collapse: collapse;
}
.hm-layout td { vertical-align: top; }

.hm-folders {
    width: 170px;
    background: linear-gradient(180deg, #f2f8fd 0%, #e8f3fc 100%);
    border-right: 1px solid #8eb8d8;
    padding: 8px 6px;
    font-size: 11px;
}
.hm-folders h3 {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: bold;
    color: #003399;
}
.hm-folders ul {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}
.hm-folders li { margin: 2px 0; }
.hm-folders li.active { font-weight: bold; }
.hm-folder-link {
    display: block;
    padding: 2px 4px;
}
.hm-folder-icon {
    display: inline-block;
    width: 16px;
    text-align: center;
    margin-right: 2px;
}
.hm-managefolders {
    display: inline-block;
    font-size: 10px;
    margin: 2px 0 10px;
}
.hm-alias {
    border-top: 1px solid #c5d9ed;
    padding-top: 8px;
    margin-top: 8px;
}
.hm-alias-item {
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px dotted #b8cfe4;
}
.hm-alias-item code {
    font-size: 10px;
    word-break: break-all;
}
.hm-alias-actions { margin-top: 4px; }
.hm-alias-actions button,
.hm-alias-actions a.tb {
    font-size: 10px;
    padding: 1px 5px;
}

.hm-main {
    background: #fff;
    padding: 0;
}
.hm-main-inner { padding: 8px 10px; }

.hm-status {
    background: #ffffcc;
    border: 1px solid #e6e600;
    padding: 4px 8px;
    margin-bottom: 8px;
    font-size: 11px;
}

.hm-inbox-bar {
    background: linear-gradient(180deg, #eef5fc 0%, #e0eef8 100%);
    border-bottom: 1px solid #9ec3e8;
    border-top: 1px solid #d8eaf8;
    padding: 4px 8px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.hm-showfrom {
    font-size: 11px;
    white-space: nowrap;
}
.hm-showfrom select {
    font-size: 11px;
    padding: 1px 2px;
    margin-left: 4px;
}

.hm-mailtable {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}
.hm-mailtable th {
    background: linear-gradient(180deg, #e8f3fc 0%, #d0e6f6 100%);
    border-bottom: 1px solid #8eb8d8;
    border-top: 1px solid #c5d9ed;
    padding: 3px 6px;
    text-align: left;
    font-weight: normal;
    color: #000;
}
.hm-mailtable td {
    border-bottom: 1px solid #e8e8e8;
    padding: 3px 6px;
    vertical-align: top;
}
.hm-mailtable tr.row-a td { background: #fff; }
.hm-mailtable tr.row-b td { background: #fffff0; }
.hm-subject-unread {
    font-weight: bold;
}
.hm-mailtable tr.row-unread td {
    font-weight: bold;
}
.hm-mailtable tr.row-unread .col-to,
.hm-mailtable tr.row-unread .col-date,
.hm-mailtable tr.row-unread .col-icon {
    font-weight: normal;
}
.hm-mail-icon {
    display: inline-block;
    font-size: 12px;
    line-height: 1;
}
.hm-mail-icon-unread {
    color: #e8a800;
}
.hm-mail-icon-read {
    color: #888;
}
.hm-mail-icon-attach {
    color: #333;
}
.hm-mailtable .col-icon { width: 18px; text-align: center; }
.hm-mailtable .col-check { width: 22px; text-align: center; }
.hm-mailtable .col-date { width: 70px; white-space: nowrap; }
.hm-mailtable .col-to { width: 110px; }

.hm-bulk-form {
    margin: 0;
    padding: 0;
    border: 0;
}

.hm-bulk-bar {
    background: linear-gradient(180deg, #f5faff 0%, #e8f3fc 100%);
    border-bottom: 1px solid #9ec3e8;
    border-top: 1px solid #d8eaf8;
    padding: 4px 6px;
    margin-bottom: 0;
}
.hm-bulk-bar button {
    font-family: Verdana, Arial, sans-serif;
    font-size: 11px;
    background: linear-gradient(180deg, #fafdff 0%, #e3f0fa 100%);
    border: 1px solid #7eb0d8;
    padding: 2px 8px;
    margin-right: 4px;
    cursor: pointer;
}
.hm-bulk-bar .tb-danger { color: #900; }

.hm-empty { padding: 8px; }
.hm-hint { font-size: 10px; color: #333; margin-top: 4px; }
.hm-field input[type="text"] {
    width: 100%;
    font-family: Verdana, Arial, sans-serif;
    font-size: 11px;
    border: 1px solid #7f9db9;
    padding: 3px 4px;
}
.hm-status-error {
    background: #ffe6e6;
    border-color: #cc0000;
    color: #900;
}

.hm-compose-win {
    border: 2px solid #003399;
    border-radius: 0;
    padding: 0;
    width: min(720px, 96vw);
    max-height: 92vh;
    overflow: hidden;
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.35);
    background: #eef5fc;
}
.hm-compose-win::backdrop {
    background: rgba(0, 51, 153, 0.45);
}
.hm-compose-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, #4a90d9 0%, #2f6eb5 100%);
    border-bottom: 1px solid #1a4a7a;
    padding: 5px 8px 5px 10px;
    color: #fff;
    font-weight: bold;
    font-size: 12px;
}
.hm-compose-title-close {
    border: 1px solid #8eb8e0;
    background: linear-gradient(180deg, #eef5fc 0%, #c5dff5 100%);
    color: #003399;
    font-size: 14px;
    line-height: 1;
    width: 22px;
    height: 20px;
    cursor: pointer;
    padding: 0;
}
.hm-compose-body {
    padding: 8px 10px 10px;
    overflow-y: auto;
    max-height: calc(92vh - 88px);
    background: #eef5fc;
}
.hm-compose-error {
    background: #ffe6e6;
    border: 1px solid #cc0000;
    color: #900;
    padding: 6px 8px;
    margin-bottom: 8px;
    font-size: 11px;
}
.hm-compose-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.hm-compose-row > label {
    flex: 0 0 52px;
    font-weight: bold;
    margin: 0;
    text-align: right;
}
.hm-compose-row input[type="text"],
.hm-compose-row select {
    flex: 1;
    font-family: Verdana, Arial, sans-serif;
    font-size: 11px;
    border: 1px solid #7f9db9;
    padding: 3px 5px;
    background: #fff;
}
.hm-compose-field-grow {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}
.hm-compose-field-grow input {
    flex: 1;
}
.hm-compose-toggles {
    flex: 0 0 auto;
    white-space: nowrap;
}
.hm-compose-toggle {
    border: none;
    background: transparent;
    color: #003399;
    font-size: 11px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0 4px;
}
.hm-compose-extra[hidden] {
    display: none !important;
}
.hm-compose-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px;
    padding: 4px 5px;
    margin: 8px 0 4px;
    background: linear-gradient(180deg, #fafdff 0%, #d4e8f8 100%);
    border: 1px solid #9ec3e8;
}
.hm-tool-btn {
    font-family: Verdana, Arial, sans-serif;
    font-size: 11px;
    min-width: 24px;
    height: 22px;
    padding: 1px 6px;
    border: 1px solid #7eb0d8;
    background: linear-gradient(180deg, #fff 0%, #e8f3fc 100%);
    cursor: pointer;
}
.hm-tool-btn:hover {
    background: #fff;
}
.hm-tool-select {
    font-size: 11px;
    height: 22px;
    border: 1px solid #7eb0d8;
    background: #fff;
    padding: 0 4px;
}
.hm-tool-select-narrow {
    width: 72px;
}
.hm-tool-color {
    width: 28px;
    height: 22px;
    padding: 0;
    border: 1px solid #7eb0d8;
    cursor: pointer;
    vertical-align: middle;
}
.hm-tool-sep-v {
    display: inline-block;
    width: 1px;
    height: 18px;
    background: #9aabb8;
    margin: 0 2px;
}
.hm-compose-editor {
    min-height: 220px;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid #7f9db9;
    background: #fff;
    padding: 8px 10px;
    font-family: Verdana, Arial, sans-serif;
    font-size: 12px;
    line-height: 1.45;
}
.hm-compose-editor:focus {
    outline: 1px solid #4a90d9;
}
.hm-compose-editor img {
    max-width: 100%;
    height: auto;
}
.hm-attach-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    font-size: 11px;
}
.hm-attach-list[hidden] {
    display: none !important;
}
.hm-attach-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    border-bottom: 1px dotted #b8cfe4;
}
.hm-attach-list button {
    font-size: 10px;
    padding: 1px 6px;
    border: 1px solid #7eb0d8;
    background: #eef5fc;
    cursor: pointer;
}
.hm-compose-foot {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: linear-gradient(180deg, #d8ebfa 0%, #b8d9f5 100%);
    border-top: 1px solid #8eb8d8;
}
.hm-btn-primary {
    font-weight: bold;
}
.hm-compose-status {
    margin-left: auto;
    font-size: 11px;
    color: #333;
}
.hm-compose-foot .hm-btn {
    margin: 0;
}
.hm-compose {
    margin: 0;
    padding: 0;
}

.hm-footerbar {
    background: linear-gradient(180deg, #eef5fc 0%, #dcecf8 100%);
    border-top: 2px solid #8eb8d8;
    padding: 4px 10px;
    font-size: 11px;
}

.hm-msg-meta {
    background: linear-gradient(180deg, #f2f8fd 0%, #e8f3fc 100%);
    border: 1px solid #9ec3e8;
    border-top-color: #c5d9ed;
    padding: 8px;
    margin-bottom: 8px;
    font-size: 11px;
}
.hm-msg-meta div { margin: 2px 0; }

.hm-view-tabs { margin: 8px 0; }
.hm-view-tabs a {
    margin-right: 6px;
    padding: 2px 8px;
    border: 1px solid #7eb0d8;
    background: #eef5fc;
    font-size: 11px;
}
.hm-view-tabs a.active {
    background: #b8d9f5;
    font-weight: bold;
}

.message-body {
    white-space: pre-wrap;
    word-break: break-word;
    background: #fff;
    border: 1px solid #ccc;
    padding: 10px;
    font-size: 11px;
}
.message-html {
    width: 100%;
    min-height: 480px;
    max-height: 80vh;
    border: 1px solid #ccc;
    background: #fff;
}
.hm-attachments {
    margin: 8px 0;
    padding: 8px;
    background: #fff;
    border: 1px solid #c5d9ed;
}
.hm-attachments ul { margin: 4px 0 0; padding-left: 18px; }
.hm-paperclip { font-size: 11px; }

/* Login page */
body.hm-login {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Verdana, Arial, sans-serif;
    background: radial-gradient(circle at 30% 20%, #0d3fa0 0%, #062066 55%, #030f38 100%);
}
.hm-login-split {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    min-height: 100vh;
}
.hm-login-photo {
    flex: 1 1 55%;
    min-height: 320px;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.hm-login-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.hm-login-overlay-group {
    position: absolute;
    visibility: hidden; /* shown by overlay.js once items are sized */
}
.hm-login-overlay-group .hm-login-overlay-text {
    white-space: nowrap; /* group box has no width; prevent word-wrap */
}
.hm-login-overlay-text,
.hm-login-overlay-logo {
    position: absolute;
    margin: 0;
}
.hm-login-overlay-text {
    font-family: Helvetica, Arial, sans-serif;
    line-height: 1.15;
    white-space: pre-wrap;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}
.hm-login-overlay-logo {
    display: block;
}
.hm-login-overlay-logo img {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.35));
}
.hm-login-panel {
    flex: 1 1 420px;
    max-width: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.hm-login-card {
    width: 340px;
    box-sizing: border-box;
    margin: 24px;
    padding: 40px 30px 32px;
    border-radius: 20px;
    text-align: center;
    background: linear-gradient(165deg, #0c2f7f 0%, #082564 55%, #051a48 100%);
    box-shadow: 0 24px 60px rgba(0, 8, 40, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.hm-login-logo {
    display: block;
    width: 210px;
    max-width: 100%;
    height: auto;
    margin: 0 auto 26px;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
}
.hm-login-card h1 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 24px;
}
.hm-login-field {
    text-align: left;
    margin-bottom: 14px;
}
.hm-login-field label {
    display: block;
    font-size: 10px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #93aee6;
    margin: 0 0 5px 2px;
}
.hm-login-box input[type="password"],
.hm-login-field input[type="password"] {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 13px;
}
.hm-login-field input[type="password"]::placeholder { color: rgba(255, 255, 255, 0.35); }
.hm-login-field input[type="password"]:focus {
    outline: none;
    border-color: #4fc3f7;
    background: rgba(255, 255, 255, 0.11);
}
.hm-login-remember {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    color: #c7d7f5;
    margin: 6px 2px 22px;
    cursor: pointer;
}
.hm-login-remember input { margin: 0; }
.hm-login-submit {
    width: 100%;
    padding: 13px;
    border: 0;
    border-radius: 9px;
    background: linear-gradient(90deg, #12c2e9, #0072ff);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: .04em;
    cursor: pointer;
}
.hm-login-submit:hover { filter: brightness(1.08); }
.hm-login-error {
    margin-top: 16px;
    padding: 9px 11px;
    border-radius: 7px;
    font-size: 12px;
    color: #ffc2c2;
    background: rgba(255, 0, 0, 0.12);
    border: 1px solid rgba(255, 60, 60, 0.35);
}
