:root {
    --font-ui: "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
    --font-display: "Segoe UI Variable Display", "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, sans-serif;
    --font-reading: "Segoe UI Variable Text", "Segoe UI", Inter, Arial, sans-serif;
    --ink: #172033;
    --ink-soft: #384357;
    --muted: #657086;
    --line: #e4e7eb;
    --line-strong: #d6dbe1;
    --canvas: #f6f8fc;
    --surface: #ffffff;
    --surface-soft: #f8fafd;
    --sidebar: #f6f8fc;
    --primary: #0b57d0;
    --primary-dark: #0842a0;
    --primary-soft: #eaf1fb;
    --cyan: #6dd9e8;
    --success: #15825c;
    --danger: #c23f4e;
    --warning: #b87715;
    --focus-ring: 0 0 0 3px rgba(11, 87, 208, .18);
    --shadow-sm: 0 1px 2px rgba(22, 34, 56, .045), 0 6px 18px rgba(22, 34, 56, .045);
    --shadow-md: 0 20px 52px rgba(24, 36, 58, .14);
    --radius: 16px;
    --topbar: 64px;
    --rail: 72px;
    --sidebar-width: 232px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { min-height: 100%; margin: 0; color: var(--ink); background: var(--canvas); font-family: var(--font-ui); font-size: 14px; line-height: 1.55; letter-spacing: -.006em; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg.icon { flex: 0 0 auto; }
::selection { color: #fff; background: rgba(11, 87, 208, .82); }
:where(a, button, input, select, textarea, [contenteditable="true"]):focus-visible { outline: 3px solid rgba(11, 87, 208, .22); outline-offset: 2px; }
h1, h2, h3, .brand-name { font-family: var(--font-display); }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 9999; padding: 10px 16px; color: #fff; background: var(--primary); border-radius: 10px; }
.skip-link:focus { top: 12px; }
.eyebrow { display: block; margin-bottom: 5px; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.muted { color: var(--muted); }
.mobile-only { display: none !important; }

.btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: 11px; border: 1px solid transparent; padding: 9px 17px; font-weight: 720; box-shadow: none !important; transition: transform .15s, background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-light { color: var(--ink); background: var(--surface-soft); border-color: var(--line); }
.btn-light:hover { background: #eef2f7; border-color: var(--line-strong); }
.btn-lg { min-height: 50px; border-radius: 13px; }

.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { width: 36px; height: 36px; display: inline-grid; place-items: center; overflow: hidden; padding: 3px; border: 1px solid rgba(33,73,171,.12); border-radius: 12px; color: #fff; background: #fff; box-shadow: 0 7px 16px rgba(54, 91, 217, .20); }
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: contain; }
.brand-name { color: var(--ink); font-size: 20px; font-weight: 790; letter-spacing: -.045em; white-space: nowrap; }
.brand-name span { color: var(--primary); }
.brand-light .brand-name { color: #fff; }
.brand-light .brand-name span { color: #b8c7ff; }

.icon-button { width: 42px; height: 42px; display: inline-grid; place-items: center; padding: 0; color: var(--ink-soft); background: transparent; border: 0; border-radius: 12px; cursor: pointer; transition: color .15s, background .15s, transform .15s; }
.icon-button:hover, .icon-button:focus-visible { color: var(--primary); background: var(--primary-soft); }
.icon-button:active { transform: scale(.95); }
.icon-button.disabled { opacity: .35; pointer-events: none; }
.icon-button.danger:hover { color: var(--danger); background: #fff0f1; }

/* Sign in */
.login-page { overflow: hidden; background: #fff; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(440px, .95fr) minmax(520px, 1.05fr); }
.login-story { position: relative; isolation: isolate; min-height: 100vh; overflow: hidden; display: flex; flex-direction: column; padding: clamp(30px, 5vw, 68px); color: #fff; background: #17264c; }
.login-story::before { content: ""; position: absolute; z-index: -2; inset: 0; background: radial-gradient(circle at 76% 22%, rgba(94, 129, 240, .52), transparent 34%), radial-gradient(circle at 5% 86%, rgba(66, 224, 216, .20), transparent 28%), linear-gradient(145deg, #182d62 0%, #17244a 55%, #101c3c 100%); }
.login-story::after { content: ""; position: absolute; z-index: -1; width: 460px; height: 460px; right: -160px; bottom: -120px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; box-shadow: 0 0 0 72px rgba(255,255,255,.025), 0 0 0 144px rgba(255,255,255,.018); }
.login-story .brand-mark { background: #fff; color: var(--primary); box-shadow: 0 8px 22px rgba(0,0,0,.18); }
.story-copy { margin: auto 0 26px; max-width: 620px; }
.story-pill { width: fit-content; display: flex; align-items: center; gap: 8px; margin-bottom: 30px; padding: 7px 12px; color: #dbe3ff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.story-copy h1 { margin: 0; font-size: clamp(45px, 5vw, 76px); line-height: 1.02; letter-spacing: -.065em; font-weight: 760; }
.story-copy h1 em { color: #a9bbff; font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.story-copy p { max-width: 520px; margin: 26px 0 0; color: rgba(236,241,255,.72); font-size: 18px; line-height: 1.7; }
.mail-preview { width: min(560px, 95%); margin: 18px 0 auto; overflow: hidden; color: var(--ink); background: rgba(255,255,255,.96); border: 1px solid rgba(255,255,255,.48); border-radius: 18px; box-shadow: 0 30px 80px rgba(4, 12, 31, .3); transform: rotate(-1deg); }
.preview-top { height: 42px; display: flex; align-items: center; gap: 6px; padding: 0 16px; color: var(--muted); background: #f4f6fa; border-bottom: 1px solid var(--line); }
.preview-top span { width: 7px; height: 7px; border-radius: 50%; background: #c7cedb; }
.preview-top b { margin-left: auto; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.preview-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.preview-row:last-child { border: 0; }
.preview-row.active { background: #eef2ff; }
.preview-row i { width: 32px; height: 32px; display: grid; place-items: center; color: #fff; background: #6a7fbe; border-radius: 10px; font-style: normal; font-size: 10px; font-weight: 800; }
.preview-row div { min-width: 0; }
.preview-row strong, .preview-row span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-row strong { font-size: 12px; }
.preview-row span, .preview-row time { color: var(--muted); font-size: 11px; }
.login-story footer { margin-top: 30px; color: rgba(255,255,255,.44); font-size: 12px; }
.login-panel { min-height: 100vh; display: grid; place-items: center; padding: 40px; background: #fff; }
.login-card { width: min(430px, 100%); }
.login-mobile-brand { display: none; }
.login-card h2 { margin: 0; font-size: 34px; line-height: 1.16; letter-spacing: -.045em; }
.login-card > p { margin: 12px 0 32px; }
.login-form { display: grid; gap: 20px; }
.biometric-login { display: grid; gap: 10px; margin-top: 22px; text-align: center; }
.biometric-login[hidden] { display: none; }
.biometric-login > span { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.biometric-login > span::before, .biometric-login > span::after { content: ""; height: 1px; background: var(--line); }
.biometric-login-button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; color: var(--primary-dark); background: var(--primary-soft); border: 1px solid #cfdef5; font-weight: 760; }
.biometric-login-button:hover { color: var(--primary-dark); background: #e3edfc; border-color: #bdd0ed; }
.biometric-login small { color: var(--muted); font-size: 11px; }
.form-floating-group { position: relative; display: grid; gap: 7px; }
.form-floating-group label, .field > span { color: var(--ink-soft); font-size: 12px; font-weight: 750; }
.form-floating-group input, .field input, .field select { width: 100%; height: 48px; padding: 0 14px; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 11px; outline: none; transition: border .15s, box-shadow .15s; }
.form-floating-group input:focus, .field input:focus, .field select:focus { border-color: #8ea3ed; box-shadow: 0 0 0 4px rgba(54,91,217,.10); }
.password-field button { position: absolute; right: 8px; bottom: 6px; height: 36px; padding: 0 9px; color: var(--primary); background: transparent; border: 0; border-radius: 8px; font-size: 12px; font-weight: 750; }
.login-help { display: flex; align-items: flex-start; gap: 10px; margin-top: 30px; padding: 14px; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; font-size: 12px; }
.login-help svg { margin-top: 1px; color: var(--success); }

/* Application frame */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--rail) var(--sidebar-width) minmax(0, 1fr); grid-template-rows: var(--topbar) minmax(0, 1fr); }
.topbar { position: sticky; z-index: 80; top: 0; grid-column: 1 / -1; display: grid; grid-template-columns: calc(var(--rail) + var(--sidebar-width) - 18px) minmax(280px, 720px) 1fr; align-items: center; gap: 16px; height: var(--topbar); padding: 0 16px 0 20px; background: rgba(246,248,252,.95); backdrop-filter: blur(14px); }
.topbar-brand { display: flex; align-items: center; }
.global-search { height: 46px; display: flex; align-items: center; gap: 11px; padding: 0 17px; color: var(--muted); background: #edf3fb; border: 1px solid transparent; border-radius: 24px; transition: background .18s, border .18s, box-shadow .18s; }
.global-search:focus-within { background: #fff; border-color: #d3daea; box-shadow: var(--shadow-sm); }
.global-search input { min-width: 0; flex: 1; padding: 0; color: var(--ink); background: transparent; border: 0; outline: none; }
.global-search input::placeholder { color: #7e899d; }
.global-search kbd { padding: 1px 6px; color: #8993a6; background: rgba(255,255,255,.68); border: 1px solid #d9dfea; border-radius: 5px; font: 11px/1.4 inherit; }
.topbar-actions { justify-self: end; display: flex; align-items: center; gap: 4px; }
.install-button { height: 38px; display: inline-flex; align-items: center; gap: 7px; margin-right: 4px; padding: 0 12px; color: var(--primary); background: var(--primary-soft); border: 0; border-radius: 10px; font-size: 12px; font-weight: 750; }
.notification-button { position: relative; }
.notification-indicator { position: absolute; right: 6px; top: 6px; width: 7px; height: 7px; opacity: 0; background: var(--success); border: 2px solid #f6f8fc; border-radius: 50%; box-sizing: content-box; transition: opacity .15s, transform .15s; transform: scale(.7); }
.notification-button.is-enabled { color: var(--primary); background: var(--primary-soft); }
.notification-button.is-enabled .notification-indicator { opacity: 1; transform: scale(1); }
.notification-button.is-blocked { color: var(--danger); }
.avatar-button { width: 42px; height: 42px; display: grid; place-items: center; padding: 0; background: transparent; border: 0; border-radius: 50%; }
.avatar { width: 34px; height: 34px; display: inline-grid; place-items: center; flex: 0 0 auto; color: #fff; background: linear-gradient(145deg, #e27967, #b94f70); border-radius: 11px; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.avatar-lg { width: 44px; height: 44px; border-radius: 14px; font-size: 13px; }
.account-menu { width: 260px; margin-top: 10px !important; padding: 8px; border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow-md); }
.account-summary { display: flex; align-items: center; gap: 11px; padding: 10px 9px 14px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.account-summary div { min-width: 0; }
.account-summary strong, .account-summary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-summary small { color: var(--muted); font-size: 11px; }
.account-menu .dropdown-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 9px; font-size: 13px; }
.account-menu form { margin: 0; }

.nav-rail { position: sticky; top: var(--topbar); align-self: start; height: calc(100vh - var(--topbar)); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 10px; background: #eef3fb; }
.rail-compose { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 10px; color: #001d35; background: #c2e7ff; border: 0; border-radius: 16px; box-shadow: 0 2px 7px rgba(60,64,67,.12); }
.rail-link { position: relative; width: 45px; height: 45px; display: grid; place-items: center; color: #5d687c; border-radius: 14px; }
.rail-link:hover, .rail-link.active { color: var(--primary); background: #fff; box-shadow: var(--shadow-sm); }
.rail-badge { position: absolute; right: -4px; top: -4px; min-width: 21px; height: 18px; display: grid; place-items: center; padding: 0 4px; color: #fff; background: var(--danger); border: 2px solid #e9edf5; border-radius: 999px; font-size: 10px; font-weight: 800; }
.sidebar { position: sticky; top: var(--topbar); align-self: start; height: calc(100vh - var(--topbar)); display: flex; flex-direction: column; padding: 14px 10px 14px 0; background: var(--sidebar); overflow-y: auto; }
.compose-button { width: 154px; height: 56px; display: flex; align-items: center; justify-content: flex-start; gap: 14px; margin: 0 0 16px 8px; padding: 0 20px; color: #001d35; background: #c2e7ff; border: 0; border-radius: 16px; box-shadow: 0 2px 7px rgba(60,64,67,.12); font-weight: 750; transition: box-shadow .15s, transform .15s; }
.compose-button:hover { box-shadow: 0 4px 12px rgba(60,64,67,.18); transform: translateY(-1px); }
.folder-nav { display: grid; gap: 3px; }
.folder-link { min-height: 40px; display: flex; align-items: center; gap: 14px; padding: 0 16px; color: #3c4043; border-radius: 0 20px 20px 0; font-size: 13px; font-weight: 560; }
.folder-link:hover { color: var(--ink); background: rgba(255,255,255,.58); }
.folder-link.active { color: #001d35; background: #d3e3fd; font-weight: 760; }
.folder-link span { min-width: 0; flex: 1; }
.folder-link strong { color: inherit; font-size: 11px; }
.sidebar-section { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line-strong); }
.sidebar-label { display: block; margin: 0 12px 9px; color: #7a859a; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-footer { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 14px 12px 2px; border-top: 1px solid var(--line-strong); }
.sidebar-footer .status-dot { width: 8px; height: 8px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 4px rgba(21,130,92,.10); }
.sidebar-footer strong, .sidebar-footer small { display: block; }
.sidebar-footer strong { font-size: 12px; }
.sidebar-footer small { color: var(--muted); font-size: 11px; }
.app-main { min-width: 0; padding: 8px 16px 16px 8px; }
.mobile-drawer, .drawer-backdrop, .mobile-bottom-nav, .mobile-compose { display: none; }

/* Mailbox */
.mailbox-card, .reader-card, .admin-card { background: var(--surface); border: 1px solid #e0e5ed; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.mailbox-card { --mailbox-right-space: 20px; min-height: calc(100vh - var(--topbar) - 24px); overflow: hidden; }
.mailbox-header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px var(--mailbox-right-space) 12px 20px; background: linear-gradient(180deg, #fff 0%, #fbfcff 100%); }
.mailbox-header h1, .page-heading h1 { margin: 0; font-size: 24px; line-height: 1.15; letter-spacing: -.035em; }
.mailbox-heading { display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 1px 10px; }
.mailbox-heading .eyebrow { grid-column: 1 / -1; margin-bottom: 2px; }
.mailbox-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.mailbox-meta { width: 60px; flex: 0 0 60px; display: flex; align-items: center; justify-content: flex-end; color: var(--muted); font-size: 10.5px; line-height: 1.25; text-align: right; }
.mailbox-count { font-variant-numeric: tabular-nums; }
.category-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 7px 12px 8px; background: #fbfcfe; border-top: 1px solid #edf0f5; border-bottom: 1px solid var(--line); }
.category-tab { position: relative; height: 42px; display: flex; align-items: center; justify-content: flex-start; gap: 9px; padding: 0 14px; color: #596579; background: transparent; border: 1px solid transparent; border-radius: 11px; font-size: 12px; font-weight: 680; transition: color .15s, background .15s, border-color .15s, box-shadow .15s; }
.category-tab::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -9px; height: 2px; border-radius: 2px 2px 0 0; background: transparent; }
.category-tab:hover { color: var(--primary-dark); background: #f1f5fb; }
.category-tab.active { color: var(--primary-dark); background: #edf4ff; border-color: #ccddf5; box-shadow: 0 1px 2px rgba(22,34,56,.04); }
.category-tab.active::after { background: var(--primary); }
.category-tab svg { color: currentColor; }
.category-tab b { min-width: 21px; padding: 2px 6px; color: var(--primary-dark); background: #dfeafb; border-radius: 999px; font-size: 10px; line-height: 1.45; text-align: center; }
.mail-toolbar { height: 48px; display: flex; align-items: center; gap: 2px; padding: 0 var(--mailbox-right-space) 0 4px; background: #fff; border-bottom: 1px solid var(--line); }
.toolbar-leading { display: flex; align-items: center; }
.toolbar-divider { width: 1px; height: 22px; margin: 0 6px; background: var(--line); }
.toolbar-spacer { flex: 1; }
.mail-range { margin-right: 4px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.toolbar-page-button { width: 38px; height: 38px; border-radius: 50%; }
.toolbar-page-button.next-button { display: flex; align-items: center; justify-content: flex-end; }
.check-control { width: 38px; height: 38px; display: grid; place-items: center; margin: 0; cursor: pointer; }
.check-control input { position: absolute; opacity: 0; pointer-events: none; }
.check-control span { width: 16px; height: 16px; display: block; background: #fff; border: 1.5px solid #b8c0cf; border-radius: 4px; transition: background .12s, border .12s; }
.check-control input:checked + span { background: var(--primary); border-color: var(--primary); box-shadow: inset 0 0 0 3px #fff; }
.toolbar-button { min-width: 38px; min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 9px; color: #5f6368; background: transparent; border: 0; border-radius: 50%; font-size: 12px; font-weight: 650; }
.toolbar-button:hover { color: var(--primary); background: var(--primary-soft); }
.text-action { margin-left: 2px; }
.message-list { min-height: 260px; }
.message-row { position: relative; min-height: 52px; display: grid; grid-template-columns: 36px 34px minmax(0, 1fr); align-items: center; padding: 0 var(--mailbox-right-space) 0 6px; background: #f2f6fc; border-bottom: 1px solid #e6e9ee; transition: background .12s, box-shadow .12s; }
.message-row:last-child { border-bottom: 0; }
.message-row:hover { z-index: 1; background: #fff; box-shadow: 0 2px 12px rgba(29,42,68,.08); }
.message-row.unread { background: #fff; box-shadow: inset 3px 0 0 #a8c7fa; }
.message-row.unread::before { display: none; }
.row-check { width: 34px; }
.star-form { margin: 0; }
.star-button { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; color: #b1b9c7; background: transparent; border: 0; border-radius: 9px; }
.star-button:hover { color: #d99a22; background: #fff6de; }
.star-button.active { color: #e1a020; }
.star-button.active svg { fill: currentColor; }
.message-link { min-width: 0; display: grid; grid-template-columns: minmax(150px, 210px) minmax(220px, 1fr) auto; align-items: center; gap: 14px; min-height: 51px; padding-left: 2px; }
.sender-line, .subject-line { min-width: 0; display: flex; align-items: center; gap: 7px; }
.sender-line strong, .subject-line strong, .subject-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sender-line strong { font-size: 14px; font-weight: 650; }
.unread .sender-line strong, .unread .subject-line strong { color: #111b2e; font-weight: 800; }
.subject-line strong { max-width: 48%; font-size: 14px; font-weight: 620; }
.subject-line span { flex: 1; color: var(--muted); font-size: 13px; }
.message-tail { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.message-tail time { min-width: 60px; color: #68748a; font-size: 12px; font-weight: 650; text-align: right; white-space: nowrap; }
.unread .message-tail time { color: var(--ink); font-weight: 800; }
.owner-chip { max-width: 82px; overflow: hidden; padding: 2px 7px; color: #68748a; background: #eef1f5; border-radius: 6px; font-size: 10px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { padding: 3px 8px; color: #627088; background: #eef1f5; border-radius: 999px; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.status-delivered, .status-opened, .status-clicked { color: var(--success); background: #e8f7f0; }
.status-failed, .status-bounced, .status-complained { color: var(--danger); background: #fff0f2; }
.attachment-mark { color: var(--muted); font-size: 14px; }
.row-quick-actions { position: absolute; z-index: 3; right: 5px; top: 5px; display: none; align-items: center; gap: 1px; padding-left: 14px; background: linear-gradient(90deg, transparent, #fff 16%); }
.row-quick-actions button { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; color: #5f6368; background: transparent; border: 0; border-radius: 50%; }
.row-quick-actions button:hover { color: var(--primary); background: var(--primary-soft); }
.message-row:hover .row-quick-actions, .message-row:focus-within .row-quick-actions { display: flex; }
.message-row:hover .message-tail, .message-row:focus-within .message-tail { visibility: hidden; }
.empty-state { min-height: 440px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; text-align: center; }
.empty-icon { width: 72px; height: 72px; display: grid; place-items: center; margin-bottom: 18px; color: var(--primary); background: var(--primary-soft); border-radius: 24px; }
.empty-state h2 { margin: 0 0 6px; font-size: 19px; }
.empty-state p { margin: 0 0 18px; color: var(--muted); }
.pagination-bar { height: 56px; display: flex; align-items: center; justify-content: flex-end; gap: 18px; padding: 0 18px; color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; }
.pagination-bar div { display: flex; }
.next-button svg { transform: rotate(180deg); }

/* Composer */
.compose-modal { pointer-events: none; }
.compose-modal .modal-dialog { position: fixed; right: 24px; bottom: 0; width: min(620px, calc(100vw - 48px)); max-width: none; height: min(680px, calc(100vh - 28px)); margin: 0; pointer-events: auto; transition: width .2s ease, height .2s ease; }
.compose-modal .modal-content, .user-modal { height: 100%; overflow: hidden; border: 1px solid #c9cdd2; border-radius: 10px 10px 0 0; box-shadow: 0 10px 34px rgba(32,33,36,.28); }
.compose-header { min-height: 44px; padding: 0 8px 0 16px; color: #fff; background: #26344d; border: 0; }
.compose-header h2 { margin: 0; color: #fff; font-size: 13px; font-weight: 700; letter-spacing: 0; }
.compose-window-actions { display: flex; align-items: center; margin-left: auto; }
.compose-window-button { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; color: rgba(255,255,255,.78); background: transparent; border: 0; border-radius: 5px; }
.compose-window-button:hover { color: #fff; background: rgba(255,255,255,.12); }
.compose-modal .modal-body { position: relative; display: flex; flex-direction: column; padding: 0 16px; overflow: hidden; }
.compose-from-line { min-height: 48px; display: flex; align-items: center; gap: 9px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.compose-avatar { width: 32px; height: 32px; border-radius: 50%; font-size: 10px; }
.compose-from-line > div { min-width: 0; }
.compose-from-line strong, .compose-from-line small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose-from-line strong { font-size: 12px; }
.compose-from-line small { color: var(--muted); font-size: 11px; }
.compose-security { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; color: var(--success); font-size: 11px; font-weight: 700; }
.compose-field { min-height: 43px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.compose-field label { flex: 0 0 30px; color: var(--muted); font-size: 12px; font-weight: 500; }
.compose-field input { min-width: 0; flex: 1; height: 41px; padding: 0; color: var(--ink); background: transparent; border: 0; outline: 0; }
.compose-field input::placeholder { color: #8b8f94; }
.recipient-toggles { display: flex; gap: 2px; }
.recipient-toggles button { padding: 5px 4px; color: var(--muted); background: transparent; border: 0; border-radius: 5px; font-size: 11px; }
.recipient-toggles button:hover { color: var(--primary); background: var(--primary-soft); }
.compose-subject-field input { font-weight: 560; }
.compose-editor { min-height: 180px; flex: 1; overflow-y: auto; padding: 16px 2px; color: var(--ink); background: transparent; border: 0; outline: none; font-family: var(--font-reading); font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.compose-editor:empty::before { content: attr(data-placeholder); color: #8b8f94; pointer-events: none; }
.compose-editor:focus { box-shadow: inset 0 -2px 0 rgba(11,87,208,.12); }
.compose-editor blockquote { margin: 8px 0; padding-left: 12px; color: var(--muted); border-left: 3px solid #c7d7f1; }
.compose-editor ul, .compose-editor ol { padding-left: 24px; }
.compose-format-bar { flex: 0 0 auto; display: flex; align-items: center; gap: 2px; min-height: 42px; padding: 4px 2px; border-top: 1px solid var(--line); }
.compose-format-bar[hidden] { display: none; }
.compose-format-bar > span { width: 1px; height: 22px; margin: 0 4px; background: var(--line); }
.compose-format-bar button { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; color: #5f6368; background: transparent; border: 0; border-radius: 7px; font-size: 14px; }
.compose-format-bar button:hover, .compose-format-bar button[aria-pressed="true"] { color: var(--primary); background: var(--primary-soft); }
.format-clear { font-size: 11px; text-decoration: line-through; }
.compose-attachments { max-height: 132px; overflow-y: auto; padding: 9px 0; border-top: 1px solid var(--line); }
.attachment-list { display: flex; flex-wrap: wrap; gap: 7px; }
.compose-attachments > small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.attachment-chip { min-width: 180px; max-width: 265px; display: grid; grid-template-columns: 30px minmax(0,1fr) 28px; align-items: center; padding: 6px 5px; background: #f1f4f8; border: 1px solid #dfe3e8; border-radius: 7px; }
.attachment-file-icon { width: 26px; height: 26px; display: grid; place-items: center; color: var(--primary); background: #e2ebfa; border-radius: 6px; }
.attachment-chip-copy { min-width: 0; }
.attachment-chip-copy strong, .attachment-chip-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip-copy strong { font-size: 12px; }
.attachment-chip-copy small { color: var(--muted); font-size: 10px; }
.attachment-chip button { width: 26px; height: 26px; padding: 0; color: var(--muted); background: transparent; border: 0; border-radius: 50%; font-size: 18px; }
.attachment-chip button:hover { color: var(--danger); background: #fff; }
.compose-dropzone { position: absolute; z-index: 9; inset: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--primary); background: rgba(238,244,255,.96); border: 2px dashed #8ab4f8; border-radius: 12px; }
.compose-dropzone strong { margin-top: 10px; font-size: 15px; }
.compose-dropzone span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.compose-schedule-panel, .compose-link-panel { position: absolute; z-index: 10; right: 16px; bottom: 10px; width: min(390px, calc(100% - 32px)); padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(32,33,36,.22); }
.schedule-panel-heading, .schedule-panel-heading > div, .schedule-panel-actions { display: flex; align-items: center; }
.schedule-panel-heading { justify-content: space-between; margin-bottom: 12px; }
.schedule-panel-heading > div { gap: 10px; }
.schedule-panel-heading > div > span { width: 34px; height: 34px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 9px; }
.schedule-panel-heading strong, .schedule-panel-heading small { display: block; }
.schedule-panel-heading strong { font-size: 13px; }
.schedule-panel-heading small { color: var(--muted); font-size: 11px; }
.schedule-presets { display: grid; gap: 5px; }
.schedule-presets button { min-height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; color: var(--ink-soft); background: #f8fafd; border: 1px solid transparent; border-radius: 9px; font-size: 12px; text-align: left; }
.schedule-presets button:hover, .schedule-presets button.selected { color: var(--primary-dark); background: var(--primary-soft); border-color: #c9daf8; }
.schedule-presets time { color: var(--muted); font-size: 11px; }
.schedule-custom { display: grid; gap: 5px; margin-top: 11px; color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.schedule-custom input { height: 40px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; outline: 0; }
.schedule-custom input:focus { border-color: #8ab4f8; box-shadow: 0 0 0 3px rgba(11,87,208,.1); }
.schedule-panel-actions { justify-content: flex-end; gap: 8px; margin-top: 13px; }
.schedule-panel-actions .btn { min-height: 38px; padding: 7px 12px; font-size: 11px; }
.compose-modal .modal-footer { min-height: 58px; display: flex; justify-content: space-between; flex-wrap: nowrap; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); }
.compose-primary-actions { min-width: 0; display: flex; align-items: center; gap: 4px; }
.send-group .send-button { min-width: 76px; border-radius: 18px 0 0 18px; }
.send-group .send-menu-toggle { width: 32px; min-width: 32px; padding: 0; border-left-color: rgba(255,255,255,.22); border-radius: 0 18px 18px 0; }
.send-options-menu { width: 230px; padding: 6px; border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 12px 34px rgba(32,33,36,.2); }
.send-options-menu .dropdown-item { display: flex; align-items: center; gap: 10px; padding: 9px; border-radius: 7px; }
.send-options-menu .dropdown-item > span, .send-options-menu strong, .send-options-menu small { display: block; }
.send-options-menu strong { font-size: 12px; }
.send-options-menu small { color: var(--muted); font-size: 11px; }
.compose-tool-separator { width: 1px; height: 26px; margin: 0 3px; background: var(--line); }
.compose-tool-button { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; color: #5f6368; background: transparent; border: 0; border-radius: 50%; }
.compose-tool-button:hover { color: var(--primary); background: var(--primary-soft); }
.format-toggle span { font-family: Georgia, serif; font-size: 16px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.format-toggle.active { color: var(--primary); background: var(--primary-soft); }
.compose-draft-state { margin-left: auto; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.compose-draft-state .status-dot { width: 6px; height: 6px; background: var(--success); border-radius: 50%; }
.compose-draft-state small { padding-left: 6px; border-left: 1px solid var(--line); }
.compose-modal.compose-expanded .modal-dialog { right: 50%; bottom: 4vh; width: min(900px, calc(100vw - 64px)); height: 88vh; transform: translateX(50%); }
.compose-modal.compose-minimized .modal-dialog { width: 300px; height: 44px; }
.compose-modal.compose-minimized .modal-body, .compose-modal.compose-minimized .modal-footer { display: none; }
.toolbar-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* Reader */
.reader-card { min-width: 0; max-width: 100%; min-height: calc(100vh - var(--topbar) - 36px); overflow: hidden; background: linear-gradient(180deg, #fff 0, #fbfcff 100%); }
.reader-toolbar { height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: rgba(248,250,253,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.reader-toolbar-start, .reader-actions { display: flex; align-items: center; }
.reader-toolbar-start { min-width: 0; gap: 12px; }
.reader-actions { gap: 4px; }
.reader-back { min-height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px 0 8px; color: var(--ink-soft); border-radius: 10px; font-size: 12px; font-weight: 720; transition: color .15s, background .15s; }
.reader-back:hover, .reader-back:focus-visible { color: var(--primary); background: var(--primary-soft); }
.reader-toolbar-context { padding-left: 14px; color: var(--muted); border-left: 1px solid var(--line-strong); font-size: 12px; font-weight: 650; }
.reader-action-button.is-active { color: #d28a00; background: #fff8df; }
.reader-action-button.is-active svg { fill: currentColor; }
.reader-content { min-width: 0; width: 100%; max-width: none; margin: 0; padding: 24px 30px 64px; }
.reader-title { width: 100%; margin: 0 0 18px; }
.reader-title-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.reader-labels { display: flex; align-items: center; gap: 10px; margin: 0; }
.reader-title h1 { margin: 0; color: #101828; font-size: clamp(24px, 2vw, 31px); font-weight: 735; line-height: 1.2; letter-spacing: -.035em; overflow-wrap: anywhere; }
.category-label { flex: 0 0 auto; padding: 4px 9px; color: var(--primary-dark); background: var(--primary-soft); border-radius: 999px; font-size: 10px; font-weight: 820; letter-spacing: .025em; text-transform: uppercase; }
.message-status { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 680; }
.message-status > span { width: 6px; height: 6px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 3px rgba(21,130,92,.09); }
.message-status.is-warning > span { background: var(--warning); box-shadow: 0 0 0 3px rgba(184,119,21,.10); }
.message-status.is-danger > span { background: var(--danger); box-shadow: 0 0 0 3px rgba(194,63,78,.09); }
.message-surface { width: 100%; overflow: visible; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 1px 2px rgba(22,34,56,.04), 0 10px 28px rgba(22,34,56,.05); }
.sender-card { position: relative; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.sender-details { min-width: 0; }
.sender-identity { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.sender-identity strong { overflow: hidden; color: var(--ink); font-size: 15px; font-weight: 780; text-overflow: ellipsis; white-space: nowrap; }
.sender-identity > span { overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.sender-card time { align-self: start; padding-top: 2px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.message-meta { position: relative; width: fit-content; max-width: 100%; }
.message-meta summary { display: flex; align-items: center; gap: 3px; max-width: 100%; margin-top: 2px; color: var(--muted); cursor: pointer; font-size: 11px; list-style: none; }
.message-meta summary > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-meta summary::-webkit-details-marker { display: none; }
.message-meta summary:hover { color: var(--primary); }
.message-meta[open] summary svg { transform: rotate(180deg); }
.message-meta-panel { position: absolute; z-index: 12; top: calc(100% + 8px); left: -10px; width: min(480px, calc(100vw - 100px)); padding: 14px 16px; color: var(--ink-soft); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md); }
.message-meta-panel dl { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 8px 12px; margin: 0; font-size: 11px; line-height: 1.45; }
.message-meta-panel dt { color: var(--muted); font-weight: 650; }
.message-meta-panel dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.message-meta-panel .message-id { color: var(--muted); }
.email-body { min-width: 0; min-height: 250px; width: 100%; overflow: hidden; padding: 32px 28px 44px; color: #202b3c; font-family: var(--font-reading); font-size: 16px; line-height: 1.72; overflow-wrap: anywhere; contain: layout paint; isolation: isolate; }
.email-body-content { min-width: 0; width: 100%; max-width: 960px; overflow: hidden; margin: 0; }
.email-body-plain { white-space: pre-wrap; }
.email-body-rich { overflow-x: auto; }
.email-body-rich :where(p, div, li, td, th) { max-width: 100% !important; }
.email-body-rich :where(p, blockquote, ul, ol, pre) { margin-top: 0; }
.email-body-rich :where(img) { max-width: 100% !important; height: auto !important; vertical-align: middle; }
.email-body-rich :where(table) { max-width: 100% !important; margin-left: 0 !important; margin-right: auto !important; }
.email-body-rich :where(a) { color: var(--primary); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.email-body-rich :where(blockquote) { margin-left: 0; padding-left: 16px; color: var(--muted); border-left: 3px solid #c7d7f1; }
.email-body-rich .email-signature { margin-top: 28px; }
.message-page .brand { color: var(--ink) !important; }
.message-page .topbar .icon-button { color: var(--ink-soft) !important; }
.message-page .folder-link { color: #3c4043 !important; }
.message-page .folder-link:hover { color: var(--ink) !important; }
.message-page .folder-link.active { color: #001d35 !important; }
.message-page .rail-link { color: #5d687c !important; }
.message-page .rail-link:hover, .message-page .rail-link.active { color: var(--primary) !important; }
.message-page .mobile-bottom-nav a { color: #5f6b80 !important; }
.message-page .mobile-bottom-nav a.active { color: var(--primary) !important; }
.attachments { padding: 20px 28px; border-top: 1px solid var(--line); }
.attachments h2 { display: flex; align-items: center; gap: 7px; margin: 0 0 13px; font-size: 13px; }
.attachments h2 svg { color: var(--muted); }
.attachment-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.attachment-card { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 12px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 11px; }
.attachment-card svg { color: var(--primary); }
.attachment-card div { min-width: 0; }
.attachment-card strong, .attachment-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-card strong { font-size: 12px; }
.attachment-card small, .security-note { color: var(--muted); font-size: 11px; }
.security-note { margin: 12px 0 0; }
.reader-cta { display: flex; align-items: center; min-height: 78px; padding: 16px 28px 17px; background: #fbfcfe; border-top: 1px solid var(--line); border-radius: 0 0 15px 15px; }
.reader-response-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.reader-cta .btn { min-width: 108px; }
.reader-secondary-action { color: #32415a; background: #fff; border: 1px solid #cfd6e2; }
.reader-secondary-action:hover { color: var(--primary); background: var(--primary-soft); border-color: #aac6f2; }

/* Administration */
.admin-page { display: grid; gap: 18px; }
.page-heading { min-height: 94px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 7px 4px 10px; }
.page-heading p { margin: 7px 0 0; color: var(--muted); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat-card { padding: 18px 20px; background: linear-gradient(135deg, #fff, #fafbfe); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow-sm); }
.stat-card span, .stat-card strong, .stat-card small { display: block; }
.stat-card span { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.stat-card strong { margin: 5px 0 1px; font-size: 28px; line-height: 1; letter-spacing: -.04em; }
.stat-card small { color: #788398; font-size: 11px; }
.admin-card { overflow: hidden; }
.admin-card-header { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.admin-card-header h2 { margin: 0; font-size: 16px; letter-spacing: -.025em; }
.admin-card-header p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.table-search { width: min(250px, 35vw); height: 37px; display: flex; align-items: center; gap: 8px; padding: 0 10px; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 10px; }
.table-search input { min-width: 0; width: 100%; padding: 0; background: transparent; border: 0; outline: 0; font-size: 12px; }
.responsive-table { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { padding: 12px 14px; color: #778398; background: var(--surface-soft); border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.admin-table td { padding: 14px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr:hover td { background: #fcfdff; }
.table-user { min-width: 175px; display: flex; align-items: center; gap: 10px; }
.table-user strong, .table-user small { display: block; }
.table-user strong { font-size: 13px; }
.table-user small { max-width: 200px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.mailbox-address { color: var(--ink-soft); white-space: nowrap; }
.role-chip, .status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.role-admin { color: #7544aa; background: #f4eafe; }
.role-user { color: #3e627d; background: #ebf3f8; }
.status-chip { color: var(--success); background: #e8f7f0; }
.status-chip i, .connection-state i, .health-badge i { width: 6px; height: 6px; display: inline-block; background: currentColor; border-radius: 50%; }
.status-disabled { color: #7e8798; background: #eef0f3; }
.table-actions { display: flex; justify-content: flex-end; gap: 2px; }
.table-actions form { margin: 0; }
.mobile-table-label { display: none; }
.user-modal { height: auto; border-radius: 18px; }
.account-form { width: min(620px, calc(100vw - 24px)); border: 1px solid #d7dce5; box-shadow: 0 24px 70px rgba(24,36,58,.22); }
.account-modal-header { align-items: flex-start; padding: 22px 22px 18px; background: linear-gradient(180deg, #f8fbff 0%, #fff 100%); }
.account-modal-title { min-width: 0; display: flex; align-items: flex-start; gap: 13px; }
.account-modal-header > .icon-button { flex: 0 0 40px; margin-left: auto; }
.account-modal-icon { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; color: var(--primary); background: #e7f0fe; border-radius: 12px; }
.account-modal-header .eyebrow { margin-bottom: 2px; }
.account-modal-header h2 { font-size: 22px; letter-spacing: -.035em; }
.account-modal-header p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding: 20px; }
.field { display: grid; align-content: start; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.user-modal .modal-footer { padding: 13px 20px; border-top: 1px solid var(--line); }
.identity-input { height: 48px; display: flex; align-items: center; background: #fff; border: 1px solid var(--line-strong); border-radius: 11px; overflow: hidden; transition: border .15s, box-shadow .15s; }
.identity-input:focus-within { border-color: #8ea3ed; box-shadow: 0 0 0 4px rgba(54,91,217,.10); }
.field .identity-input input { min-width: 80px; height: 46px; flex: 1; padding-right: 4px; border: 0; border-radius: 0; box-shadow: none; }
.identity-input b { max-width: 58%; overflow: hidden; padding: 0 13px 0 3px; color: #667085; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.identity-preview { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 9px 11px; color: var(--primary); background: #f3f7fd; border: 1px solid #dbe6f8; border-radius: 11px; }
.identity-preview > div { min-width: 0; flex: 1; }
.identity-preview span, .identity-preview strong { display: block; }
.identity-preview div span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.identity-preview strong { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.identity-ready { display: inline-flex !important; align-items: center; gap: 4px; color: var(--success); font-size: 10px; font-weight: 750; }
.generated-password { display: grid; grid-template-columns: minmax(0,1fr) auto auto; border: 1px solid var(--line-strong); border-radius: 11px; overflow: hidden; }
.field .generated-password input { height: 48px; border: 0; border-radius: 0; box-shadow: none; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; letter-spacing: .025em; }
.generated-password button { min-width: 68px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 10px; color: var(--ink-soft); background: #f8fafd; border: 0; border-left: 1px solid var(--line); font-size: 11px; font-weight: 750; }
.generated-password button:hover { color: var(--primary); background: var(--primary-soft); }
.generated-password button.copied { color: var(--success); background: #e8f7f0; }
.account-modal-footer { justify-content: space-between; gap: 12px; }
.account-modal-footer > span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.account-modal-footer > div { display: flex; gap: 8px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr); gap: 18px; align-items: start; }
.settings-form { padding-bottom: 20px; }
.settings-form > :not(.admin-card-header) { margin-left: 20px; margin-right: 20px; }
.settings-form .field { margin-top: 15px; }
.service-mark { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; background: #0d0e12; border-radius: 10px; font-weight: 800; }
.settings-status-row { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding: 11px 12px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 10px; font-size: 12px; font-weight: 700; }
.connection-state { display: inline-flex; align-items: center; gap: 6px; color: var(--danger); font-size: 10px; text-transform: uppercase; }
.connection-state.connected { color: var(--success); }
.two-fields { display: grid; grid-template-columns: .85fr 1.15fr; gap: 14px; }
.settings-form hr { margin-top: 22px !important; margin-bottom: 5px; border-color: var(--line); opacity: 1; }
.history-import-form { margin: 16px 20px 0; padding-top: 16px; border-top: 1px solid var(--line); }
.history-import-form .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.history-import-form small { display: block; margin-top: 8px; color: var(--muted); line-height: 1.5; }
.endpoint-box { display: grid; gap: 5px; margin-top: 15px; padding: 12px; background: #17243c; border-radius: 10px; }
.endpoint-box span { color: #aebbd1; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.endpoint-box code { overflow: hidden; color: #edf2ff; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.setup-guide { padding-bottom: 18px; }
.checklist { display: grid; gap: 0; margin: 0; padding: 8px 20px 12px; list-style: none; }
.checklist li { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 13px 0; }
.checklist li:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 42px; bottom: -5px; width: 1px; background: var(--line-strong); }
.checklist i { width: 28px; height: 28px; display: grid; place-items: center; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line-strong); border-radius: 9px; font-style: normal; font-size: 10px; font-weight: 800; }
.checklist .done i { color: #fff; background: var(--success); border-color: var(--success); }
.checklist strong, .checklist span { display: block; }
.checklist strong { margin-bottom: 2px; font-size: 12px; }
.checklist span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.security-callout { display: flex; gap: 10px; margin: 0 18px; padding: 13px; color: #285c4b; background: #eaf7f1; border-radius: 11px; }
.security-callout strong, .security-callout span { display: block; }
.security-callout strong { font-size: 12px; }
.security-callout span { color: #527769; font-size: 11px; }
.health-badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; color: var(--warning); background: #fff5de; border-radius: 999px; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.health-badge.healthy { color: var(--success); background: #e8f7f0; }
.audit-list { display: grid; }
.audit-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; min-height: 58px; padding: 8px 18px; border-bottom: 1px solid var(--line); }
.audit-row:last-child { border-bottom: 0; }
.audit-icon { width: 30px; height: 30px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 9px; }
.audit-row strong, .audit-row small { display: block; }
.audit-row strong { font-size: 12px; text-transform: capitalize; }
.audit-row small, .audit-row time { color: var(--muted); font-size: 11px; }
.empty-inline { padding: 26px; color: var(--muted); text-align: center; }

/* Personal account settings */
.account-settings-page { max-width: 1240px; }
.account-settings-heading { align-items: center; }
.account-profile-chip { min-width: 204px; display: inline-flex; align-items: center; gap: 10px; padding: 9px 13px 9px 9px; color: #fff; background: #17243c; border-radius: 13px; }
.account-profile-avatar { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; color: #17243c; background: #fff; border-radius: 10px; font-size: 12px; font-weight: 850; }
.account-profile-chip > span:last-child { min-width: 0; }
.account-profile-chip strong, .account-profile-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-profile-chip strong { font-size: 12px; }
.account-profile-chip small { margin-top: 1px; color: #bdc9dc; font-size: 10px; }
.account-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.account-settings-card { display: flex; flex-direction: column; }
.settings-card-icon { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 10px; }
.settings-card-icon-secure { color: var(--success); background: #e8f7f0; }
.account-form-body { display: grid; gap: 15px; padding: 18px 20px; }
.account-form-body .field input[readonly] { color: #657086; background: #f5f7fa; border-color: #e4e7eb; cursor: default; }
.account-card-actions { min-height: 69px; display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: auto; padding: 12px 20px; background: #fbfcfe; border-top: 1px solid var(--line); }
.account-card-actions > span { margin-right: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.account-card-actions > span svg { color: var(--success); }
.account-preferences-card { overflow: hidden; }
.preference-list { display: grid; }
.preference-row { min-height: 72px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--line); }
.preference-row:last-child { border-bottom: 0; }
.preference-icon { width: 36px; height: 36px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 10px; }
.preference-row > div { min-width: 0; }
.preference-row strong, .preference-row small { display: block; }
.preference-row strong { font-size: 12px; }
.preference-row small { overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.preference-state { display: inline-flex; align-items: center; gap: 6px; color: var(--success); font-size: 10px; font-weight: 800; text-transform: uppercase; white-space: nowrap; }
.preference-state i { width: 7px; height: 7px; background: currentColor; border-radius: 50%; box-shadow: 0 0 0 3px rgba(21,130,92,.1); }
.account-biometric-card { overflow: hidden; }
.biometric-settings-body { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; }
.biometric-security-copy { min-width: 0; }
.biometric-security-copy strong, .biometric-security-copy small { display: block; }
.biometric-security-copy strong { font-size: 13px; }
.biometric-security-copy small { max-width: 720px; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.biometric-settings-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.biometric-settings-actions form { margin: 0; }
.biometric-settings-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
.notification-preference-button { min-width: 132px; }
.btn.is-loading { position: relative; pointer-events: none; opacity: .76; }
.btn.is-loading::after { content: ""; width: 15px; height: 15px; margin-left: 7px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: control-spin .65s linear infinite; }
@keyframes control-spin { to { transform: rotate(360deg); } }

/* Email signature settings */
.signature-page { max-width: 1240px; }
.signature-heading { align-items: center; }
.signature-user-chip { display: inline-flex; align-items: center; gap: 10px; min-width: 210px; padding: 9px 13px 9px 9px; color: #fff; background: #17243c; border-radius: 13px; font-size: 12px; font-weight: 800; }
.signature-user-avatar { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; color: #17243c; background: #fff; border-radius: 10px; }
.signature-user-copy { min-width: 0; }
.signature-user-chip strong, .signature-user-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signature-user-chip small { margin-top: 1px; color: #bdc9dc; font-size: 10px; font-weight: 550; }
.signature-user-picker { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 12px 14px; background: #eef4fd; border: 1px solid #d4e1f6; border-radius: 12px; }
.signature-user-picker label { color: #52627a; font-size: 11px; font-weight: 760; }
.signature-user-picker select { min-width: 260px; height: 40px; padding: 0 34px 0 11px; background: #fff; border: 1px solid #c9d5e8; border-radius: 9px; font-size: 12px; }
.signature-form { display: grid; gap: 22px; }
.signature-editor-card { overflow: hidden; }
.signature-card-header { align-items: center; }
.signature-enable { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 12px; font-weight: 750; cursor: pointer; }
.signature-enable input { width: 18px; height: 18px; accent-color: var(--primary); }
.signature-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 20px; }
.signature-color-field > div { height: 45px; display: flex; align-items: center; gap: 10px; padding: 5px 10px; background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; }
.signature-color-field input { width: 36px; height: 31px; padding: 0; border: 0; border-radius: 7px; cursor: pointer; }
.signature-color-field code { color: var(--muted); font-size: 11px; }
.signature-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 13px; }
.signature-section-heading h2 { margin: 1px 0 0; font-size: 20px; }
.signature-section-heading > p { max-width: 380px; margin: 0; color: var(--muted); font-size: 11px; text-align: right; }
.signature-template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.signature-template-card { position: relative; min-width: 0; overflow: hidden; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(22,34,56,.03); cursor: pointer; transition: border-color .16s, box-shadow .16s, transform .16s; }
.signature-template-card:hover { border-color: #a9c1ea; box-shadow: 0 9px 25px rgba(22,34,56,.07); transform: translateY(-1px); }
.signature-template-card > input { position: absolute; opacity: 0; pointer-events: none; }
.signature-template-card:has(> input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(11,87,208,.1), 0 9px 25px rgba(22,34,56,.07); }
.signature-template-top { display: flex; align-items: start; justify-content: space-between; gap: 10px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.signature-template-top strong, .signature-template-top small { display: block; }
.signature-template-top strong { color: var(--ink); font-size: 13px; }
.signature-template-top small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.signature-template-top i { width: 29px; height: 29px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 8px; }
.signature-preview { min-height: 142px; display: flex; align-items: center; overflow-x: auto; padding: 18px 4px 10px; color: #1f2937; font-family: Arial, sans-serif; font-size: 12px; }
.signature-selected-mark { position: absolute; right: 12px; bottom: 10px; padding: 3px 7px; color: var(--muted); background: var(--surface-soft); border-radius: 999px; font-size: 9px; font-weight: 820; text-transform: uppercase; }
.signature-template-card:has(> input:checked) .signature-selected-mark { color: var(--primary-dark); background: var(--primary-soft); }
.signature-save-bar { position: sticky; z-index: 20; bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 15px; background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 34px rgba(22,34,56,.12); backdrop-filter: blur(12px); }
.signature-save-bar > div { display: flex; align-items: center; gap: 10px; color: var(--success); }
.signature-save-bar strong, .signature-save-bar small { display: block; }
.signature-save-bar strong { color: var(--ink); font-size: 11px; }
.signature-save-bar small { color: var(--muted); font-size: 10px; }
.signature-save-bar .btn { min-width: 154px; }

/* Feedback and utility */
.toast-region { position: fixed; z-index: 2000; top: 84px; right: 18px; width: min(390px, calc(100vw - 36px)); display: grid; gap: 8px; }
.app-toast { display: flex; align-items: center; gap: 12px; padding: 13px 13px 13px 15px; color: #fff; background: #23324d; border-radius: 12px; box-shadow: var(--shadow-md); font-size: 12px; }
.app-toast span { flex: 1; }
.app-toast button { width: 28px; height: 28px; display: grid; place-items: center; color: inherit; background: rgba(255,255,255,.12); border: 0; border-radius: 8px; }
.app-toast-success { background: #146c50; }
.app-toast-danger { background: #aa3545; }
.app-toast-warning { background: #8b641f; }
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 30px; background: radial-gradient(circle at 50% 0%, #edf1ff, var(--canvas) 55%); }
.error-page main { max-width: 520px; text-align: center; }
.error-page .brand-mark { margin: 0 auto 26px; }
.error-page h1 { margin: 0; font-size: 38px; letter-spacing: -.05em; }
.error-page p:not(.eyebrow) { margin: 12px 0 25px; color: var(--muted); }

@media (max-width: 1100px) {
    :root { --sidebar-width: 205px; }
    .topbar { grid-template-columns: calc(var(--rail) + var(--sidebar-width) - 16px) minmax(240px, 1fr) auto; }
    .message-link { grid-template-columns: minmax(115px, 165px) minmax(200px, 1fr) auto; gap: 12px; }
    .owner-chip { display: none; }
    .settings-grid { grid-template-columns: 1fr; }
    .account-settings-grid { grid-template-columns: 1fr; }
    .signature-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .setup-guide { order: -1; }
    .checklist { grid-template-columns: repeat(4, 1fr); gap: 12px; }
    .checklist li { grid-template-columns: 28px 1fr; }
    .checklist li::after { display: none; }
}

@media (max-width: 860px) {
    :root { --sidebar-width: 0px; }
    .app-shell { grid-template-columns: var(--rail) minmax(0, 1fr); }
    .topbar { grid-template-columns: calc(var(--rail) + 170px) minmax(220px, 1fr) auto; }
    .sidebar { display: none; }
    .app-main { grid-column: 2; }
    .message-link { grid-template-columns: 145px minmax(180px, 1fr) auto; }
    .category-tab { min-width: 120px; }
    .category-tabs { overflow-x: auto; }
    .login-shell { grid-template-columns: minmax(350px, .8fr) minmax(440px, 1.2fr); }
    .login-story { padding: 34px; }
    .story-copy h1 { font-size: 46px; }
    .mail-preview { display: none; }
    .stat-grid { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 720px) {
    :root { --topbar: 62px; }
    body { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
    .mobile-only { display: inline-grid !important; }
    .app-shell { display: block; }
    .topbar { position: sticky; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; height: var(--topbar); padding: 0 10px; }
    .topbar-brand { gap: 2px; }
    .topbar-brand .brand { min-width: 40px; min-height: 40px; justify-content: center; }
    .topbar-brand .brand-name { display: none; }
    .topbar-brand .brand-mark { width: 32px; height: 32px; border-radius: 10px; font-size: 16px; }
    .global-search { height: 40px; padding: 0 11px; border-radius: 12px; }
    .global-search kbd { display: none; }
    .topbar-actions > .account-settings-link, .install-button span { display: none; }
    .install-button { width: 38px; padding: 0; justify-content: center; }
    .nav-rail, .sidebar { display: none; }
    .app-main { padding: 0; }
    .mailbox-card, .reader-card { min-height: calc(100vh - var(--topbar) - 62px); border: 0; border-radius: 0; box-shadow: none; }
    .mailbox-card { --mailbox-right-space: 16px; }
    .mailbox-header { min-height: 68px; padding: 12px 16px; }
    .mailbox-header h1 { font-size: 21px; }
    .mailbox-meta span { display: none; }
    .category-tabs { grid-template-columns: repeat(4, minmax(88px, 1fr)); gap: 4px; padding: 6px; scrollbar-width: none; }
    .category-tabs::-webkit-scrollbar { display: none; }
    .category-tab { height: 42px; min-width: 88px; justify-content: center; padding: 0 10px; font-size: 11px; }
    .category-tab svg { display: none; }
    .category-tab::after { left: 12px; right: 12px; bottom: -7px; }
    .mail-toolbar { height: 46px; padding: 0 var(--mailbox-right-space) 0 8px; }
    .mail-toolbar .toolbar-button, .mail-toolbar .toolbar-page-button, .mail-toolbar .check-control { min-width: 40px; width: 40px; min-height: 40px; height: 40px; }
    .mail-toolbar .toolbar-button span { display: none; }
    .text-action { display: none; }
    .mail-toolbar > button[name="action"][value="read"], .mail-toolbar > button[name="action"][value="unread"] { display: none; }
    .toolbar-divider { display: none; }
    .mail-range { margin-left: auto; font-size: 10px; }
    .message-row { min-height: 78px; grid-template-columns: 28px minmax(0, 1fr); padding: 0 var(--mailbox-right-space) 0 7px; }
    .message-row .row-check { width: 28px; }
    .star-form { display: none; }
    .message-link { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 2px 10px; min-height: 77px; padding: 9px 0 9px 4px; }
    .sender-line { grid-column: 1; grid-row: 1; }
    .sender-line strong { font-size: 13px; }
    .subject-line { grid-column: 1 / -1; grid-row: 2; display: block; padding-right: 4px; }
    .subject-line strong, .subject-line span { display: block; max-width: none; font-size: 12.5px; }
    .subject-line span { margin-top: 1px; }
    .message-tail { grid-column: 2; grid-row: 1; }
    .message-tail .status-pill, .message-tail .attachment-mark { display: none; }
    .message-tail time { min-width: 0; font-size: 11px; }
    .message-row:hover .row-quick-actions, .message-row:focus-within .row-quick-actions { display: none; }
    .message-row:hover .message-tail, .message-row:focus-within .message-tail { visibility: visible; }
    .pagination-bar { justify-content: space-between; }
    .mobile-bottom-nav { position: fixed; z-index: 90; left: 0; right: 0; bottom: 0; height: calc(62px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(4, 1fr); padding-bottom: env(safe-area-inset-bottom); background: rgba(255,255,255,.96); border-top: 1px solid var(--line); backdrop-filter: blur(14px); }
    .mobile-bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #6d788e; font-size: 10px; font-weight: 700; }
    .mobile-bottom-nav a.active { color: var(--primary); }
    .mobile-compose { position: fixed; z-index: 95; right: 17px; bottom: calc(75px + env(safe-area-inset-bottom)); width: 52px; height: 52px; display: grid; place-items: center; color: #fff; background: var(--primary); border: 0; border-radius: 17px; box-shadow: 0 10px 26px rgba(54,91,217,.35); }
    .drawer-backdrop { position: fixed; z-index: 120; inset: 0; display: block; visibility: hidden; opacity: 0; background: rgba(15,24,42,.36); transition: opacity .2s, visibility .2s; }
    .mobile-drawer { position: fixed; z-index: 121; inset: 0 auto 0 0; width: min(310px, 86vw); display: block; padding: 14px; background: #f4f6fa; transform: translateX(-104%); transition: transform .22s ease; box-shadow: 18px 0 45px rgba(12,25,49,.2); }
    .drawer-header { height: 52px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
    .drawer-header .brand { min-height: 44px; }
    .drawer-open .mobile-drawer { transform: translateX(0); }
    .drawer-open .drawer-backdrop { visibility: visible; opacity: 1; }
    .drawer-open { overflow: hidden; }
    .compose-modal .modal-dialog, .compose-modal.compose-expanded .modal-dialog { inset: 0; width: 100%; height: 100dvh; transform: none; }
    .compose-modal .modal-content { border: 0; border-radius: 0; }
    .compose-header { min-height: 52px; padding-left: 14px; }
    .compose-from-line { min-height: 52px; }
    .compose-security { display: none; }
    .compose-modal .modal-body { padding: 0 14px; }
    .compose-window-button[data-compose-minimize], .compose-window-button[data-compose-expand] { display: none; }
    .compose-editor { min-height: 150px; padding: 15px 2px 10px; font-size: 16px; line-height: 1.5; }
    .compose-format-bar { gap: 4px; overflow-x: auto; padding: 5px 0; scrollbar-width: none; }
    .compose-format-bar::-webkit-scrollbar { display: none; }
    .compose-format-bar button { width: 40px; height: 40px; flex: 0 0 40px; }
    .compose-modal .modal-footer { min-height: 64px; justify-content: flex-start; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: #fff; }
    .compose-primary-actions { width: 100%; }
    .compose-draft-state { display: none; }
    .compose-tool-separator { display: none; }
    .compose-tool-button { width: 40px; height: 40px; }
    .compose-schedule-panel, .compose-link-panel { right: 10px; bottom: 8px; width: calc(100% - 20px); max-height: 70vh; overflow-y: auto; }
    .compose-modal.compose-minimized .modal-dialog { inset: auto 8px 0 auto; width: min(300px, calc(100vw - 16px)); height: 52px; }
    .reader-toolbar { position: relative; z-index: 5; top: auto; padding: 0 10px; }
    .reader-back { width: 42px; justify-content: center; padding: 0; }
    .reader-back span, .reader-toolbar-context { display: none; }
    .reader-content { padding: 22px 12px 90px; }
    .reader-title { margin: 0 6px 18px; }
    .reader-title-copy { display: block; }
    .reader-title h1 { font-size: 25px; line-height: 1.2; }
    .reader-labels { margin-top: 9px; }
    .message-surface { border-radius: 14px; box-shadow: 0 5px 20px rgba(22,34,56,.055); }
    .sender-card { grid-template-columns: 42px minmax(0, 1fr); gap: 11px; padding: 16px; }
    .sender-card .avatar-lg { width: 42px; height: 42px; border-radius: 13px; }
    .sender-identity { display: block; }
    .sender-identity > span { display: block; margin-top: -1px; }
    .sender-card time { grid-column: 2; padding: 0; margin-top: -6px; }
    .message-meta-panel { position: fixed; top: auto; right: 12px; bottom: 78px; left: 12px; width: auto; max-height: 48vh; overflow: auto; }
    .email-body { min-height: 220px; padding: 25px 17px 32px; font-size: 16.5px; line-height: 1.72; }
    .attachments { padding: 18px 17px; }
    .reader-cta { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); min-height: 72px; padding: 13px 16px; border-radius: 0 0 14px 14px; box-shadow: 0 -8px 24px rgba(22,34,56,.055); }
    .reader-cta .btn { width: 100%; }
    .reader-response-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
    .reader-response-actions .btn:first-child:nth-last-child(3) { grid-column: 1 / -1; }
    .message-page .mobile-compose { display: none; }
    .reader-actions .toolbar-button span { display: none; }
    .admin-page { padding: 16px 12px 88px; }
    .page-heading { min-height: 78px; align-items: center; padding: 3px 2px 6px; }
    .page-heading h1 { font-size: 22px; }
    .page-heading p { display: none; }
    .account-settings-heading { align-items: flex-start; }
    .account-profile-chip { width: 100%; }
    .account-form-body { padding: 15px; }
    .account-card-actions { align-items: stretch; flex-direction: column; padding: 12px 15px; }
    .account-card-actions > span { margin: 0; }
    .account-card-actions .btn { width: 100%; }
    .preference-row { grid-template-columns: 38px minmax(0, 1fr); padding: 13px 15px; }
    .preference-row > :last-child { grid-column: 2; justify-self: start; }
    .preference-row .btn { min-height: 38px; padding: 7px 12px; }
    .biometric-settings-body { align-items: stretch; flex-direction: column; padding: 16px 15px; }
    .biometric-settings-actions { align-items: stretch; flex-direction: column; }
    .biometric-settings-actions .btn { width: 100%; }
    .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .stat-card { padding: 14px 11px; }
    .stat-card strong { font-size: 23px; }
    .stat-card small { display: none; }
    .admin-card-header { padding: 14px; }
    .table-search { width: 40px; padding: 0 10px; transition: width .2s; }
    .table-search:focus-within { width: 150px; }
    .admin-table thead { display: none; }
    .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
    .admin-table tr { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 14px; border-bottom: 1px solid var(--line); }
    .admin-table td { padding: 0; border: 0; }
    .admin-table td:first-child { grid-column: 1 / -1; padding-right: 80px; }
    .admin-table td:last-child { position: absolute; right: 10px; top: 14px; }
    .mobile-table-label { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; text-transform: uppercase; }
    .mailbox-address { white-space: normal; overflow-wrap: anywhere; }
    .settings-grid { grid-template-columns: 1fr; }
    .signature-heading { align-items: flex-start; }
    .signature-user-chip { width: 100%; }
    .signature-user-picker { align-items: stretch; flex-direction: column; }
    .signature-user-picker select { width: 100%; min-width: 0; }
    .signature-user-picker .btn { width: 100%; }
    .signature-fields { grid-template-columns: 1fr; padding: 15px; }
    .signature-section-heading { display: block; }
    .signature-section-heading > p { margin-top: 4px; text-align: left; }
    .signature-template-grid { grid-template-columns: 1fr; }
    .signature-save-bar { bottom: calc(74px + env(safe-area-inset-bottom)); }
    .signature-save-bar > div { display: none; }
    .signature-save-bar .btn { width: 100%; }
    .two-fields { grid-template-columns: 1fr; }
    .checklist { grid-template-columns: 1fr; }
    .checklist li:not(:last-child)::after { display: block; }
    .settings-form > :not(.admin-card-header) { margin-left: 14px; margin-right: 14px; }
    .audit-row { padding: 9px 13px; }
    .audit-row time { display: none; }
    .toast-region { top: 70px; right: 10px; width: calc(100vw - 20px); }
}

@media (max-width: 620px) {
    .login-page { overflow: auto; }
    .login-shell { display: block; }
    .login-story { display: none; }
    .login-panel { min-height: 100vh; padding: 28px 22px; align-items: start; }
    .login-card { margin-top: max(5vh, 26px); }
    .login-mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 54px; }
    .login-card h2 { font-size: 29px; }
    .login-card > p { margin-bottom: 28px; }
    .form-grid { grid-template-columns: 1fr; }
    .field.full { grid-column: auto; }
    .identity-preview { grid-column: auto; }
    .modal-dialog-centered { align-items: flex-end; min-height: 100%; margin: 0; }
    .modal-dialog-centered .user-modal { max-height: 94vh; overflow-y: auto; border-radius: 19px 19px 0 0; }
    .account-form { width: 100%; }
    .account-modal-header { padding: 18px 16px 14px; }
    .account-modal-icon { width: 36px; height: 36px; border-radius: 11px; }
    .account-modal-header h2 { font-size: 20px; }
    .account-modal-footer { position: sticky; bottom: 0; flex-direction: column; align-items: stretch; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)) !important; background: #fff; }
    .account-modal-footer > span { display: none; }
    .account-modal-footer > div { display: grid; grid-template-columns: .8fr 1.2fr; }
    .generated-password { grid-template-columns: minmax(0,1fr) 46px 46px; }
    .generated-password button { min-width: 46px; padding: 0; }
    .generated-password button span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}

@media (hover: hover) {
    .mailbox-card, .reader-card, .admin-card, .stat-card { transition: border-color .18s ease, box-shadow .18s ease; }
    .admin-card:hover, .stat-card:hover { border-color: #d4dce8; box-shadow: 0 8px 24px rgba(24, 36, 58, .07); }
}

@media (prefers-contrast: more) {
    :root { --line: #c7ceda; --line-strong: #9ca7b8; --muted: #566276; }
}
