:root { color-scheme: light; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #f3f5f7; color: #1e293b; }
* { box-sizing: border-box; } body { margin: 0; background: linear-gradient(145deg, #f7f9fc 0%, #eef3f8 100%); min-height: 100vh; } a { color: #175cd3; text-decoration: none; } a:hover { text-decoration: underline; }
.topbar { height: 60px; background: #102a43; color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 5vw; } .brand { color: #fff; font-weight: 700; } nav { display: flex; gap: 16px; align-items: center; } nav a { color: #d9eaf7; } .inline { display: inline; } button, .button { border: 0; border-radius: 6px; padding: 9px 14px; cursor: pointer; background: #e2e8f0; color: #0f172a; font-size: 14px; display: inline-block; } nav button { background: transparent; color: #d9eaf7; padding: 0; } .primary { background: #1769e0; color: white; } .danger, .danger-button { color: #b42318; } .danger-button { border: 0; background: #fee4e2; padding: 10px 14px; border-radius: 6px; cursor: pointer; }
label { display: block; font-weight: 600; margin: 16px 0; } input, textarea { display: block; width: 100%; margin-top: 7px; border: 1px solid #cbd5e1; border-radius: 8px; padding: 11px 13px; font: inherit; font-size: 15px; color: #1e293b; background: #fff; transition: border-color .15s, box-shadow .15s; } input:focus, textarea:focus { outline: none; border-color: #4f8ee8; box-shadow: 0 0 0 3px #4f8ee826; } textarea { min-height: 180px; resize: vertical; line-height: 1.6; } table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid #e2e8f0; vertical-align: top; } th { color: #475569; font-size: 13px; } .flash { padding: 12px 15px; border-radius: 6px; margin: 12px 0; } .flash.error { background: #fee4e2; color: #912018; } .flash.success { background: #dcfae6; color: #166534; } .folders { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; } .folders a { background: #eef2f6; color: #334e68; padding: 8px 11px; border-radius: 6px; } .folders a.active { background: #1769e0; color: white; } .headers { display: grid; grid-template-columns: 70px 1fr; gap: 8px 14px; font-size: 14px; } .headers dt { color: #64748b; } .headers dd { margin: 0; overflow-wrap: anywhere; } .message-body { overflow-wrap: anywhere; line-height: 1.65; } .message-body.plain { white-space: pre-wrap; } hr { border: 0; border-top: 1px solid #e2e8f0; margin: 20px 0; }
.compose-page { max-width: 940px; margin: 46px auto 80px; } .compose-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 0 4px 18px; } .compose-heading h1 { font-size: 30px; letter-spacing: -.02em; margin: 3px 0 6px; } .eyebrow { color: #1769e0; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; } .back-link { color: #52657a; font-size: 14px; margin-bottom: 8px; } .compose-card { margin: 0; padding: 30px 34px 0; border: 1px solid #e1e8f0; border-radius: 16px; box-shadow: 0 18px 50px #1e3a5f14; overflow: visible; } .compose-meta { display: grid; gap: 13px; padding-bottom: 25px; border-bottom: 1px solid #e8edf3; } .compose-meta .field { margin: 0; } .field > span, .editor-label { display: flex; align-items: baseline; justify-content: space-between; color: #334155; font-size: 13px; font-weight: 750; } .readonly-field { margin-top: 7px; padding: 11px 13px; color: #64748b; background: #f5f7fa; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 15px; } .compose-meta input { margin-top: 6px; } .editor-title { display: flex; justify-content: space-between; align-items: baseline; margin: 24px 0 12px; color: #334155; font-size: 15px; font-weight: 750; } .editor-title small, .editor-label small, .field-hint, .upload-box small { color: #7b8b9e; font-size: 12px; font-weight: 400; } .compose-editors { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } .editor-block { margin: 0; padding: 16px; border: 1px solid #e2e8f0; border-radius: 11px; background: #fbfcfe; } .editor-block textarea { min-height: 260px; margin-top: 11px; border-color: #d9e2ec; background: #fff; } .editor-block textarea.html-editor { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; } .field-hint { display: block; margin-top: 8px; } .compose-bottom { display: flex; align-items: center; gap: 15px; margin-top: 24px; } .upload-box { position: relative; display: flex; align-items: center; gap: 11px; min-height: 63px; margin: 0; padding: 11px 16px; border: 1px dashed #aabbd0; border-radius: 11px; background: #f8fbff; color: #315b8e; cursor: pointer; } .upload-box:hover { border-color: #4f8ee8; background: #f1f7ff; } .upload-box input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; } .upload-box strong, .upload-box small { display: block; } .upload-symbol { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: #e1edff; color: #1769e0; font-size: 22px; font-weight: 400; } .upload-limit { color: #7b8b9e; font-size: 12px; } .compose-actions { display: flex; justify-content: flex-end; gap: 10px; margin: 28px -34px 0; padding: 16px 34px; border-top: 1px solid #e8edf3; background: #fbfcfe; border-radius: 0 0 16px 16px; } .compose-actions button, .compose-actions .button { padding: 10px 16px; } .compose-actions .primary { box-shadow: 0 5px 12px #1769e033; } 
@media (max-width: 700px) { .topbar { padding: 0 18px; } nav { gap: 8px; font-size: 13px; } .page-title { align-items: flex-start; flex-direction: column; } th:nth-child(2), td:nth-child(2) { display: none; } .compose-page { margin: 28px auto 50px; } .compose-heading { align-items: flex-start; flex-direction: column; gap: 8px; } .compose-card { padding: 23px 18px 0; } .compose-editors { grid-template-columns: 1fr; } .compose-bottom { align-items: flex-start; flex-direction: column; } .compose-actions { margin-left: -18px; margin-right: -18px; padding-left: 18px; padding-right: 18px; } }
.attachment-field { min-width: 360px; } .upload-box { display: grid; grid-template-columns: 1fr; gap: 11px; } .upload-prompt { display: flex; align-items: center; gap: 11px; margin: 0; padding: 0; color: #315b8e; cursor: pointer; } .upload-box input[type=file].file-picker { position: static; inset: auto; width: 100%; height: auto; margin: 0; padding: 7px 0 0; border: 0; background: transparent; color: #52657a; font-size: 13px; opacity: 1; cursor: pointer; } .file-picker::file-selector-button { margin-right: 9px; padding: 7px 11px; border: 1px solid #c9dcf8; border-radius: 7px; background: #eaf2ff; color: #1769e0; font: inherit; cursor: pointer; } 
.attachment-clear { justify-self: start; border: 1px solid #c9d6e5; background: #fff; color: #52657a; } .attachment-clear:hover { border-color: #8fa6bf; background: #f4f8fc; }
@media (max-width: 700px) { .attachment-field { width: 100%; } }

/* Responsive layout overrides */
html { overflow-x: hidden; }
body { overflow-x: hidden; }
.container { width: min(1100px, calc(100% - 36px)); min-width: 0; }
.topbar { height: auto; min-height: 60px; flex-wrap: wrap; gap: 8px 20px; padding-top: 10px; padding-bottom: 10px; }
.brand { min-height: 40px; display: inline-flex; align-items: center; white-space: nowrap; }
.main-nav { min-width: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 12px; }
.nav-link, .nav-button { min-height: 40px; display: inline-flex; align-items: center; padding: 8px 6px; white-space: nowrap; }
.nav-form { margin: 0; }
.page-title { flex-wrap: wrap; align-items: flex-end; }
.page-title > div:first-child { min-width: 0; flex: 1 1 320px; }
.page-title-action { flex: 0 0 auto; }
.page-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.page-actions .button { min-height: 40px; }
.table-scroll { width: 100%; min-width: 0; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 620px; }
.account-table { min-width: 0 !important; }
.account-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.action-link { display: inline-flex; align-items: center; min-height: 36px; padding: 7px 10px; border-radius: 7px; background: #eef4fb; color: #315b8e; font-size: 13px; white-space: nowrap; }
.action-link:hover { background: #e1edff; text-decoration: none; }
.action-link.primary-action { background: #1769e0; color: #fff; }
.action-link.primary-action:hover { background: #1258bd; }
.account-actions .danger { background: #fff1f0; }
.account-actions .danger:hover { background: #fee4e2; }
.account-table td { vertical-align: middle; }
.account-address a { overflow-wrap: anywhere; }
.audit-table { min-width: 640px; }
.message-table { min-width: 620px; }
.form-card { width: min(100%, 480px); }
.message-nav { margin: 24px 0 12px; }
.message-card { overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .container { width: min(100% - 28px, 900px); }
  .topbar { padding-left: 18px; padding-right: 18px; }
  .compose-card { padding-left: 24px; padding-right: 24px; }
  .compose-actions { margin-left: -24px; margin-right: -24px; padding-left: 24px; padding-right: 24px; }
}

@media (max-width: 700px) {
  .container { width: calc(100% - 24px); padding-left: 0; padding-right: 0; margin-top: 20px; }
  .topbar { align-items: flex-start; gap: 4px 12px; }
  .brand { flex: 1 1 100%; }
  .main-nav { width: 100%; justify-content: flex-start; gap: 4px 8px; }
  .nav-link, .nav-button { min-height: 42px; padding: 8px 9px; border-radius: 7px; background: #173754; }
  .nav-button { color: #d9eaf7; }
  .page-title { align-items: flex-start; gap: 12px; }
  .page-title-action { width: 100%; text-align: center; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .page-actions .button { flex: 1 1 150px; text-align: center; }
  .card { padding: 17px; border-radius: 12px; }
  .account-card { padding: 0; overflow: visible; }
  .account-table, .account-table tbody, .account-table tr, .account-table td { display: block; width: 100%; }
  .account-table thead { display: none; }
  .account-table tr { padding: 16px; border-bottom: 1px solid #e2e8f0; }
  .account-table tr:last-child { border-bottom: 0; }
  .account-table td { display: flex; align-items: flex-start; gap: 10px; padding: 0; border: 0; }
  .account-table td + td { margin-top: 13px; }
  .account-table td::before { flex: 0 0 42px; padding-top: 8px; color: #64748b; font-size: 12px; font-weight: 700; content: attr(data-label); }
  .account-address a { padding-top: 7px; }
  .account-actions-cell::before { padding-top: 10px; }
  .account-actions { min-width: 0; flex: 1 1 auto; }
  .action-link { min-height: 40px; }
  .audit-table th:nth-child(2), .audit-table td:nth-child(2), .message-table th:nth-child(2), .message-table td:nth-child(2) { display: table-cell; }
  .table-scroll { margin-right: -17px; padding-right: 17px; }
  .folders { gap: 6px; }
  .folders a { min-height: 40px; display: inline-flex; align-items: center; }
  .form-card { margin: 28px auto; }
  .compose-page { width: 100%; margin: 28px auto 50px; }
  .compose-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .compose-card { padding: 20px 17px 0; }
  .compose-editors { grid-template-columns: 1fr; }
  .compose-bottom { align-items: stretch; flex-direction: column; }
  .attachment-field { min-width: 0; width: 100%; }
  .attachment-clear { width: 100%; min-height: 42px; }
  .upload-limit { display: block; }
  .compose-actions { position: sticky; bottom: 0; z-index: 2; margin-left: -17px; margin-right: -17px; padding: 13px 17px; }
  .compose-actions .button, .compose-actions button { min-height: 44px; flex: 1 1 140px; text-align: center; }
  .message-nav { margin-top: 18px; }
}

@media (max-width: 480px) {
  h1 { font-size: 23px; }
  .muted { font-size: 13px; }
  .page-actions .button { flex-basis: 100%; }
  .compose-heading h1 { font-size: 27px; }
  .editor-title { align-items: flex-start; flex-direction: column; gap: 4px; }
  .compose-actions { flex-direction: column; }
  .compose-actions .button, .compose-actions button { width: 100%; flex-basis: auto; }
  .table-scroll { margin-right: -17px; }
}

/* Consistent page gutters and symmetric narrow-screen overflow */
:root { --page-gutter: 28px; }
.container { width: 100%; max-width: 1160px; margin: 30px auto; padding-left: var(--page-gutter); padding-right: var(--page-gutter); }
.table-scroll { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
.compose-actions { margin-left: -34px; margin-right: -34px; }

@media (max-width: 900px) {
  .container { width: 100%; max-width: 100%; padding-left: 24px; padding-right: 24px; }
}

@media (max-width: 700px) {
  .container { width: 100%; padding-left: 16px; padding-right: 16px; }
  .table-scroll { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
  .compose-actions { margin-left: 0; margin-right: 0; }
}

@media (max-width: 480px) {
  .container { padding-left: 12px; padding-right: 12px; }
  .card { padding-left: 14px; padding-right: 14px; }
  .account-card { padding-left: 0; padding-right: 0; }
  .compose-card { padding-left: 14px; padding-right: 14px; }
  .compose-actions { margin-left: 0; margin-right: 0; }
}

/* Same-address POST navigation */
.navigation-form { display: inline-flex; margin: 0; vertical-align: middle; }
.navigation-form button { font: inherit; }
.navigation-form .nav-action { border: 0; background: transparent; }
.topbar > .navigation-form:first-child { flex: 0 0 auto; }
.topbar > .navigation-form .brand.nav-action { color: #fff; font-weight: 700; padding: 0; white-space: nowrap; }
.navigation-form .link-button { border: 0; background: transparent; color: #175cd3; padding: 0; text-align: left; }
.navigation-form .link-button:hover { background: transparent; text-decoration: underline; }
.folders .navigation-form .folder-button { min-height: 40px; padding: 8px 11px; border-radius: 6px; background: #eef2f6; color: #334e68; }
.folders .navigation-form .folder-button.active { background: #1769e0; color: #fff; }
.page-title > .navigation-form { flex: 0 0 auto; }
.compose-actions .navigation-form { flex: 1 1 140px; }
.compose-actions .navigation-form .button { width: 100%; }

@media (max-width: 700px) {
  .topbar > .navigation-form:first-child { flex: 1 1 100%; }
  .page-title > .navigation-form { width: 100%; }
  .page-title > .navigation-form .page-title-action { width: 100%; }
  .compose-actions .navigation-form { width: 100%; flex-basis: auto; }
}

@media (max-width: 480px) {
  .compose-actions .navigation-form { flex: 0 0 auto; }
}
