:root {
  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-alt: #f7f8f7;
  --sidebar: #171b1a;
  --sidebar-soft: #242927;
  --text: #18201d;
  --muted: #64706b;
  --line: #dce2df;
  --line-dark: #cbd3cf;
  --green: #147d5a;
  --green-dark: #0c6849;
  --green-soft: #e5f4ee;
  --red: #bc3030;
  --red-soft: #fbeaea;
  --amber: #a96912;
  --amber-soft: #fff2db;
  --focus: #178a64;
  --shadow: 0 1px 2px rgba(16, 24, 20, 0.06), 0 6px 20px rgba(16, 24, 20, 0.04);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(23, 138, 100, .23); outline-offset: 2px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--sidebar); color: #f4f7f5; padding: 18px 14px; display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; gap: 11px; min-height: 48px; padding: 5px 8px 18px; border-bottom: 1px solid rgba(255,255,255,.09); }
.brand-mark { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; background: #e6f2ed; color: #125f46; font-family: Georgia, serif; font-weight: 700; font-size: 20px; border-radius: 5px; }
.brand-mark.large { width: 42px; height: 42px; flex-basis: 42px; font-size: 25px; }
.brand strong, .login-brand strong { display: block; font-family: Georgia, "Noto Serif SC", serif; font-size: 16px; line-height: 1.2; }
.brand small, .login-brand small { display: block; color: #9caaa4; font-size: 11px; margin-top: 3px; }
.primary-nav { margin-top: 18px; display: flex; flex-direction: column; gap: 4px; }
.primary-nav a { display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 8px 10px; color: #b9c3bf; border-radius: 5px; font-weight: 550; white-space: nowrap; }
.primary-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.primary-nav a.active { background: #2a332f; color: #fff; box-shadow: inset 3px 0 0 #4ac494; }
.nav-icon { width: 20px; height: 20px; display: grid; place-items: center; font-size: 17px; color: #9aa8a2; }
.primary-nav a.active .nav-icon { color: #63d4a7; }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.09); padding: 16px 7px 0; }
.admin-chip { display: flex; align-items: center; gap: 9px; min-width: 0; }
.admin-chip strong { display: block; font-size: 13px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.admin-chip small { display: block; color: #93a09a; font-size: 11px; }
.avatar, .mail-avatar { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; display: grid; place-items: center; background: #dbe9e3; color: #245845; font-weight: 700; }
.mail-avatar { background: #e3ece8; color: #28624d; }
.mail-avatar.large { width: 42px; height: 42px; flex-basis: 42px; font-size: 16px; }
.mail-avatar.small { width: 26px; height: 26px; flex-basis: 26px; font-size: 11px; }
.account-actions { margin-top: 10px; display: flex; align-items: center; gap: 12px; font-size: 11px; color: #98a49f; }
.account-actions a:hover, .link-button:hover { color: #fff; }
.link-button { border: 0; padding: 0; background: transparent; color: inherit; cursor: pointer; }

.main-content { min-width: 0; padding: 30px 34px 50px; }
.page-header { min-height: 58px; margin-bottom: 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.page-header h1 { margin: 3px 0 0; font-family: Georgia, "Noto Serif SC", serif; font-size: 27px; line-height: 1.2; font-weight: 650; }
.eyebrow { color: var(--green); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.breadcrumb { color: var(--green); font-size: 12px; font-weight: 650; }
.breadcrumb::before { content: "← "; }
.page-actions { display: flex; align-items: center; gap: 8px; }

.button { appearance: none; min-height: 36px; padding: 8px 13px; border: 1px solid transparent; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; font-weight: 650; line-height: 1.2; white-space: nowrap; }
.button.primary { background: var(--green); color: #fff; border-color: var(--green); }
.button.primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.button.secondary { background: #fff; color: var(--text); border-color: var(--line-dark); }
.button.secondary:hover, .button.ghost:hover { background: var(--surface-alt); border-color: #b8c4be; }
.button.ghost { background: transparent; color: #48544f; border-color: transparent; }
.button.danger { background: var(--red); color: #fff; border-color: var(--red); }
.button.danger-ghost { background: transparent; color: var(--red); border-color: transparent; }
.button.danger-ghost:hover { background: var(--red-soft); }
.button.small { min-height: 30px; padding: 5px 8px; font-size: 12px; }
.button.full { width: 100%; }
.button:disabled { opacity: .5; cursor: not-allowed; }

.flash-stack { display: grid; gap: 8px; margin: -6px 0 18px; }
.flash { padding: 11px 13px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 4px; background: #fff; box-shadow: var(--shadow); }
.flash.success { border-left-color: var(--green); color: #145c44; }
.flash.error { border-left-color: var(--red); color: #8e2525; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric { min-height: 124px; padding: 18px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.metric > span { color: var(--muted); font-size: 12px; font-weight: 650; }
.metric strong { margin-top: 7px; font-family: Georgia, serif; font-size: 31px; line-height: 1; }
.metric small { margin-top: auto; color: var(--muted); font-size: 11px; }
.dashboard-grid, .system-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(270px, 1fr); gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.panel.flush { padding: 0; overflow: hidden; }
.span-2 { grid-column: span 1; }
.section-heading { min-height: 42px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.section-heading.padded { margin: 0; padding: 18px; }
.section-heading h2, .form-section h2 { margin: 0; font-size: 15px; line-height: 1.3; }
.section-heading p, .form-section p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.section-heading a { color: var(--green); font-size: 12px; font-weight: 650; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--muted); background: #fafbfa; font-size: 10px; text-transform: uppercase; font-weight: 750; white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid #e8ecea; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfcfb; }
.data-table th, .data-table td { padding-left: 16px; padding-right: 16px; }
.align-right { text-align: right; }
.nowrap { white-space: nowrap; }
.empty-cell { height: 100px; text-align: center; color: var(--muted); }
.table-link { color: var(--green); font-size: 12px; font-weight: 650; }
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.badge.success { background: var(--green-soft); color: #126346; }
.badge.neutral { background: #ecefed; color: #5e6964; }
.badge.outline { border: 1px solid var(--line); color: var(--muted); background: #fff; }
.status-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #94a09b; }
.status-dot.online { background: #21a673; box-shadow: 0 0 0 3px rgba(33,166,115,.12); }
.status-dot.offline { background: #c94747; box-shadow: 0 0 0 3px rgba(201,71,71,.1); }

.health-list { display: grid; gap: 2px; }
.health-list > div { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #edf0ee; }
.health-list > div:last-child { border-bottom: 0; }
.health-list span { display: flex; align-items: center; gap: 9px; color: #44504b; }
.health-list strong { font-size: 11px; color: var(--muted); }
.health-list.large > div { min-height: 48px; }
.disk-meter { margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); }
.disk-meter > div:first-child, .storage-legend { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; color: var(--muted); }
.disk-meter strong, .storage-legend strong { color: var(--text); }
.meter-progress { width: 100%; height: 5px; margin-top: 9px; display: block; overflow: hidden; appearance: none; border: 0; border-radius: 3px; background: #e5e9e7; }
.meter-progress::-webkit-progress-bar { background: #e5e9e7; }
.meter-progress::-webkit-progress-value { background: var(--green); border-radius: 3px; }
.meter-progress::-moz-progress-bar { background: var(--green); border-radius: 3px; }
.meter-progress.large { height: 8px; margin: 22px 0 12px; }
.activity-list { display: grid; }
.activity-list > div { min-height: 49px; display: grid; grid-template-columns: 10px minmax(0,1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid #edf0ee; }
.activity-list > div:last-child { border-bottom: 0; }
.activity-mark { width: 7px; height: 7px; border: 2px solid #4caf84; border-radius: 50%; }
.activity-list strong { display: block; font-size: 12px; }
.activity-list p { margin: 1px 0 0; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-list time { color: var(--muted); font-size: 10px; white-space: nowrap; }
.queue-compact { display: grid; }
.queue-compact > div { min-height: 45px; display: grid; grid-template-columns: minmax(0,1fr) auto; border-bottom: 1px solid var(--line); align-items: center; }
.queue-compact strong { font-size: 11px; }
.queue-compact span { grid-column: 1; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; }
.queue-compact small { grid-row: 1 / span 2; grid-column: 2; color: var(--muted); }

.toolbar-band { min-height: 60px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.search-form { display: flex; align-items: center; gap: 8px; }
.search-box { width: min(360px, 50vw); height: 36px; display: flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--line-dark); border-radius: 5px; background: #fff; color: var(--muted); }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); }
.search-box.compact { width: 230px; height: 32px; }
.result-count { color: var(--muted); font-size: 12px; }
.identity-cell, .target-identity { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.identity-cell strong, .target-identity strong { display: block; }
.identity-cell small, .target-identity small { display: block; color: var(--muted); font-size: 10px; }
.row-actions { display: flex; align-items: center; gap: 2px; min-width: max-content; }

.form-layout { display: grid; grid-template-columns: minmax(0, 720px) minmax(200px, 280px); gap: 16px; align-items: start; }
.form-panel { display: grid; gap: 18px; padding: 24px; }
.form-panel.narrow { max-width: 600px; }
.form-section { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
label { display: grid; gap: 6px; color: #3f4a45; font-size: 12px; font-weight: 650; }
label small { color: var(--muted); font-size: 10px; font-weight: 400; }
input { width: 100%; height: 39px; padding: 8px 10px; border: 1px solid var(--line-dark); border-radius: 5px; background: #fff; color: var(--text); }
input:hover { border-color: #aebbb5; }
input:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(23,138,100,.1); outline: 0; }
.form-grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; }
.context-panel { padding: 18px; border-left: 3px solid #61b691; background: #eef6f2; border-radius: 3px; }
.context-panel h3 { margin: 0 0 12px; font-size: 12px; }
.domain-row { display: flex; align-items: center; gap: 9px; min-height: 34px; font-size: 12px; }
.danger-panel { border-color: #e8b7b7; }
.danger-heading { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid #f0d3d3; }
.danger-heading > span { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 50%; background: var(--red-soft); color: var(--red); font-size: 19px; font-weight: 800; }
.danger-heading h2 { margin: 0; font-size: 16px; }
.danger-heading p { margin: 4px 0 0; color: var(--muted); }
.dependency-box { padding: 13px; display: grid; gap: 5px; border: 1px solid #e9bebe; background: var(--red-soft); border-radius: 5px; color: #832b2b; }
.dependency-box span { font-size: 12px; }

.split-layout { display: flex; align-items: flex-start; gap: 16px; }
.split-layout .grow { flex: 1 1 auto; min-width: 0; }
.side-form { width: 330px; flex: 0 0 330px; display: grid; gap: 16px; }
.route-arrow { color: var(--green); font-weight: 800; margin-right: 8px; }

.mail-workspace { height: calc(100vh - 145px); min-height: 520px; display: grid; grid-template-columns: 250px minmax(0, 1fr); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.mail-sidebar { min-width: 0; padding: 14px 10px; border-right: 1px solid var(--line); background: #f7f9f8; overflow-y: auto; }
.compact-label { margin: 0 8px 7px; color: var(--muted); font-size: 9px; text-transform: uppercase; font-weight: 750; }
.mailbox-switcher { display: grid; max-height: 220px; overflow-y: auto; }
.mailbox-switcher a { min-height: 38px; padding: 6px 8px; display: flex; align-items: center; gap: 8px; border-radius: 4px; font-size: 11px; min-width: 0; }
.mailbox-switcher a > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mailbox-switcher a.active { background: #e5eee9; color: #175d45; font-weight: 700; }
.folder-list { margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; }
.folder-list > span { margin-bottom: 7px; }
.folder-list a { min-height: 35px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 9px; border-radius: 4px; color: #4f5b56; font-size: 12px; }
.folder-list a:hover { background: #edf1ef; }
.folder-list a.active { background: var(--green); color: #fff; font-weight: 650; }
.folder-list small { font-size: 10px; opacity: .7; }
.message-list-panel { min-width: 0; display: flex; flex-direction: column; }
.message-list-head { min-height: 60px; padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.message-list-head strong, .message-list-head span { display: block; }
.message-list-head strong { font-size: 13px; }
.message-list-head span { color: var(--muted); font-size: 10px; }
.message-list { overflow-y: auto; }
.message-row { min-height: 76px; padding: 11px 14px; display: grid; grid-template-columns: 8px minmax(0,1fr) 150px; align-items: center; gap: 10px; border-bottom: 1px solid #e8ecea; }
.message-row:hover { background: #f7faf8; }
.message-row .unread-mark { width: 6px; height: 6px; border-radius: 50%; }
.message-row.unread .unread-mark { background: var(--green); }
.message-primary { min-width: 0; display: grid; }
.message-primary strong, .message-primary span, .message-primary small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-primary strong { font-size: 12px; font-weight: 550; }
.message-row.unread .message-primary strong, .message-row.unread .message-primary span { font-weight: 750; }
.message-primary span { color: #2d3833; font-size: 13px; }
.message-primary small { color: var(--muted); font-size: 10px; }
.message-meta { display: grid; justify-items: end; gap: 5px; color: var(--muted); }
.message-meta time { font-size: 10px; white-space: nowrap; }
.message-meta small { font-size: 10px; }
.message-view { max-width: 1050px; padding: 0; overflow: hidden; }
.message-header { min-height: 105px; padding: 22px 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.message-title { min-width: 0; display: flex; align-items: flex-start; gap: 13px; }
.message-title h2 { margin: 0 0 7px; font-family: Georgia, "Noto Serif SC", serif; font-size: 21px; overflow-wrap: anywhere; }
.message-title p { margin: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.message-header time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.message-headers { margin: 0; padding: 13px 24px; display: grid; gap: 5px; border-bottom: 1px solid var(--line); background: #fafbfa; font-size: 11px; }
.message-headers > div { display: grid; grid-template-columns: 85px minmax(0,1fr); gap: 10px; }
.message-headers dt { color: var(--muted); }
.message-headers dd { margin: 0; overflow-wrap: anywhere; }
.message-body { min-height: 250px; padding: 28px 32px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.7; }
.attachment-section { padding: 20px 24px; border-top: 1px solid var(--line); }
.attachment-section h3 { margin: 0 0 12px; font-size: 12px; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 8px; }
.attachment-list a { min-width: 220px; padding: 10px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 5px; background: #fafbfa; }
.attachment-list a:hover { border-color: var(--green); }
.attachment-list strong, .attachment-list small { display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-list strong { font-size: 11px; }
.attachment-list small { color: var(--muted); font-size: 9px; }
.file-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 4px; background: var(--green-soft); color: var(--green); font-weight: 800; }

.system-grid .span-2 { grid-column: 1 / -1; }
.storage-number { padding-top: 8px; }
.storage-number strong { display: block; font-family: Georgia, serif; font-size: 30px; }
.storage-number span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.action-code { padding: 3px 6px; border-radius: 3px; background: #eef1ef; color: #34423c; }

.empty-state { min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); text-align: center; }
.empty-state.compact { min-height: 165px; }
.empty-state.tall { min-height: 330px; }
.empty-state.full-page { min-height: 55vh; }
.empty-state strong { color: var(--text); }
.empty-state p { margin: 0; font-size: 11px; }
.empty-check, .empty-mail { width: 40px; height: 40px; margin-bottom: 6px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 20px; }
.error-code { font-family: Georgia, serif; font-size: 48px; color: var(--green); }

.auth-body { min-height: 100vh; background: #eef1ef; }
.login-shell { min-height: 100vh; padding: 24px; display: grid; place-items: center; }
.login-panel { width: min(400px, 100%); padding: 34px; border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: 6px; background: #fff; box-shadow: 0 15px 50px rgba(18,34,27,.1); }
.login-brand { display: flex; align-items: center; gap: 11px; }
.login-brand small { color: var(--muted); }
.login-panel h1 { margin: 30px 0 20px; font-family: Georgia, "Noto Serif SC", serif; font-size: 25px; }
.form-stack { display: grid; gap: 15px; }
.login-meta { margin-top: 26px; padding-top: 17px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--muted); font-size: 10px; }
.login-panel.center { text-align: center; }

@media (min-width: 1250px) {
  .dashboard-grid { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
}

@media (max-width: 1050px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .split-layout { flex-direction: column; }
  .side-form { width: 100%; flex-basis: auto; }
  .form-layout { grid-template-columns: 1fr; }
  .context-panel { max-width: none; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 10px 12px; }
  .brand { padding: 3px 5px 10px; }
  .primary-nav { margin-top: 9px; padding-bottom: 5px; flex-direction: row; overflow-x: auto; scrollbar-width: thin; }
  .primary-nav a { min-width: max-content; min-height: 36px; padding: 7px 9px; }
  .primary-nav a.active { box-shadow: inset 0 -3px 0 #4ac494; }
  .sidebar-footer { display: none; }
  .main-content { padding: 20px 14px 38px; }
  .page-header { min-height: 50px; align-items: center; }
  .page-header h1 { font-size: 22px; }
  .page-actions .button { min-height: 34px; padding: 7px 9px; }
  .metrics-grid { gap: 8px; }
  .metric { min-height: 108px; padding: 14px; }
  .metric strong { font-size: 26px; }
  .toolbar-band { align-items: stretch; flex-direction: column; }
  .search-form { width: 100%; }
  .search-box { width: 100%; }
  .result-count { align-self: flex-end; }
  .form-grid.two { grid-template-columns: 1fr; }
  .mail-workspace { height: auto; min-height: 0; grid-template-columns: 1fr; }
  .mail-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .mailbox-switcher { max-height: 128px; }
  .folder-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .folder-list > span { grid-column: 1 / -1; }
  .message-list { max-height: 65vh; }
  .message-list-head { align-items: flex-start; flex-direction: column; }
  .message-list-head form, .message-list-head .search-box { width: 100%; }
  .message-row { grid-template-columns: 6px minmax(0,1fr); }
  .message-meta { grid-column: 2; grid-template-columns: 1fr auto; justify-items: start; }
  .message-header { flex-direction: column; }
  .message-body { padding: 22px 17px; }
  .system-grid { grid-template-columns: 1fr; }
  .system-grid .span-2 { grid-column: 1; }
}

@media (max-width: 440px) {
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric { min-width: 0; }
  .page-header { align-items: flex-start; }
  .page-header h1 { font-size: 20px; }
  .button { white-space: normal; text-align: center; }
  .login-shell { padding: 13px; }
  .login-panel { padding: 24px 20px; }
  .form-panel { padding: 17px; }
  .message-headers > div { grid-template-columns: 68px minmax(0,1fr); }
}
