:root {
    --canvas:#f5f7fb;
    --paper:#fff;
    --dark:#111827;
    --dark2:#172033;
    --ink:#172033;
    --muted:#667085;
    --line:#d8e0ec;
    --blue:#1746ff;
    --blue2:#0d35d8;
    --blue-soft:#edf2ff;
    --success:#177245;

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

* {
    box-sizing:border-box;
}

body {
    margin:0;
    color:var(--ink);
    background:var(--canvas);
    font-size:14px;
    -webkit-font-smoothing:antialiased;
}

button,
input,
textarea {
    font:inherit;
}

button {
    cursor:pointer;
}

[hidden] {
    display:none !important;
}

h1,h2,h3,p {
    margin:0;
}

h1,h2,h3 {
    letter-spacing:-.045em;
}

input,
textarea {
    border:1px solid var(--line);
    border-radius:9px;
    padding:10px 12px;
    width:100%;
    color:var(--ink);
}

button {
    border:0;
}

/* LOGIN */

.login-screen {
    min-height:100vh;
    display:grid;
    place-items:center;
    padding:25px;

    background:
        radial-gradient(
            circle at 80% 15%,
            rgba(23,70,255,.16),
            transparent 32%
        ),
        linear-gradient(
            140deg,
            #111827,
            #172033
        );
}

.login-card {
    width:min(480px,100%);
    background:white;
    padding:38px;
    border-radius:22px;
    box-shadow:
        0 35px 90px
        rgba(0,0,0,.28);
}

.logo {
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom:55px;
}

.logo-hgs {
    background:var(--blue);
    color:white;
    padding:9px 11px;
    border-radius:9px;
    font-weight:900;
    font-size:22px;
    letter-spacing:-.08em;
}

.logo-name {
    font-size:14px;
    letter-spacing:.23em;
}

.kicker {
    color:#3153bb;
    letter-spacing:.13em;
    font-weight:700;
    font-size:9px;
}

.login-card h1 {
    font-size:43px;
    line-height:1.03;
    margin-top:13px;
}

.login-card h1 span {
    color:var(--blue);
}

.login-text {
    color:var(--muted);
    line-height:1.7;
    margin-top:17px;
}

#login-form {
    display:grid;
    gap:10px;
    margin-top:30px;
}

#login-form label {
    color:var(--muted);
    font-size:10px;
}

#login-error {
    min-height:17px;
    color:#b42318;
    font-size:10px;
}

/* BUTTONS */

.primary,
.secondary {
    min-height:42px;
    padding:10px 15px;
    border-radius:8px;
    font-size:11px;
    font-weight:650;
}

.primary {
    background:var(--blue);
    color:white;
}

.primary:hover {
    background:var(--blue2);
}

.secondary {
    background:white;
    border:1px solid var(--line);
    color:var(--ink);
}

.full {
    width:100%;
}

/* SIDEBAR */

.sidebar {
    position:fixed;
    inset:0 auto 0 0;
    width:244px;
    padding:22px 17px;
    display:flex;
    flex-direction:column;

    background:
        linear-gradient(
            180deg,
            #111827,
            #172033
        );

    color:white;
}

.brand {
    background:white;
    color:#111827;
    padding:16px 14px;
    border-radius:12px;
}

.brand-hgs {
    font-size:24px;
    font-weight:950;
    letter-spacing:-.08em;
}

.brand-sol {
    margin-left:9px;
    letter-spacing:.25em;
    font-size:10px;
}

.brand small {
    display:block;
    color:#667085;
    font-size:6px;
    letter-spacing:.25em;
    margin-top:7px;
}

.workspace-title {
    display:flex;
    align-items:center;
    gap:8px;
    color:#aeb9ca;
    font-size:9px;
    letter-spacing:.13em;
    margin:21px 12px 14px;
}

.version {
    margin-left:auto;
    padding:1px 4px;
    border:1px solid rgba(255,255,255,.15);
    border-radius:4px;
}

.dot {
    width:7px;
    height:7px;
    display:inline-block;
    border-radius:50%;
    background:#63d69a;
}

.compose {
    background:var(--blue);
    color:white;
    padding:13px;
    border-radius:9px;
    text-align:left;
    font-weight:650;
    width:100%;
}

nav {
    display:grid;
    gap:5px;
    margin-top:18px;
}

.nav {
    display:flex;
    align-items:center;
    gap:10px;

    width:100%;
    min-height:42px;

    padding:10px 11px;

    border-radius:8px;

    background:transparent;
    color:#bdc7d6;

    text-align:left;
    font-size:11px;
}

.nav:hover {
    color:white;
    background:rgba(255,255,255,.05);
}

.nav.active {
    background:var(--blue);
    color:white;
}

.nav span:first-child {
    width:18px;
    text-align:center;
}

.nav b {
    margin-left:auto;
    font-size:9px;
}

.blue {
    color:#7791ff;
}

.divider {
    height:1px;
    background:rgba(255,255,255,.10);
    margin:18px 11px 0;
}

.sidebar-bottom {
    margin-top:auto;
}

.server-card {
    border-top:1px solid rgba(255,255,255,.10);
    border-bottom:1px solid rgba(255,255,255,.10);
    padding:14px 11px;
}

.server-card > div {
    color:#8e9aab;
    font-size:8px;
    letter-spacing:.12em;
}

.server-card strong {
    display:block;
    margin-top:8px;
    font-size:9px;
}

.server-card small {
    color:#8e9aab;
    font-size:8px;
}

.logout {
    background:transparent;
    color:#9da9ba;
    margin-top:10px;
    padding:10px;
}

/* MAIN */

.shell {
    margin-left:244px;
    min-height:100vh;
}

header {
    height:72px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 28px;
    border-bottom:1px solid var(--line);
}

.breadcrumb {
    color:var(--muted);
    font-size:10px;
}

.breadcrumb span {
    margin:0 9px;
}

.breadcrumb strong {
    color:var(--ink);
}

.header-actions {
    display:flex;
    align-items:center;
    gap:8px;
}

.connection {
    display:flex;
    align-items:center;
    gap:7px;
    background:#eaf7f0;
    color:var(--success);
    border:1px solid #ccebd9;
    border-radius:999px;
    padding:7px 10px;
    font-size:9px;
}

.icon {
    width:38px;
    height:38px;
    border:1px solid var(--line);
    border-radius:9px;
    background:white;
}

/* MAIL */

.mail-page {
    min-height:calc(100vh - 72px);
    display:grid;
    grid-template-columns:
        minmax(300px,350px)
        minmax(520px,1fr);
}

.list-panel {
    background:white;
    border-right:1px solid var(--line);
}

.list-header {
    height:94px;
    padding:21px;
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
}

.list-header h2 {
    margin-top:5px;
    font-size:24px;
}

.list-header small {
    color:var(--muted);
    font-size:8px;
}

.search {
    margin:0 15px 14px;
    padding:0 10px;
    height:40px;
    border:1px solid var(--line);
    border-radius:8px;
    display:flex;
    align-items:center;
    gap:7px;
    color:#8b95a4;
}

.search input {
    border:0;
    padding:0;
    height:100%;
    background:transparent;
    font-size:10px;
}

.messages {
    max-height:calc(100vh - 220px);
    overflow-y:auto;
}

.message {
    width:100%;
    padding:14px 17px;
    text-align:left;
    background:white;
    border-top:1px solid #edf0f5;
}

.message:hover {
    background:#f7f9fc;
}

.message.active {
    background:var(--blue-soft);
}

.message.unread {
    box-shadow:
        inset 3px 0 0 var(--blue);
}

.message-top {
    display:flex;
    align-items:center;
    gap:9px;
}

.avatar {
    width:34px;
    height:34px;
    display:grid;
    place-items:center;
    border-radius:9px;
    background:#eef2f7;
    font-size:9px;
    font-weight:800;
}

.unread .avatar {
    background:var(--blue);
    color:white;
}

.sender {
    flex:1;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:10px;
    font-weight:650;
}

.time {
    color:#98a2b3;
    font-size:8px;
}

.msg-subject {
    margin:7px 0 0 43px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    color:#475467;
    font-size:9px;
}

.reader {
    background:var(--canvas);
}

.empty {
    min-height:calc(100vh - 72px);
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    text-align:center;
}

.empty-icon {
    width:65px;
    height:65px;
    display:grid;
    place-items:center;
    margin-bottom:18px;
    background:var(--blue-soft);
    color:var(--blue);
    border-radius:17px;
    font-size:24px;
}

.empty h2 {
    margin-top:8px;
    font-size:27px;
}

.empty p {
    margin-top:8px;
    color:var(--muted);
    font-size:11px;
}

.reader-inner {
    padding:28px 32px;
}

.reader-head {
    border-bottom:1px solid var(--line);
    padding-bottom:20px;
}

.reader-top {
    display:flex;
    gap:15px;
    justify-content:space-between;
}

.reader-top h1 {
    font-size:29px;
}

.reader-tools {
    display:flex;
    gap:6px;
}

.reader-tools button {
    background:white;
    border:1px solid var(--line);
    padding:7px 9px;
    border-radius:7px;
    font-size:9px;
}

.sender-info {
    display:flex;
    align-items:center;
    gap:11px;
    margin-top:20px;
}

.sender-avatar {
    width:40px;
    height:40px;
    display:grid;
    place-items:center;
    background:var(--blue);
    color:white;
    border-radius:10px;
    font-size:10px;
    font-weight:800;
}

.sender-info strong {
    display:block;
    font-size:11px;
}

.sender-info small {
    color:var(--muted);
}

.reader-date {
    margin-left:auto;
    color:var(--muted);
    font-size:8px;
}

.mail-body {
    margin-top:20px;
    border:1px solid var(--line);
    border-radius:13px;
    overflow:hidden;
    background:white;
}

.mail-frame {
    width:100%;
    min-height:470px;
    border:0;
}

.reader-actions {
    display:flex;
    gap:8px;
    margin-top:17px;
}

.attachments {
    display:flex;
    flex-wrap:wrap;
    gap:7px;
    margin-top:13px;
}

.attachments a {
    background:white;
    border:1px solid var(--line);
    color:var(--ink);
    border-radius:7px;
    padding:7px 9px;
    text-decoration:none;
    font-size:9px;
}

/* CUSTOM */

.custom-page {
    padding:34px;
    max-width:1150px;
    margin:auto;
}

.page-head {
    margin-bottom:25px;
}

.page-head h1 {
    font-size:34px;
    margin-top:7px;
}

.page-head p {
    color:var(--muted);
    margin-top:8px;
    max-width:620px;
}

.grid {
    display:grid;
    grid-template-columns:
        repeat(auto-fit,minmax(250px,1fr));
    gap:13px;
}

.card {
    background:white;
    border:1px solid var(--line);
    border-radius:17px;
    padding:22px;
}

.card h3 {
    font-size:18px;
}

.card p {
    color:var(--muted);
    margin-top:7px;
    font-size:10px;
}

.card .primary,
.card .secondary {
    margin-top:18px;
}

/* SETTINGS */

.settings {
    display:grid;
    gap:14px;
    max-width:820px;
}

.settings-card {
    background:white;
    border:1px solid var(--line);
    border-radius:17px;
    padding:24px;
}

.settings-card p {
    color:var(--muted);
    font-size:10px;
    margin-top:6px;
}

.form {
    display:grid;
    gap:12px;
    margin-top:18px;
}

.form label {
    display:grid;
    gap:5px;
    color:var(--muted);
    font-size:9px;
}

.check {
    display:flex !important;
    align-items:center;
    gap:7px;
}

.check input {
    width:auto;
}

/* COMPOSER */

dialog {
    width:min(1150px,calc(100vw - 40px));
    border:0;
    border-radius:19px;
    padding:0;
    box-shadow:0 40px 100px rgba(0,0,0,.27);
}

dialog::backdrop {
    background:rgba(10,17,31,.70);
    backdrop-filter:blur(5px);
}

.composer {
    min-height:700px;
    display:flex;
    flex-direction:column;
}

.composer-head {
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:20px 23px;
    border-bottom:1px solid var(--line);
}

.composer-head h2 {
    margin-top:4px;
    font-size:23px;
}

.address-fields {
    display:grid;
    gap:9px;
    padding:16px 23px;
    border-bottom:1px solid var(--line);
    background:#fafbfc;
}

.address-fields label {
    display:grid;
    grid-template-columns:50px 1fr;
    align-items:center;
    color:var(--muted);
    font-size:9px;
}

.address-fields input {
    min-height:37px;
}

.two {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
}

.tabs {
    display:flex;
    padding:0 23px;
    border-bottom:1px solid var(--line);
}

.tab {
    padding:12px 13px;
    border-bottom:2px solid transparent;
    background:transparent;
    color:var(--muted);
    font-size:9px;
    font-weight:650;
}

.tab.active {
    color:var(--blue);
    border-bottom-color:var(--blue);
}

.panel textarea {
    border:0;
    border-radius:0;
    resize:none;
    height:400px;
    padding:26px;
    line-height:1.7;
}

.toolbar {
    display:flex;
    gap:6px;
    padding:9px 16px;
    border-bottom:1px solid var(--line);
    background:#f8fafc;
}

.toolbar button {
    border:1px solid var(--line);
    border-radius:5px;
    background:white;
    padding:5px 8px;
}

.design-editor {
    min-height:385px;
    padding:30px 38px;
    line-height:1.7;
}

.html-panel {
    display:grid;
    grid-template-columns:1fr 1fr;
    min-height:420px;
}

.html-panel section:first-child {
    border-right:1px solid var(--line);
}

.code-title {
    padding:8px 11px;
    background:#f8fafc;
    border-bottom:1px solid var(--line);
    color:var(--muted);
    font-size:8px;
    font-weight:700;
    letter-spacing:.12em;
}

#html-code {
    height:390px;
    border:0;
    border-radius:0;
    resize:none;
    background:#111827;
    color:#e5e7eb;
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        monospace;
    font-size:10px;
    line-height:1.55;
}

#preview {
    width:100%;
    height:390px;
    border:0;
}

.composer-footer {
    margin-top:auto;
    border-top:1px solid var(--line);
    padding:14px 21px;
    display:flex;
    align-items:center;
    justify-content:space-between;
}

.attachment {
    border:1px solid var(--line);
    border-radius:7px;
    padding:7px 9px;
    font-size:9px;
    cursor:pointer;
}

.composer-footer > div:last-child {
    display:flex;
    gap:7px;
}

/* TOAST */

.toast {
    position:fixed;
    right:22px;
    bottom:22px;
    background:#111827;
    color:white;
    padding:12px 15px;
    border-radius:9px;
    font-size:10px;
    opacity:0;
    transform:translateY(8px);
    transition:.18s;
    pointer-events:none;
    z-index:500;
}

.toast.show {
    opacity:1;
    transform:none;
}

.loading {
    padding:25px;
    color:var(--muted);
    text-align:center;
    font-size:10px;
}

.error {
    margin:20px;
    padding:13px;
    background:#fff0ee;
    border:1px solid #fac5c0;
    color:#b42318;
    border-radius:8px;
    font-size:10px;
}

/* RESPONSIVE */

@media(max-width:900px) {

    .sidebar {
        width:205px;
    }

    .shell {
        margin-left:205px;
    }

    .mail-page {
        grid-template-columns:290px 1fr;
    }
}

@media(max-width:720px) {

    .sidebar {
        position:relative;
        width:100%;
        min-height:auto;
    }

    .shell {
        margin-left:0;
    }

    .mail-page {
        grid-template-columns:1fr;
    }

    .reader {
        display:none;
    }

    .html-panel,
    .two {
        grid-template-columns:1fr;
    }
}
