:root {
    --ink: #15213b;
    --muted: #69738a;
    --line: #e6eaf2;
    --surface: #ffffff;
    --soft: #f4f7fb;
    --brand: #4f46e5;
    --brand-dark: #3730a3;
    --brand-soft: #eef2ff;
    --accent: #0ea5e9;
    --success: #07845b;
    --danger: #d33b46;
    --warning: #b36b00;
    --shadow: 0 22px 70px rgba(30, 41, 59, .13);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--soft);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { min-height: 100vh; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .78rem; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    font-weight: 760;
    font-size: 1.18rem;
    letter-spacing: -.02em;
}
.brand-large { font-size: 1.35rem; }
.brand-light { color: #fff; }
.brand-mark {
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    color: #fff;
    border-radius: .8rem;
    background: linear-gradient(145deg, #5b55f4, #3730a3);
    box-shadow: 0 10px 25px rgba(79, 70, 229, .28);
    font-weight: 850;
}
.brand-light .brand-mark { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.25); box-shadow: none; }
.eyebrow { margin: 0 0 .55rem; color: var(--brand); font-weight: 800; font-size: .72rem; letter-spacing: .14em; }
.eyebrow.light { color: #c4d3ff; }

.primary-button, .ghost-button, .send-button, .reply-button {
    border: 0;
    border-radius: .8rem;
    min-height: 2.8rem;
    padding: 0 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    cursor: pointer;
    font-weight: 720;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.primary-button, .send-button {
    color: white;
    background: linear-gradient(135deg, var(--brand), #635bff);
    box-shadow: 0 10px 24px rgba(79, 70, 229, .22);
}
.primary-button:hover, .send-button:hover { transform: translateY(-1px); box-shadow: 0 13px 28px rgba(79,70,229,.29); }
.ghost-button { color: var(--ink); background: var(--surface); border: 1px solid var(--line); }
.ghost-button:hover { background: #f9faff; }
.wide { width: 100%; }
.small-button { min-height: 2.25rem; padding: 0 .85rem; font-size: .82rem; }
.icon-button {
    width: 2.55rem;
    height: 2.55rem;
    border: 0;
    border-radius: 50%;
    background: transparent;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 1.17rem;
}
.icon-button:hover { background: #eef1f7; }
.icon-button:disabled { opacity: .35; cursor: not-allowed; }
.icon-button:disabled:hover { background: transparent; }

.alert { border-radius: .8rem; padding: .8rem 1rem; margin: 1rem 0; font-size: .9rem; line-height: 1.5; }
.alert ul { margin: .45rem 0 0; padding-left: 1.2rem; }
.alert-error { color: #8f1f2b; background: #fff0f1; border: 1px solid #ffd1d5; }
.alert-success { color: #056446; background: #ecfdf5; border: 1px solid #a7f3d0; }

label { display: grid; gap: .4rem; font-size: .84rem; font-weight: 680; color: #34405a; }
input, textarea {
    width: 100%;
    border: 1px solid #dce1eb;
    background: #fff;
    color: var(--ink);
    border-radius: .72rem;
    outline: 0;
    padding: .78rem .9rem;
    transition: border .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus { border-color: #8d87ff; box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
label small { color: var(--muted); font-weight: 500; line-height: 1.35; }
.form-grid { display: grid; gap: 1rem; }
.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-two { grid-column: 1 / -1; }

/* Login */
.login-body { background: #f7f8fc; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1fr) minmax(440px, .85fr); }
.login-visual {
    position: relative;
    overflow: hidden;
    color: white;
    padding: 3.2rem clamp(2rem, 6vw, 6.5rem);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        radial-gradient(circle at 22% 20%, rgba(68,184,255,.36), transparent 30%),
        radial-gradient(circle at 80% 85%, rgba(190,112,255,.3), transparent 32%),
        linear-gradient(145deg, #171d52 0%, #302b85 50%, #4f46e5 100%);
}
.login-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .16;
    background-image: linear-gradient(rgba(255,255,255,.18) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.18) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, black, transparent 80%);
}
.login-visual > * { position: relative; z-index: 2; }
.login-copy { max-width: 610px; margin: auto 0; }
.login-copy h1 { font-size: clamp(3rem, 5.4vw, 5.7rem); line-height: .96; margin: 0 0 1.5rem; letter-spacing: -.065em; }
.login-copy > p:not(.eyebrow) { color: #d8defe; font-size: 1.1rem; max-width: 470px; line-height: 1.65; }
.feature-chips { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 2rem; }
.feature-chips span { padding: .55rem .8rem; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); border-radius: 999px; font-size: .78rem; backdrop-filter: blur(10px); }
.visual-orb { position: absolute; border-radius: 50%; filter: blur(4px); opacity: .35; }
.orb-one { width: 270px; height: 270px; right: -90px; top: 7%; background: #50c9ff; }
.orb-two { width: 360px; height: 360px; left: 20%; bottom: -270px; background: #a855f7; }
.login-panel { padding: 2rem; display: grid; place-items: center; background: #fbfcff; }
.login-card { width: min(100%, 430px); }
.login-card h2 { margin: 0; font-size: 2rem; letter-spacing: -.04em; }
.login-card > .muted { margin: .6rem 0 2rem; }
.login-form { display: grid; gap: 1rem; }
.login-form .primary-button { margin-top: .35rem; }
.login-footnote { color: var(--muted); font-size: .82rem; text-align: center; margin-top: 1.25rem; }
.mobile-brand { display: none; }

/* Installer */
.setup-body { padding: 3rem 1rem; background: radial-gradient(circle at 15% 0, #e8ecff, transparent 32%), #f4f6fb; }
.setup-card { width: min(100%, 880px); margin: auto; background: #fff; padding: clamp(1.35rem, 4vw, 3.25rem); border-radius: 1.4rem; box-shadow: var(--shadow); }
.setup-card > h1 { font-size: clamp(2rem, 4vw, 3rem); margin: 1rem 0 .5rem; letter-spacing: -.045em; }
.setup-card > .muted { max-width: 700px; line-height: 1.65; }
.setup-form { margin-top: 2rem; display: grid; gap: 1.5rem; }
.setup-section { border: 1px solid var(--line); border-radius: 1rem; padding: 1.25rem; }
.setup-section h2 { font-size: 1rem; margin: 0 0 1rem; }
.field-help { margin: -.35rem 0 1rem; color: var(--muted); line-height: 1.5; font-size: .82rem; }

/* Simple notice */
.notice-body { display: grid; place-items: center; padding: 1rem; background: radial-gradient(circle at 50% 0, #e7eaff, transparent 40%), #f5f7fb; }
.notice-card { width: min(100%, 560px); text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 1.35rem; padding: 2.4rem; box-shadow: var(--shadow); }
.notice-card .brand { margin-bottom: 1.8rem; }
.notice-card h1 { margin: .85rem 0 .6rem; font-size: 2rem; }
.notice-card p { color: var(--muted); line-height: 1.65; }
.notice-icon { margin: auto; width: 4rem; height: 4rem; border-radius: 50%; display: grid; place-items: center; background: #e9fbf3; color: var(--success); font-size: 1.7rem; }
.notice-icon.pending { background: #fff8e6; color: var(--warning); }
.notice-actions { margin-top: 1.5rem; display: flex; justify-content: center; align-items: center; gap: .75rem; flex-wrap: wrap; }
.notice-actions form { margin: 0; }

/* Mail */
.mail-body { background: #f4f6fa; overflow: hidden; }
.mail-app { height: 100vh; display: grid; grid-template: 4.25rem 1fr / 16rem 1fr; }
.topbar { grid-column: 1 / -1; display: grid; grid-template-columns: 16rem minmax(280px, 680px) 1fr; align-items: center; padding: 0 1rem; gap: 1.5rem; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); z-index: 20; }
.topbar > .brand { padding-left: .3rem; }
.menu-button { display: none; }
.search-box { position: relative; display: flex; align-items: center; gap: .6rem; font-weight: 400; }
.search-box > span { position: absolute; left: .9rem; color: var(--muted); font-size: 1.15rem; }
.search-box input { height: 2.85rem; padding-left: 2.6rem; border: 0; border-radius: .8rem; background: #f1f4f9; }
.account-menu { justify-self: end; display: flex; align-items: center; gap: .45rem; }
.account-menu form { margin: 0; }
.admin-link { padding: .5rem .7rem; font-size: .78rem; color: var(--brand); font-weight: 750; }
.avatar, .sender-avatar, .account-avatar { display: grid; place-items: center; border-radius: 50%; font-weight: 800; }
.avatar { width: 2.4rem; height: 2.4rem; color: #fff; background: linear-gradient(145deg, #ef7d5c, #c24166); }
.sidebar { min-height: 0; padding: 1rem .75rem .8rem; display: flex; flex-direction: column; background: #f8f9fc; border-right: 1px solid var(--line); }
.compose-button { width: 9.6rem; height: 3.2rem; margin: .15rem 0 1.1rem .2rem; border: 0; border-radius: 1rem; color: #29314a; background: #dff2ff; box-shadow: 0 6px 18px rgba(30, 91, 125, .09); display: flex; align-items: center; justify-content: center; gap: .65rem; font-weight: 730; cursor: pointer; }
.compose-button span { font-size: 1.4rem; }
.mail-nav { display: grid; gap: .2rem; }
.nav-item { width: 100%; height: 2.65rem; border: 0; border-radius: 0 999px 999px 0; padding: 0 1rem; display: grid; grid-template-columns: 1.4rem 1fr auto; align-items: center; gap: .55rem; text-align: left; background: transparent; cursor: pointer; font-size: .88rem; }
.nav-item:hover { background: #edf0f6; }
.nav-item.active { color: var(--brand-dark); background: #e6e8ff; font-weight: 760; }
.nav-item b { font-size: .72rem; }
.sidebar-footer { margin-top: auto; padding: .85rem .8rem .2rem; color: var(--muted); font-size: .72rem; display: flex; align-items: center; gap: .5rem; overflow: hidden; }
.sidebar-footer span:last-child { overflow: hidden; text-overflow: ellipsis; }
.address-dot { width: .48rem; height: .48rem; background: #10b981; border-radius: 50%; flex: 0 0 auto; }
.mail-main { min-width: 0; min-height: 0; margin: .65rem .75rem .75rem 0; background: #fff; border: 1px solid var(--line); border-radius: 1rem; overflow: hidden; }
.list-view, .reader-view { height: 100%; overflow-y: auto; }
.mail-toolbar { position: sticky; top: 0; z-index: 3; height: 3.55rem; padding: 0 1rem; display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.mail-toolbar > div { display: flex; align-items: center; gap: .35rem; }
.page-controls { display: flex; align-items: center; gap: .2rem; }
.page-controls .small { min-width: 3.4rem; text-align: center; }
.toolbar-title { font-weight: 760; font-size: .9rem; margin-left: .2rem; }
.loading-state { height: 9rem; display: flex; align-items: center; justify-content: center; gap: .7rem; color: var(--muted); font-size: .86rem; }
.spinner { width: 1.2rem; height: 1.2rem; border: 2px solid #dfe3ed; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.mail-row { min-height: 3.65rem; display: grid; grid-template-columns: 2.7rem minmax(130px, .65fr) minmax(260px, 1.5fr) auto; align-items: center; gap: .7rem; padding: .45rem 1rem .45rem .55rem; border-bottom: 1px solid #eef0f5; cursor: pointer; transition: background .12s; }
.mail-row:hover { background: #f7f8fc; box-shadow: inset 3px 0 var(--brand); }
.mail-row.unread { background: #f7f8ff; }
.mail-row.unread .mail-sender, .mail-row.unread .mail-subject { font-weight: 790; color: #111a31; }
.star-button { width: 2.3rem; height: 2.3rem; border: 0; background: transparent; border-radius: 50%; cursor: pointer; color: #9aa3b7; font-size: 1.12rem; }
.star-button:hover { background: #eceff5; }
.star-button.starred { color: #f0a700; }
.mail-sender { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.mail-preview { min-width: 0; display: flex; align-items: baseline; gap: .4rem; overflow: hidden; font-size: .85rem; }
.mail-subject { white-space: nowrap; }
.mail-snippet { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-date { color: var(--muted); white-space: nowrap; font-size: .72rem; }
.empty-state { padding: 7rem 1rem; text-align: center; color: var(--muted); }
.empty-state > div { font-size: 2.8rem; color: #aab3c6; }
.empty-state h3 { color: var(--ink); margin-bottom: .25rem; }
.empty-state p { margin: 0; font-size: .85rem; }
.message-reader { width: min(100%, 920px); padding: 1.8rem clamp(1rem, 4vw, 3rem) 4rem; }
.message-reader > h1 { font-size: clamp(1.5rem, 3vw, 2.25rem); letter-spacing: -.035em; margin: .35rem 0 1.6rem; }
.sender-row { display: grid; grid-template-columns: 2.7rem 1fr auto; align-items: center; gap: .75rem; padding-bottom: 1.3rem; border-bottom: 1px solid var(--line); }
.sender-avatar { width: 2.7rem; height: 2.7rem; color: #3f3a92; background: #e4e6ff; }
.sender-row strong { font-size: .9rem; }
.sender-row p { margin: .2rem 0 0; font-size: .75rem; }
.sender-row time { color: var(--muted); font-size: .74rem; }
.reader-body { padding: 1.8rem 0; color: #28334a; line-height: 1.72; font-size: .95rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.attachment-list { display: flex; flex-wrap: wrap; gap: .6rem; padding: .4rem 0 1.4rem; }
.attachment-card { max-width: 260px; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: .75rem; display: flex; align-items: center; gap: .65rem; background: #fafbfe; }
.attachment-card span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
.reply-button { border: 1px solid var(--line); background: #fff; }
.compose-panel { position: fixed; right: 1.2rem; bottom: 0; z-index: 50; width: min(560px, calc(100vw - 2rem)); background: #fff; border-radius: .9rem .9rem 0 0; box-shadow: 0 18px 80px rgba(15,23,42,.28); overflow: hidden; }
.compose-head { height: 2.8rem; color: #fff; background: #282e48; display: flex; align-items: center; justify-content: space-between; padding: 0 .65rem 0 1rem; font-size: .82rem; }
.compose-head .icon-button { color: #fff; width: 2.1rem; height: 2.1rem; }
.compose-head .icon-button:hover { background: rgba(255,255,255,.1); }
.compose-panel form { padding: 0 .9rem .75rem; }
.compose-panel form > input { border: 0; border-radius: 0; border-bottom: 1px solid var(--line); box-shadow: none; padding-left: .2rem; padding-right: .2rem; }
.compose-more { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; border-bottom: 1px solid var(--line); }
.compose-more input { border: 0; border-radius: 0; box-shadow: none; padding-left: .2rem; }
.compose-panel textarea { height: 230px; resize: vertical; border: 0; box-shadow: none; border-radius: 0; padding: 1rem .2rem; }
.compose-actions { display: flex; align-items: center; gap: .55rem; }
.send-button { min-width: 5.5rem; min-height: 2.45rem; }
.attach-button { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border-radius: 50%; cursor: pointer; color: var(--muted); }
.attach-button:hover { background: #eef1f7; }
.attach-button input { display: none; }
.send-status { color: var(--muted); font-size: .75rem; margin-left: .25rem; }
.attachment-preview { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .45rem; }
.file-chip { padding: .35rem .55rem; background: #f0f2f8; border-radius: .5rem; font-size: .7rem; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast { position: fixed; z-index: 90; left: 50%; bottom: 1.2rem; transform: translateX(-50%); color: #fff; background: #20263b; padding: .72rem 1rem; border-radius: .7rem; box-shadow: 0 10px 35px rgba(0,0,0,.2); font-size: .82rem; }

/* Admin */
.admin-body { background: #f5f6fa; }
.admin-topbar { height: 4.4rem; padding: 0 clamp(1rem, 4vw, 3.5rem); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: #fff; }
.admin-account { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .78rem; }
.admin-account form { margin: 0; }
.admin-main { width: min(100% - 2rem, 1320px); margin: 2.2rem auto 4rem; }
.admin-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; }
.admin-heading h1 { margin: 0; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.05em; }
.admin-heading .muted { margin: .55rem 0 0; }
.admin-heading form { margin: 0; }
.stat-grid { margin: 1.6rem 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; }
.stat-grid article { min-height: 7.2rem; padding: 1.15rem; border: 1px solid var(--line); border-radius: 1rem; background: #fff; display: flex; flex-direction: column; justify-content: space-between; }
.stat-grid span { color: var(--muted); font-size: .78rem; }
.stat-grid strong { font-size: 2rem; letter-spacing: -.04em; }
.stat-grid .domain-stat { font-size: 1.15rem; }
.admin-grid { display: grid; grid-template-columns: minmax(320px, .72fr) minmax(520px, 1.35fr); gap: 1rem; align-items: start; }
.admin-card { border: 1px solid var(--line); border-radius: 1rem; background: #fff; padding: 1.25rem; box-shadow: 0 10px 35px rgba(30,41,59,.035); }
.card-heading { display: flex; align-items: center; gap: .85rem; margin-bottom: 1.25rem; }
.card-heading h2, .accounts-head h2 { margin: 0; font-size: 1.12rem; }
.card-heading p { margin: .3rem 0 0; color: var(--muted); font-size: .75rem; line-height: 1.4; }
.card-icon { width: 2.7rem; height: 2.7rem; display: grid; place-items: center; border-radius: .8rem; color: var(--brand); background: var(--brand-soft); font-size: 1.4rem; }
.input-suffix { display: flex; align-items: center; border: 1px solid #dce1eb; border-radius: .72rem; overflow: hidden; }
.input-suffix:focus-within { border-color: #8d87ff; box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.input-suffix input { border: 0; border-radius: 0; box-shadow: none; min-width: 0; }
.input-suffix span { padding: 0 .75rem; color: var(--muted); font-size: .72rem; white-space: nowrap; }
.accounts-card { padding: 0; overflow: visible; }
.accounts-head { min-height: 4.7rem; padding: .85rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); }
.accounts-head p { margin: .25rem 0 0; font-size: .72rem; }
.admin-search { width: 210px; display: flex; align-items: center; border: 1px solid var(--line); border-radius: .7rem; overflow: hidden; }
.admin-search input { min-width: 0; border: 0; border-radius: 0; box-shadow: none; padding: .58rem .7rem; }
.admin-search button { width: 2.4rem; align-self: stretch; border: 0; background: transparent; cursor: pointer; }
.account-list { padding: .15rem 0; }
.account-row { position: relative; min-height: 5.2rem; display: grid; grid-template-columns: 2.6rem 1fr auto 2.1rem; align-items: center; gap: .75rem; padding: .65rem 1rem; border-bottom: 1px solid #eef0f4; }
.account-row:last-child { border-bottom: 0; }
.account-avatar { width: 2.6rem; height: 2.6rem; color: #423c94; background: #e7e8ff; }
.account-details { min-width: 0; display: grid; gap: .16rem; }
.account-details strong, .account-details span, .account-details small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-details strong { font-size: .84rem; }
.account-details span { color: #47516a; font-size: .76rem; }
.account-details small { color: var(--muted); font-size: .67rem; }
.account-state { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; justify-content: end; }
.status-pill, .sync-pill { padding: .32rem .52rem; border-radius: 999px; font-size: .64rem; font-weight: 760; }
.status-pill.active { color: #087552; background: #e6f8f0; }
.status-pill.suspended { color: #a12531; background: #ffedef; }
.sync-pill { color: #9a5a00; background: #fff6df; }
.account-actions { position: relative; }
.account-actions summary { list-style: none; cursor: pointer; width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 50%; }
.account-actions summary:hover { background: #eef0f5; }
.account-actions summary::-webkit-details-marker { display: none; }
.action-popover { position: absolute; right: 0; top: 2.2rem; z-index: 15; width: 235px; padding: .6rem; border: 1px solid var(--line); border-radius: .75rem; background: #fff; box-shadow: 0 14px 35px rgba(15,23,42,.16); }
.action-popover form { margin: 0; }
.action-popover button { width: 100%; border: 0; border-radius: .55rem; background: transparent; padding: .6rem; text-align: left; cursor: pointer; font-size: .76rem; }
.action-popover button:hover { background: #f2f4f8; }
.reset-form { border-top: 1px solid var(--line); margin-top: .35rem !important; padding-top: .35rem; }
.reset-form input { padding: .55rem .6rem; font-size: .72rem; }
.empty-admin { padding: 4rem 1rem; text-align: center; color: var(--muted); font-size: .82rem; }

@media (max-width: 980px) {
    .login-shell { grid-template-columns: minmax(340px, .85fr) minmax(400px, 1fr); }
    .login-copy h1 { font-size: 3.5rem; }
    .admin-grid { grid-template-columns: 1fr; }
    .create-user-card { max-width: none; }
    .mail-app { grid-template-columns: 5rem 1fr; }
    .topbar { grid-template-columns: 5rem minmax(260px, 1fr) auto; }
    .topbar > .brand span:last-child { display: none; }
    .compose-button { width: 3.4rem; padding: 0; border-radius: 1rem; font-size: 0; }
    .compose-button span { font-size: 1.45rem; }
    .nav-item { grid-template-columns: 1fr; justify-items: center; padding: 0; border-radius: .8rem; font-size: 0; }
    .nav-item span { font-size: 1.15rem; }
    .nav-item b { display: none; }
    .sidebar-footer { justify-content: center; }
    .sidebar-footer span:last-child { display: none; }
}

@media (max-width: 740px) {
    .two-cols { grid-template-columns: 1fr; }
    .span-two { grid-column: auto; }
    .login-shell { display: block; background: linear-gradient(145deg, #edf0ff, #fbfcff); padding: 1rem; }
    .login-visual { display: none; }
    .login-panel { min-height: calc(100vh - 2rem); border-radius: 1.3rem; padding: 1.5rem; }
    .mobile-brand { display: inline-flex; position: absolute; top: 2.1rem; left: 2.1rem; }
    .login-card { margin-top: 4rem; }
    .setup-body { padding: 1rem .65rem; }
    .setup-card { border-radius: 1rem; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-main { width: min(100% - 1rem, 1320px); margin-top: 1.2rem; }
    .admin-heading { align-items: start; flex-direction: column; }
    .admin-account > span { display: none; }
    .accounts-head { align-items: stretch; flex-direction: column; }
    .admin-search { width: 100%; }
    .account-row { grid-template-columns: 2.5rem minmax(0, 1fr) 2rem; }
    .account-state { grid-column: 2; justify-content: start; }
    .account-actions { grid-column: 3; grid-row: 1; }

    .mail-body { overflow: hidden; }
    .mail-app { display: block; height: 100vh; }
    .topbar { height: 4rem; display: grid; grid-template-columns: 2.6rem 1fr auto; gap: .45rem; padding: 0 .55rem; }
    .menu-button { display: grid; }
    .topbar > .brand { display: none; }
    .search-box { grid-column: 2; }
    .search-box input { height: 2.65rem; }
    .admin-link { display: none; }
    .account-menu .avatar { display: none; }
    .sidebar { position: fixed; z-index: 40; top: 4rem; bottom: 0; left: 0; width: 16rem; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 14px 0 35px rgba(15,23,42,.14); }
    .sidebar.open { transform: translateX(0); }
    .compose-button { width: 9.6rem; font-size: .86rem; }
    .nav-item { grid-template-columns: 1.4rem 1fr auto; justify-items: stretch; padding: 0 1rem; border-radius: 0 999px 999px 0; font-size: .88rem; }
    .nav-item span { font-size: 1rem; }
    .nav-item b { display: block; }
    .sidebar-footer { justify-content: start; }
    .sidebar-footer span:last-child { display: inline; }
    .mail-main { height: calc(100vh - 4rem); margin: 0; border: 0; border-radius: 0; }
    .mail-row { grid-template-columns: 2.4rem minmax(80px, .55fr) minmax(140px, 1.25fr); padding-right: .7rem; }
    .mail-date { display: none; }
    .mail-snippet { display: none; }
    .sender-row { grid-template-columns: 2.6rem 1fr; }
    .sender-row time { grid-column: 2; }
    .compose-panel { right: 0; width: 100%; border-radius: .9rem .9rem 0 0; }
    .compose-panel textarea { height: 35vh; }
}

@media (max-width: 440px) {
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .stat-grid article { min-height: 6rem; }
    .stat-grid strong { font-size: 1.55rem; }
    .account-row { padding-left: .7rem; padding-right: .7rem; }
    .account-avatar { width: 2.35rem; height: 2.35rem; }
    .notice-card { padding: 1.6rem 1rem; }
    .message-reader { padding-left: .85rem; padding-right: .85rem; }
}
