:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #172237;
  background: #f5f7fb;
  font-synthesis: none;
  --nav: #111827;
  --muted: #64748b;
  --line: #e3e9f2;
  --primary: #2857df;
  --primary-hover: #1944c3;
  --tint: #edf2ff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 290px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .53; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #6f96ff; outline-offset: 3px; }
a { color: var(--primary); }
h1, h2, h3, p { margin: 0; }
.primary, .secondary, .quiet, .tool { border-radius: 9px; font-weight: 650; }
.primary, .secondary { min-height: 42px; padding: 9px 16px; }
.primary { color: #fff; background: var(--primary); border: 1px solid var(--primary); }
.primary:hover:enabled { background: var(--primary-hover); }
.secondary { background: #fff; color: #33445f; border: 1px solid #dfe6f2; }
.secondary:hover:enabled { background: #f5f8ff; }
.quiet { border: 0; color: var(--primary); padding: 5px 0; background: none; font-size: .82rem; }
.tool { display: inline-grid; place-items: center; width: 40px; height: 40px; color: #50627f; border: 1px solid var(--line); background: #fff; font-size: 1.25rem; line-height: 1; }
.tool:hover:enabled { border-color: #b7c8f6; background: #f2f6ff; }
.brand { display: flex; align-items: center; gap: 11px; color: #eef4ff; text-decoration: none; font-size: 1.03rem; white-space: nowrap; letter-spacing: -.025em; }
.brand strong { color: #91b1ff; }
.brand-icon { display: grid; place-items: center; border-radius: 11px; width: 36px; height: 36px; color: #fff; font-size: 1.25rem; background: #3566ee; box-shadow: inset 0 0 0 1px #ffffff32; }
.login { display: grid; grid-template-columns: minmax(390px, .95fr) minmax(390px, 1fr); min-height: 100dvh; }
.login-brand { display: flex; flex-direction: column; min-height: 100%; padding: 38px clamp(35px, 5vw, 82px); background: radial-gradient(ellipse at 2% 45%, #203769 0%, #111b32 44%, #101726 75%); color: #fff; }
.login-intro { margin-block: auto; padding-block: 48px; }
.login-intro h1 { font-size: clamp(2.35rem, 4.6vw, 5rem); letter-spacing: -.075em; line-height: .99; font-weight: 760; }
.login-intro p { margin-top: 21px; max-width: 360px; color: #b4c3e2; line-height: 1.6; }
.login-footer { color: #90a4c7; font-size: .82rem; }
.login-art { position: relative; width: 130px; height: 108px; margin-bottom: 27px; }
.art-sheet, .art-envelope { position: absolute; width: 86px; height: 72px; border-radius: 16px; transform: rotate(-15deg); }
.art-sheet { top: 3px; left: 10px; background: #779bfc; opacity: .55; }
.art-envelope { display: grid; place-items: center; top: 24px; left: 28px; color: #fff; background: #3067fb; border: 1px solid #acd0ff90; font-size: 2.45rem; transform: rotate(9deg); }
.art-dot { position: absolute; top: 4px; right: 3px; width: 12px; height: 12px; border-radius: 50%; background: #8db4ff; }
.login-panel { display: grid; align-items: center; justify-items: center; padding: 40px 30px; background: #f9fbfe; }
.login-form { width: min(100%, 390px); }
.login-form h2 { font-size: 2rem; letter-spacing: -.055em; }
.login-form > p:first-of-type { margin: 9px 0 27px; color: var(--muted); line-height: 1.5; }
.login-form .primary { width: 100%; }
label { display: grid; gap: 6px; margin-bottom: 14px; color: #33445f; font-size: .9rem; font-weight: 650; }
label small { color: var(--muted); font-weight: 450; }
input, select, textarea { min-width: 0; width: 100%; padding: 10px 12px; border: 1px solid #d8e1ef; border-radius: 8px; background: #fff; color: #172237; font-size: 1rem; }
input::placeholder, textarea::placeholder { color: #6b7890; }
textarea { resize: vertical; }
.form-status { min-height: 1.25em; margin-top: 11px; color: #a43137; font-size: .88rem; line-height: 1.45; }
.workspace { display: grid; grid-template-columns: 252px minmax(0, 1fr); height: 100dvh; }
.sidebar { display: flex; flex-direction: column; gap: 27px; min-height: 0; padding: 23px 15px 13px; overflow-y: auto; background: var(--nav); color: #bbc8df; }
.sidebar .brand { margin: 0 6px 3px; }
.compose-open { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 10px 13px; border: 1px solid #6892ff; border-radius: 11px; background: #2858e6; color: #fff; font-size: .91rem; font-weight: 650; box-shadow: 0 7px 18px #00000020; }
.compose-open span { font-size: 1.19rem; }
.compose-open:hover { background: #3465f5; }
.navigation h2 { margin: 0 9px 7px; color: #95a5c4; font-weight: 650; font-size: .76rem; }
.navigation > button, #account-nav button, .sidebar-bottom button { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 9px; border: 1px solid transparent; background: transparent; color: inherit; border-radius: 8px; text-align: left; font-size: .875rem; }
.navigation button:hover, .sidebar-bottom button:hover { color: #fff; background: #1b2840; }
.navigation button[aria-current="true"] { border-color: #34446a; background: #263757; color: #edf3ff; font-weight: 650; }
.navigation button span:first-child, .sidebar-bottom button > span:first-child { width: 21px; text-align: center; color: #9cbaff; font-size: .99rem; }
.nav-title { display: flex; align-items: center; justify-content: space-between; padding-right: 4px; }
.nav-title h2 { margin-bottom: 0; }
.nav-add { border: 0; border-radius: 5px; background: transparent; color: #b1c6f4; width: 31px; height: 27px; }
.account-choice { min-width: 0; }
.account-choice span:last-child, #owner-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-choice .account-icon, .navigation .account-choice .account-icon { display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; border-radius: 7px; font-size: .72rem; font-weight: 750; color: #d3dfff; background: #334669; }
.account-choice .mailcow { color: #e1d7ff !important; background: #4a3c6a !important; }
.account-choice .gmail { color: #fed3d2 !important; background: #6c3e4d !important; }
.account-choice .outlook { color: #d8e9ff !important; background: #264e77 !important; }
.sidebar-bottom { margin-top: auto; padding-top: 10px; border-top: 1px solid #2a3550; }
.sidebar-bottom button > span:last-child { min-width: 0; }
#owner-email { display: block; color: #9eb4db; font-size: .73rem; }
.mail-main { display: grid; grid-template-rows: 69px minmax(0, 1fr); min-width: 0; }
.topbar { display: flex; gap: 14px; align-items: center; padding: 0 25px; background: #fff; border-bottom: 1px solid var(--line); }
.search-form { width: min(490px, 100%); display: flex; align-items: center; gap: 10px; min-width: 0; margin-right: auto; padding: 0 13px; background: #f4f6fb; border-radius: 9px; border: 1px solid #e8edf5; color: #5e708e; }
.search-form input { padding: 10px 0; border: 0; background: transparent; outline: none; font-size: .9rem; }
.search-form:focus-within { outline: 2px solid #81a1ff; }
.search-icon { position: relative; width: 13px; height: 13px; border: 1.6px solid currentColor; border-radius: 50%; flex: 0 0 13px; }
.search-icon::after { content: ''; position: absolute; width: 5px; height: 1.6px; background: currentColor; right: -4px; bottom: -2px; transform: rotate(45deg); }
.owner-avatar { flex: 0 0 37px; display: grid; place-items: center; height: 37px; border-radius: 50%; background: #e4ecff; color: #2549a4; font-size: .83rem; font-weight: 750; }
.view { display: grid; grid-template-columns: clamp(335px, 31vw, 445px) minmax(0, 1fr); gap: 19px; padding: 22px 24px; overflow: hidden; }
.message-list, .reader { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 5px 17px #23355a06; overflow: hidden; }
.list-header { padding: 22px 19px 13px; border-bottom: 1px solid var(--line); }
.list-header > p { overflow: hidden; text-overflow: ellipsis; color: #4f62a2; font-size: .78rem; font-weight: 700; }
.list-header h1 { margin-top: 6px; color: #18243a; font-size: clamp(1.42rem, 2.05vw, 1.85rem); line-height: 1.13; letter-spacing: -.055em; }
.list-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .79rem; min-height: 24px; margin-top: 8px; }
.list-body { overflow: auto; }
.list-error { padding: 10px 18px; color: #91482a; background: #fff5ec; font-size: .81rem; overflow-wrap: anywhere; }
.list-more { align-self: center; margin: 8px; font-size: .82rem; }
.message { position: relative; display: grid; grid-template-columns: 33px minmax(0, 1fr) auto; align-items: start; gap: 5px 9px; width: 100%; padding: 13px 15px; background: #fff; text-align: left; color: inherit; border: 0; border-bottom: 1px solid #eef1f7; }
.message:hover { background: #f6f9ff; }
.message[aria-pressed="true"] { background: #eaf0ff; box-shadow: inset 3px 0 #3463ed; }
.message:focus-visible { outline-offset: -3px; }
.message-avatar { display: grid; place-items: center; width: 33px; height: 33px; background: #e9edff; color: #3956a0; border-radius: 10px; grid-row: span 3; font-size: .76rem; font-weight: 750; }
.message-avatar[data-tone="1"] { background: #e0f3ef; color: #236559; }
.message-avatar[data-tone="2"] { background: #f6eafa; color: #774885; }
.message-avatar[data-tone="3"] { background: #fbefdf; color: #865831; }
.message .sender, .message .subject, .message .snippet { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.message .sender { display: flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 650; }
.message .sender span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.message .badge-dot { flex: 0 0 7px; height: 7px; border-radius: 50%; background: #2857df; }
.message .subject { grid-column: 2/4; color: #455571; font-size: .86rem; }
.message.unread .subject { color: #152642; font-weight: 700; }
.message .snippet { grid-column: 2/4; color: #677791; font-size: .78rem; }
.message time { color: #5b6d89; font-size: .73rem; white-space: nowrap; }
.list-placeholder { padding: 24px 19px; color: var(--muted); font-size: .89rem; line-height: 1.55; }
.reader { overflow: auto; }
.reader-content { min-height: 100%; display: flex; flex-direction: column; }
.reader-empty { flex: 1; display: grid; align-content: center; justify-items: center; padding: 37px 24px; text-align: center; }
.reader-empty h2 { margin-bottom: 8px; font-size: 1.43rem; letter-spacing: -.04em; }
.reader-empty p { max-width: 340px; font-size: .94rem; line-height: 1.55; color: var(--muted); }
.reader-empty .primary { margin-top: 17px; }
.reader-symbol { display: grid; place-items: center; width: 69px; height: 69px; margin-bottom: 20px; color: #2f59d7; background: #edf2ff; border: 1px solid #e3eaff; border-radius: 21px; font-size: 2.2rem; }
.reader-actions { display: flex; flex-wrap: wrap; gap: 7px; padding: 13px 17px; border-bottom: 1px solid var(--line); }
.reader-actions button { padding: 6px 9px; min-height: 35px; font-size: .79rem; }
.reader-header { padding: 23px 25px 17px; border-bottom: 1px solid var(--line); }
.reader-header h2 { font-size: 1.6rem; letter-spacing: -.04em; overflow-wrap: anywhere; }
.reader-header p { color: var(--muted); font-size: .86rem; overflow-wrap: anywhere; }
.reader-header p + p { margin-top: 5px; }
.reader-header h2 + p { margin-top: 12px; }
.reader-text { margin: 0; padding: 24px 25px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 25px 24px; }
.attachments a { display: inline-block; color: #2e5098; background: #f3f6fc; padding: 8px 11px; border-radius: 7px; overflow-wrap: anywhere; text-decoration-thickness: 1px; }
.dialog { width: min(600px, calc(100vw - 28px)); max-height: min(90dvh, 810px); overflow: auto; border: 1px solid var(--line); border-radius: 16px; padding: 0; color: #172237; background: #fff; box-shadow: 0 24px 94px #09173550; }
.dialog::backdrop { background: #0f172a75; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 1; padding: 14px 21px; background: #fff; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 1.25rem; letter-spacing: -.035em; }
.dialog-body { padding: 19px 21px 22px; }
.dialog-body h3 { margin: 12px 0; font-size: .94rem; }
.dialog-body > p:first-child { color: var(--muted); }
.close { width: 34px; height: 34px; }
.providers { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 8px; }
.provider { display: flex; align-items: center; gap: 8px; min-height: 61px; padding: 8px; border-radius: 9px; text-align: left; background: #fff; color: inherit; border: 1px solid var(--line); }
.provider:hover { background: #f6f9ff; }
.provider span:nth-child(2) { flex: 1; }
.provider small { display: block; color: var(--muted); font-size: .71rem; }
.provider b { color: var(--primary); font-weight: 500; }
.provider-icon { display: grid; place-items: center; min-width: 31px; height: 31px; border-radius: 8px; font-weight: 800; font-size: .85rem; }
.provider-icon.mailcow { color: #573398; background: #f0e9fb; }
.provider-icon.gmail { color: #ab344a; background: #fceaf0; }
.provider-icon.outlook { color: #2257a0; background: #e5efff; }
.mailcow-form { margin-top: 18px; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #f8faff; }
.split-fields { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 10px; }
.account-item { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.account-item div { min-width: 0; }
.account-item strong { display: block; overflow-wrap: anywhere; font-size: .89rem; }
.account-item small { color: var(--muted); }
.account-item button { color: #9a3440; min-height: 34px; padding: 6px 9px; font-size: .79rem; }
.compose-footer { display: flex; gap: 12px; align-items: center; }
.compose-footer .form-status { margin-top: 0; }
.toast { z-index: 10; position: fixed; bottom: 20px; right: 20px; width: max-content; max-width: calc(100vw - 40px); padding: 12px 16px; color: #fff; background: #1a2c4c; border-radius: 10px; box-shadow: 0 7px 24px #121e3a34; font-size: .9rem; }
.mobile-only { display: none; }
@media (max-width: 1080px) {
  .workspace { grid-template-columns: 210px minmax(0, 1fr); }
  .view { grid-template-columns: minmax(275px, 40%) minmax(0, 1fr); padding: 15px; gap: 12px; }
}
@media (max-width: 830px) {
  .view { grid-template-columns: minmax(0, 1fr); }
  .view.has-message .message-list, .view:not(.has-message) .reader { display: none; }
  .reader-back { display: inline-block; }
}
@media (max-width: 640px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .mail-main { grid-template-rows: 56px minmax(0, 1fr); }
  .topbar { gap: 8px; padding: 0 11px; }
  .mobile-only { display: inline-grid; flex: 0 0 35px; }
  .tool { width: 35px; height: 35px; }
  .owner-avatar { display: none; }
  .sidebar { display: none; position: fixed; top: 56px; left: 0; bottom: 0; z-index: 3; width: min(265px, 85vw); box-shadow: 12px 0 24px #14244144; }
  .sidebar.open { display: flex; }
  .view { padding: 9px; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-brand { padding: 23px 24px; }
  .login-intro { padding: 28px 0 6px; }
  .login-intro h1 { font-size: 2.36rem; }
  .login-intro p { margin-top: 14px; }
  .login-art, .login-footer { display: none; }
  .login-panel { padding: 30px 23px; align-items: start; }
  .reader-header, .reader-text { padding-inline: 16px; }
  .split-fields { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
@media (min-width: 831px) {
  .reader-back { display: none; }
}
