:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #172033;
  --muted: #6b7890;
  --line: #e6ebf2;
  --primary: #3578f6;
  --primary-2: #eaf2ff;
  --danger: #e45555;
  --shadow: 0 12px 36px rgba(26, 44, 80, .08);
}

[data-theme="dark"] {
  --bg: #101522;
  --surface: #171e2d;
  --surface-2: #1d2637;
  --text: #edf2fc;
  --muted: #9aa8bf;
  --line: #29354a;
  --primary-2: #1d3153;
  --shadow: 0 12px 36px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif; font-size: 14px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 236px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 19px; font-weight: 750; padding: 0 10px 24px; }
.brand-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; color: white; font-weight: 800; font-size: 25px; background: linear-gradient(140deg, #377ef6, #695cf6); box-shadow: 0 10px 24px rgba(55, 126, 246, .25); }
.brand-mark.small { width: 35px; height: 35px; border-radius: 11px; font-size: 17px; }
nav { display: grid; gap: 5px; }
.nav-item, .group-item, .ghost { width: 100%; border: 0; background: transparent; color: var(--muted); border-radius: 9px; padding: 10px 12px; text-align: left; display: flex; align-items: center; gap: 10px; }
.nav-label, .ghost-label { font-style: normal; }
.nav-item:hover, .group-item:hover, .ghost:hover, .nav-item.active, .group-item.active { color: var(--primary); background: var(--primary-2); }
.sidebar-heading { margin: 24px 10px 8px; display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.sidebar-heading button { border: 0; background: none; color: var(--muted); font-size: 18px; }
.group-list { overflow: auto; display: grid; gap: 3px; }
.group-item { justify-content: space-between; padding: 3px 5px; display: flex; gap: 3px; }
.group-item .group-select { min-width: 0; flex: 1; border: 0; background: transparent; color: inherit; display: flex; align-items: center; justify-content: space-between; padding: 7px; text-align: left; }
.group-item .group-delete { border: 0; background: transparent; color: var(--muted); border-radius: 6px; padding: 0 6px; opacity: 0; }
.group-item:hover .group-delete { opacity: 1; }.group-item .group-delete:hover { color: var(--danger); background: #fff0f0; }
.group-item .group-main { display: flex; align-items: center; gap: 9px; min-width: 0; }
.group-item .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.group-item .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-item .count { font-size: 12px; opacity: .75; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 3px; border-top: 1px solid var(--line); padding-top: 12px; }

.main { min-width: 0; padding: 32px clamp(20px, 4vw, 54px) 50px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; }
h1, h2, h3, p { margin-top: 0; }
.topbar h1 { margin-bottom: 6px; font-size: 26px; }
.topbar p, .panel-heading p { color: var(--muted); margin-bottom: 0; }
.btn { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 9px; padding: 9px 13px; transition: .15s ease; }
.btn:hover { transform: translateY(-1px); border-color: #b9c8de; }
.btn.primary { color: white; border-color: var(--primary); background: var(--primary); box-shadow: 0 7px 18px rgba(53, 120, 246, .2); }
.btn.danger { color: var(--danger); }
.btn.wide { width: 100%; padding: 11px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stats-grid article { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 17px; display: flex; gap: 14px; align-items: center; box-shadow: 0 4px 15px rgba(30, 55, 90, .025); }
.stat-icon { width: 41px; height: 41px; display: grid; place-items: center; border-radius: 11px; font-weight: 800; }
.stat-icon.blue { background: #eaf2ff; color: #3679ed; }.stat-icon.green { background: #e9f8f0; color: #2ca56c; }.stat-icon.red { background: #fff0f0; color: #e35f5f; }.stat-icon.violet { background: #f1edff; color: #7657e8; }
.stats-grid span { color: var(--muted); font-size: 12px; display: block; margin-bottom: 3px; }
.stats-grid strong { font-size: 23px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 15px; }
.panel-heading h2 { margin-bottom: 5px; font-size: 17px; }
.search-wrap { border: 1px solid var(--line); background: var(--surface-2); border-radius: 9px; display: flex; gap: 7px; align-items: center; padding: 0 10px; min-width: 260px; }
.search-wrap input, .mail-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); padding: 9px 0; }
.toolbar { min-height: 55px; padding: 9px 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar select { border: 1px solid var(--line); color: var(--text); background: var(--surface); border-radius: 8px; padding: 9px; }
.selection-label { margin-left: auto; color: var(--muted); font-size: 12px; }
.table-wrap { overflow: auto; min-height: 260px; }
table { width: 100%; border-collapse: collapse; min-width: 850px; }
th { padding: 11px 15px; text-align: left; color: var(--muted); font-size: 11px; letter-spacing: .03em; font-weight: 700; background: var(--surface-2); }
td { padding: 13px 15px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: color-mix(in srgb, var(--primary-2) 40%, transparent); }
.email-cell strong { display: block; font-size: 13px; }.email-cell small { color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 8px; background: var(--surface-2); color: var(--muted); font-size: 11px; }
.tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #9aa8ba; }
.tag.valid { color: #218a58; background: #eaf8f1; }.tag.valid::before { background: #32b775; }
.tag.invalid, .tag.mismatch, .tag.error { color: #c84949; background: #fff0f0; }.tag.invalid::before, .tag.mismatch::before, .tag.error::before { background: #e55c5c; }
.actions { display: flex; gap: 6px; }.actions button { border: 0; background: var(--primary-2); color: var(--primary); padding: 6px 9px; border-radius: 7px; }
.empty-state { text-align: center; color: var(--muted); padding: 60px 20px; }.empty-state div { font-size: 36px; opacity: .45; }.empty-state h3 { color: var(--text); margin: 12px 0 5px; }
.pagination { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding: 13px 22px; color: var(--muted); }
.pagination > div { display: flex; align-items: center; gap: 10px; }.page-btn { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 7px; width: 31px; height: 31px; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 25px; background: radial-gradient(circle at top left, #e9f2ff, transparent 40%), var(--bg); }
.login-card { width: min(390px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 34px; text-align: center; }
.login-card .brand-mark { margin: 0 auto 18px; }.login-card h1 { margin-bottom: 7px; }.login-card p { color: var(--muted); margin-bottom: 25px; }.login-card label, .modal label { text-align: left; display: grid; gap: 7px; color: var(--muted); }
.login-card input, .modal input:not([type="checkbox"]):not([type="color"]), .modal select, .modal textarea { width: 100%; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 9px; padding: 11px; outline: 0; }
.login-card label { margin-bottom: 15px; }.form-error { color: var(--danger); min-height: 18px; margin-top: 9px; font-size: 12px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(6, 12, 24, .54); backdrop-filter: blur(4px); z-index: 50; }
.modal { position: fixed; z-index: 51; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(660px, calc(100vw - 30px)); max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 26px 70px rgba(0, 0, 0, .24); }
.small-modal { width: min(430px, calc(100vw - 30px)); }.modal header, .modal footer { padding: 18px 21px; display: flex; justify-content: space-between; align-items: center; }.modal header { border-bottom: 1px solid var(--line); }.modal footer { border-top: 1px solid var(--line); justify-content: flex-end; gap: 8px; }.modal header h2 { margin-bottom: 4px; }.modal header p { color: var(--muted); margin: 0; }.modal-close, #mailClose { border: 0; background: none; color: var(--muted); font-size: 25px; }.modal-body { padding: 20px 21px; display: grid; gap: 15px; }.format-box { background: var(--primary-2); color: var(--primary); border-radius: 10px; padding: 12px; }.format-box p { color: var(--muted); font-size: 12px; margin: 7px 0 0; }.modal textarea { resize: vertical; min-height: 190px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }.file-row { display: flex; align-items: center; gap: 12px; color: var(--muted); }.file-button input { display: none; }.check-label { display: flex !important; grid-template-columns: auto 1fr; align-items: center; }.check-label input { width: auto; }

.mail-modal { position: fixed; z-index: 51; inset: 3vh 2.5vw; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 26px 70px rgba(0, 0, 0, .3); overflow: hidden; display: grid; grid-template-rows: auto auto 1fr; }
.mail-modal header { padding: 15px 20px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }.mail-modal header h2 { margin-bottom: 3px; }.mail-modal header p { color: var(--muted); margin: 0; }
.mail-tabs { display: flex; align-items: center; gap: 5px; padding: 9px 14px; border-bottom: 1px solid var(--line); }.mail-tabs > button:not(.btn) { border: 0; background: none; color: var(--muted); padding: 8px 11px; border-radius: 7px; }.mail-tabs > button.active { background: var(--primary-2); color: var(--primary); }.mail-search { margin-left: auto; width: min(300px, 30vw); border: 1px solid var(--line); border-radius: 8px; padding: 0 9px; }
.mail-layout { min-height: 0; display: grid; grid-template-columns: 360px 1fr; }.message-list { border-right: 1px solid var(--line); overflow: auto; }.message-card { width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); color: var(--text); background: var(--surface); padding: 14px 16px; }.message-card:hover, .message-card.active { background: var(--primary-2); }.message-card .sender { display: flex; justify-content: space-between; gap: 9px; font-size: 12px; }.message-card time { color: var(--muted); white-space: nowrap; }.message-card h3 { margin: 7px 0 5px; font-size: 13px; }.message-card p { color: var(--muted); font-size: 11px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.code-pill { display: inline-flex; margin-top: 8px; color: #7856df; background: #efeaff; border-radius: 6px; padding: 4px 7px; font-weight: 750; letter-spacing: .08em; }
.message-detail { overflow: auto; padding: 23px; }.message-detail h2 { margin-bottom: 10px; }.message-meta { display: grid; gap: 5px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); padding-bottom: 15px; margin-bottom: 18px; }.message-code { display: flex; justify-content: space-between; align-items: center; background: #f2eeff; color: #6c4bd6; border-radius: 9px; padding: 11px 13px; margin-bottom: 16px; font-size: 18px; font-weight: 800; letter-spacing: .1em; }.mail-frame { width: 100%; min-height: 55vh; border: 0; background: white; }.empty-mail { height: 100%; display: grid; place-items: center; color: var(--muted); }
.loading { padding: 35px; text-align: center; color: var(--muted); }

.toast-area { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: grid; gap: 8px; }.toast { min-width: 260px; max-width: 420px; padding: 12px 15px; border-radius: 10px; background: #172033; color: white; box-shadow: var(--shadow); animation: toast-in .2s ease; }.toast.error { background: #b84444; }.toast.success { background: #217e56; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

/* Visual refresh */
:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --text: #172033;
  --muted: #728097;
  --line: #e5eaf2;
  --primary: #4f6cf7;
  --primary-2: #eef1ff;
  --danger: #e15367;
  --shadow: 0 18px 50px rgba(28, 43, 75, .08);
}
[data-theme="dark"] {
  --bg: #0e1421;
  --surface: #171f2e;
  --surface-2: #1c2636;
  --text: #edf2fc;
  --muted: #9aa8bf;
  --line: #2a3548;
  --primary: #7188ff;
  --primary-2: #222f50;
  --danger: #ff7888;
  --shadow: 0 18px 50px rgba(0, 0, 0, .25);
}

body { background-image: radial-gradient(circle at 94% 4%, rgba(79, 108, 247, .07), transparent 24%); }
button, input, textarea, select { accent-color: var(--primary); }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 24%, transparent); outline-offset: 2px; }

.app-shell { grid-template-columns: 248px 1fr; }
.sidebar { background: linear-gradient(180deg, #151d35 0%, #11182c 100%); border-right: 0; color: #f4f7ff; padding: 24px 15px; box-shadow: 8px 0 30px rgba(17, 24, 44, .06); }
.brand { color: white; letter-spacing: -.02em; }
.brand-mark { background: linear-gradient(140deg, #647ef8, #8a5cf6); box-shadow: 0 12px 30px rgba(91, 112, 247, .36); }
.nav-item, .group-item, .ghost { color: #97a3bd; }
.nav-item:hover, .group-item:hover, .ghost:hover, .nav-item.active, .group-item.active { color: #fff; background: rgba(109, 129, 246, .15); }
.nav-item.active { box-shadow: inset 3px 0 #7188ff; }
.sidebar-heading { color: #66738e; }
.sidebar-heading button { color: #8f9bb4; }
.sidebar-bottom { border-color: rgba(255, 255, 255, .08); }
.group-item .group-delete:hover { color: #ff9ba8; background: rgba(225, 83, 103, .12); }

.main { max-width: 1700px; width: 100%; margin: 0 auto; padding-top: 38px; }
.topbar { margin-bottom: 30px; }
.topbar-copy { position: relative; }
.eyebrow { display: block; margin-bottom: 7px; color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.topbar h1 { margin-bottom: 7px; font-size: clamp(27px, 3vw, 34px); line-height: 1.1; letter-spacing: -.035em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.mobile-actions { display: none; align-items: center; gap: 6px; }
.security-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--line); border-radius: 999px; padding: 8px 11px; font-size: 12px; }
.security-badge i { width: 7px; height: 7px; border-radius: 50%; background: #31b878; box-shadow: 0 0 0 4px rgba(49, 184, 120, .12); }
.btn { border-radius: 10px; font-weight: 650; }
.btn.primary { background: linear-gradient(135deg, #5875fa, #765cf2); border-color: transparent; box-shadow: 0 10px 24px rgba(79, 108, 247, .24); }

.stats-grid { gap: 18px; margin-bottom: 22px; }
.stats-grid .stat-card { position: relative; min-height: 114px; padding: 20px; gap: 16px; border-radius: 18px; overflow: hidden; box-shadow: 0 10px 30px rgba(31, 45, 78, .05); transition: transform .18s ease, box-shadow .18s ease; }
.stats-grid .stat-card::after { content: ''; position: absolute; width: 90px; height: 90px; right: -35px; top: -38px; border-radius: 50%; background: currentColor; opacity: .045; }
.stats-grid .stat-card:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(31, 45, 78, .09); }
.stat-icon { width: 48px; height: 48px; border-radius: 14px; font-size: 17px; }
.stat-copy { display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 8px; }
.stat-copy > span { grid-column: 1 / -1; font-size: 12px; font-weight: 650; }
.stat-copy strong { font-size: 29px; letter-spacing: -.04em; }
.stat-copy small { color: var(--muted); font-size: 10px; }

.panel { border-radius: 18px; box-shadow: var(--shadow); }
.panel-heading { padding: 23px 24px 18px; }
.panel-heading h2 { font-size: 18px; letter-spacing: -.02em; }
.live-dot { display: inline-flex; vertical-align: 2px; margin-left: 5px; border-radius: 999px; padding: 3px 6px; color: #209463; background: #e8f8f0; font-size: 8px; letter-spacing: .08em; }
.search-wrap { min-width: 285px; border-radius: 11px; transition: border-color .15s ease, box-shadow .15s ease; }
.search-wrap:focus-within, .mail-search:focus-within { border-color: color-mix(in srgb, var(--primary) 55%, var(--line)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 9%, transparent); }
.toolbar { padding: 11px 24px; background: color-mix(in srgb, var(--surface-2) 54%, var(--surface)); }
.table-wrap { min-height: 320px; }
table { min-width: 1040px; }
th { position: sticky; top: 0; z-index: 1; padding: 12px 16px; background: var(--surface-2); text-transform: uppercase; letter-spacing: .06em; }
td { padding: 14px 16px; }
.email-cell strong { font-size: 13px; margin-bottom: 3px; }
.email-cell small { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.actions { white-space: nowrap; }
.actions button { background: transparent; color: var(--muted); font-size: 11px; transition: color .15s, background .15s; }
.actions button:hover { color: var(--primary); background: var(--primary-2); }
.actions .action-primary { color: var(--primary); background: var(--primary-2); font-weight: 700; }
.actions .action-danger:hover { color: var(--danger); background: #fff0f3; }

.mail-modal { inset: 2.5vh 2vw; border-radius: 20px; grid-template-rows: auto auto 1fr; box-shadow: 0 32px 90px rgba(8, 18, 40, .34); }
.mail-modal header { align-items: center; padding: 17px 22px; background: linear-gradient(90deg, color-mix(in srgb, var(--primary-2) 62%, var(--surface)), var(--surface) 45%); }
.mail-back { display: none; place-items: center; flex: none; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: var(--surface); }
.mail-head-copy { min-width: 0; }
.mail-account-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mail-account-row p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync-status { display: inline-flex; align-items: center; gap: 5px; flex: none; color: var(--muted); background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; font-size: 10px; }
.sync-status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #31b878; }
.mail-tabs { gap: 7px; padding: 10px 16px; background: var(--surface); overflow-x: auto; }
.mail-tabs > button:not(.btn) { white-space: nowrap; font-weight: 650; }
.message-summary { color: var(--muted); white-space: nowrap; font-size: 11px; }
.mail-search { display: flex; align-items: center; gap: 6px; min-width: 170px; }
.mail-search > span { color: var(--muted); }
.switch-control { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; white-space: nowrap; color: var(--muted); font-size: 11px; user-select: none; }
.switch-control input { position: absolute; opacity: 0; pointer-events: none; }
.switch-control em { font-style: normal; }
.switch { position: relative; width: 31px; height: 18px; border-radius: 999px; background: #c8d0dd; transition: background .18s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(15, 23, 42, .22); transition: transform .18s; }
.switch-control input:checked + .switch { background: var(--primary); }
.switch-control input:checked + .switch::after { transform: translateX(13px); }
.refresh-btn span { display: inline-block; font-size: 16px; line-height: 0; }
.refresh-btn.spinning span { animation: spin .8s linear infinite; }
.mail-layout { grid-template-columns: minmax(330px, 390px) 1fr; background: var(--surface-2); }
.message-list { background: var(--surface); }
.message-card { position: relative; padding: 17px 18px; transition: background .15s; }
.message-card.active::before { content: ''; position: absolute; left: 0; top: 15px; bottom: 15px; width: 3px; border-radius: 0 4px 4px 0; background: var(--primary); }
.message-card .sender strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-card h3 { margin-top: 9px; font-size: 13px; }
.code-pill { gap: 8px; align-items: center; background: linear-gradient(135deg, #eeeaff, #f5f1ff); border: 1px solid #dfd6ff; padding: 5px 8px; }
.code-pill i { font-size: 9px; font-style: normal; font-weight: 600; letter-spacing: 0; opacity: .65; }
.message-detail { margin: 14px; padding: 26px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 8px 24px rgba(25, 38, 68, .04); }
.message-detail h2 { font-size: 21px; line-height: 1.35; }
.message-code { background: linear-gradient(135deg, #f0edff, #f8f5ff); border: 1px solid #e2dbff; border-radius: 12px; padding: 14px 16px; }
.loading { display: grid; place-items: center; gap: 12px; min-height: 180px; }
.loading small { max-width: 340px; line-height: 1.6; }
.loading-spinner { width: 25px; height: 25px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
.error-state { color: var(--danger); }

@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

@media (max-width: 1100px) { .app-shell { grid-template-columns: 82px 1fr; }.sidebar { padding: 20px 10px; }.brand > span, .nav-label, .ghost-label, .sidebar-heading > span, .group-item .name, .group-item .count { display: none; }.brand { padding: 0 13px 23px; }.nav-item, .ghost { justify-content: center; }.sidebar-heading { justify-content: center; }.group-item { justify-content: center; }.stats-grid { grid-template-columns: repeat(2, 1fr); }.mail-layout { grid-template-columns: 320px 1fr; }.switch-control em { display: none; } }
@media (max-width: 700px) {
  .app-shell { display: block; }.sidebar { display: none; }.main { padding: 22px 12px 35px; }.topbar { align-items: flex-start; gap: 16px; }.topbar-actions { align-items: flex-end; flex-direction: column-reverse; }.mobile-actions { display: flex; }.security-badge { display: none; }.topbar h1 { font-size: 27px; }.stats-grid { gap: 9px; }.stats-grid .stat-card { min-height: 96px; padding: 13px; gap: 10px; }.stat-icon { width: 40px; height: 40px; }.stat-copy strong { font-size: 24px; }.stat-copy small { display: none; }.panel-heading { align-items: stretch; gap: 13px; flex-direction: column; }.search-wrap { min-width: 0; }.toolbar { padding: 9px 13px; }.selection-label { width: 100%; margin-left: 0; }.mail-modal { inset: 0; border-radius: 0; }.mail-modal header { padding: 13px 15px; }.mail-modal.detail-open .mail-back { display: grid; }.mail-account-row { display: grid; gap: 4px; }.sync-status { width: fit-content; }.mail-tabs { padding: 8px 10px; }.message-summary { display: none; }.mail-layout { grid-template-columns: 1fr; }.message-detail { display: none; margin: 0; border: 0; border-radius: 0; }.mail-layout.detail-open .message-list { display: none; }.mail-layout.detail-open .message-detail { display: block; }.mail-search { display: none; }
}

[data-theme="dark"] .stat-icon.blue, [data-theme="dark"] .stat-icon.violet, [data-theme="dark"] .code-pill, [data-theme="dark"] .message-code { background: #292b55; color: #b4a9ff; border-color: #414479; }
[data-theme="dark"] .stat-icon.green, [data-theme="dark"] .tag.valid, [data-theme="dark"] .live-dot { background: #173b32; color: #72d3aa; }
[data-theme="dark"] .stat-icon.red, [data-theme="dark"] .tag.invalid, [data-theme="dark"] .tag.mismatch, [data-theme="dark"] .tag.error { background: #46272f; color: #ff9caa; }
[data-theme="dark"] .actions .action-danger:hover { background: #46272f; }
