#mailRows .mail-is-unread .mail-subject-button{font-weight:650}#mailRows .mail-was-read .mail-subject-button{font-weight:400}
#mobileHome,#mobileBottom,#mobileMailCards,#mobileMailFilters,#mobileCompose{display:none}
@media(max-width:900px){
 #appView .topbar{display:none}#appView .content{padding:0 0 88px;background:#f3f6fb}#dashboardPage>*:not(#mobileHome):not(#customerLifecyclePanel){display:none!important}
 #mobileHome{display:block;max-width:700px;margin:auto;padding:0 16px 20px;color:#223350;font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif}
 #mobileHome [hidden],#mobileBottom [hidden],#mobileMailCards[hidden]{display:none!important}
 #mobileHome button,#mobileBottom button{font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
 #mobileHome button:focus-visible,#mobileBottom button:focus-visible,#mobileMailCards button:focus-visible{outline:3px solid #4b7bec;outline-offset:2px}
 .mh-heading{display:flex;align-items:center;gap:12px;margin:0 -16px;padding:28px 20px 30px;background:linear-gradient(130deg,#dceaff,#e9f4ff 65%,#f3f6fb)}
 .mh-heading>div:nth-child(2){flex:1}.mh-heading small{color:#5d7396;font-size:12px}.mh-heading h2{margin:2px 0 0;font-size:22px}.mh-heading>button{background:#ffffff88;border:0;border-radius:50%;padding:10px;width:44px;height:44px;color:#456ca5}
 .mh-avatar{width:46px;height:46px;background:#fff;border-radius:16px;display:grid;place-items:center;color:#6184b5}.mh-avatar svg{width:26px;height:26px}
 .mh-panel{background:white;border:1px solid #e8eef8;border-radius:20px;padding:16px;margin-bottom:18px;box-shadow:0 5px 18px #29568805}
 #mhHomeView>.mh-panel:first-child{margin-top:-7px;position:relative}.mh-section-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:4px 0 14px}.mh-section-title h3,.mh-panel h3{font-size:16px;margin:0}.mh-section-title h2{font-size:22px;margin:0}.mh-section-title button{background:transparent;border:0;color:#5274a8;padding:6px;min-height:44px;white-space:nowrap}.mh-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px 6px}
 #mobileHome .mh-shortcut{padding:0;background:transparent;border:0;box-shadow:none;color:#324259;display:flex;flex-direction:column;align-items:center;gap:8px;min-width:0;font-size:12px;line-height:1.45}.mh-shortcut>span:last-child{max-width:100%;overflow-wrap:anywhere}
 .mh-icon{position:relative;display:grid;place-items:center;width:52px;height:52px;background:#eaf1ff;color:#517deb;border-radius:17px}.mh-icon svg{width:27px;height:27px}.mh-icon-mail{color:#f16c6e;background:linear-gradient(135deg,#fff0ed,#ffd7d8)}.mh-icon-unread{background:#ffece6;color:#f19a5b}.mh-icon-unreplied{background:#e0f2ff;color:#4497df}.mh-icon-sent{background:#ece8ff;color:#8b78db}.mh-icon-more{background:#dbf7ef;color:#2db595}.mh-icon-customers{color:#ed9161;background:#fff0e8}.mh-icon-products{color:#1cafab;background:#dff5f3}.mh-icon-orders{color:#6088dc;background:#e6edff}
 .mh-badge{position:absolute;right:-6px;top:-5px;border:2px solid white;background:#f56866;color:white;font-size:10px;padding:0 5px;min-width:20px;line-height:19px;border-radius:12px;text-align:center}
 .mh-sync{font-size:11px;line-height:1.6;color:#68839b;margin:20px 0 0;padding-top:12px;border-top:1px solid #f0f3f8}.mh-account{font-size:12px;color:#8090a6;margin:-10px 0 12px;overflow-wrap:anywhere}.mh-help{color:#8995a7;font-size:12px;line-height:1.7;margin:12px 0}.mh-empty{padding:22px 8px;color:#8a97aa;text-align:center;font-size:13px}
 .mh-recent{padding:0;overflow:hidden}.mh-mail-card{display:flex!important;align-items:flex-start;gap:11px;width:100%;padding:16px 12px!important;background:white!important;color:#27384c!important;border:0!important;border-bottom:1px solid #edf1f7!important;border-radius:0!important;box-shadow:none!important;text-align:left;font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif;cursor:pointer;min-width:0}
 .mh-mail-card:last-child{border-bottom:0!important}.mh-mail-avatar{width:36px;height:36px;flex:0 0 36px;display:grid;place-items:center;border-radius:12px;background:#eef2fb;color:#6b88bf;font-size:15px}.mh-mail-copy{min-width:0;flex:1}.mh-mail-top{display:flex;align-items:center;gap:8px}.mh-mail-top strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:13px}.mh-mail-top time{color:#9aa5b5;font-size:10px;white-space:nowrap}.mh-mail-subject{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#4c6edb;font-size:14px;font-weight:650;margin:5px 0}.mh-mail-snippet{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px;color:#909bad}.is-read .mh-mail-subject{font-weight:400}.mh-mail-card:not(.is-read) .mh-mail-avatar{box-shadow:inset 3px 0 #759af8}
 #mobileBottom{display:flex;position:fixed;bottom:0;left:0;right:0;z-index:50;background:#ffffffed;border-top:1px solid #e7edf7;padding:8px 12px max(8px,env(safe-area-inset-bottom));gap:8px;backdrop-filter:blur(12px)}#mobileBottom button{flex:1;display:flex;flex-direction:column;align-items:center;gap:4px;background:transparent;border:0;color:#99a3b4;font-size:11px;padding:4px;min-height:46px}#mobileBottom svg{width:22px;height:22px}#mobileBottom [aria-current=page]{color:#4f7de1;font-weight:600}
 .mh-selected{display:flex;align-items:center;gap:5px;border-bottom:1px solid #eef2f8;padding:6px 0}.mh-selected>span{display:flex;align-items:center;gap:8px;flex:1;min-width:0;font-size:13px}.mh-selected svg{width:20px;height:20px;color:#6688bf}.mh-selected button{width:40px;min-height:44px;border:0;border-radius:10px;background:#f3f6fb;color:#5676aa}.mh-selected button:disabled{opacity:.3}.mh-editor-actions{display:flex;gap:12px;justify-content:flex-end;margin-top:14px}.mh-editor-actions button{min-height:44px;padding:8px 16px;border:1px solid #dbe3f2;border-radius:10px;background:white;color:#5774a3}.mh-editor-actions [data-mh-save]{background:#4778d6;color:white;border-color:#4778d6}
 #mhMoreView{padding-top:10px}#mhMoreView .mh-panel>h3{margin-bottom:16px}
 #erpWorkspaceWindow{inset:0!important;width:100vw!important;height:100dvh!important;border-radius:0!important;border:0!important}.erp-window-header{gap:5px;flex-wrap:nowrap!important;padding:8px!important;min-width:0}.erp-window-header button{min-height:40px;font-size:12px;white-space:nowrap}.erp-window-actions{gap:3px}#erpWindowTitle{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}[data-window-depth],[data-window-fullscreen]{display:none!important}.erp-window-header [data-window-minimize]{font-size:0;width:38px;padding:4px}.erp-window-header [data-window-minimize]:after{content:'－';font-size:20px}.erp-window-header [data-window-close]{font-size:0;width:38px;padding:4px}.erp-window-header [data-window-close]:after{content:'×';font-size:24px}.erp-window-body{padding:12px!important;background:#f5f7fb}.erp-window-body>.page{min-width:0}#erpWindowDock{bottom:80px;left:12px;max-width:calc(100vw - 24px)}
 #mailPage>.toolbar{display:flex;align-items:center;gap:8px;margin-bottom:12px}#mailPage>.toolbar h2{font-size:20px;margin:0}#mailPage>.toolbar .muted{display:none}#mobileCompose{display:block;margin-left:auto;min-height:42px;border-radius:12px}#mailPage .mail-workspace{display:block}#mailPage .mh-mail-options{display:none}#mailPage.mh-options-open .mh-mail-options{display:flex;margin-bottom:14px;background:white;padding:12px;border-radius:14px}#mobileMailFilters{display:flex;gap:4px;align-items:center;margin:8px 0 12px}#mobileMailFilters button{padding:8px;min-height:42px;min-width:0;background:transparent;border:0;font-size:12px;color:#8290a4;white-space:nowrap}#mobileMailFilters button[aria-pressed=true]{background:#e8efff;color:#4d70c5;border-radius:9px}#mobileMailFilters [data-options]{margin-left:auto}
 #mailPage:not(.mh-show-table) .mail-main>.table-wrap{display:none}#mobileMailCards{display:block;background:white;border-radius:14px;overflow:hidden}#mailPage .mail-search-tools{display:flex;margin-bottom:8px;gap:8px}#mailPage #mailSearch{width:100%;min-width:0;font-size:14px;border-radius:12px}#mailPage:not(.mh-options-open) #batchDeleteMail,#mailPage:not(.mh-options-open) #mailSelectedCount{display:none}#mailStatus{background:none;border:0;padding:4px 0;font-size:12px;color:#8190a4;margin:6px 0}#mailPage .mail-main>p.muted{display:none}#mailImportProgress{background:none;border:0;padding:4px 0;margin:0 0 10px;font-size:11px;color:#8593a7}#mailPage:not(.mh-options-open) #mailImportProgress button{display:none}#mailImportProgress button{font-size:12px;min-height:42px;margin-bottom:5px}#mailPage .mail-main>.actions{justify-content:center;font-size:12px}#mailPage .mail-main>.actions button{min-height:44px;font-size:12px;padding:8px 12px}
 #mailPage.mh-options-open .mail-main>.table-wrap{display:block}#mailPage.mh-options-open #mobileMailCards{display:none}
 #erpWorkspaceWindow #mailDetailDialog{padding:8px!important}#mailDetailTitle{font-size:20px!important;line-height:1.4;overflow-wrap:anywhere}#mailDetailDialog .mail-reader-meta{grid-template-columns:48px minmax(0,1fr);gap:8px;font-size:12px}#mailDetailDialog .mail-reader-meta dd{overflow-wrap:anywhere}#mailDetailDialog .mail-reader-tools{gap:4px;flex-wrap:wrap;top:0!important}#mailDetailDialog .mail-reader-tools button{width:40px;height:40px;min-width:40px;padding:8px}#mailDetailDialog .mail-reader-body{margin-top:16px}#mailDetailDialog .mail-attachment-chip{white-space:normal;overflow-wrap:anywhere}
 #erpWorkspaceWindow #composeDialog{padding:10px!important}#composeForm .form-grid{display:block}#composeForm .form-grid>label{margin-bottom:10px}#composeForm .dialog-actions{display:flex;flex-wrap:wrap;gap:6px}#composeForm .dialog-actions button{min-height:44px;font-size:13px}#composeForm select,#composeForm input{font-size:16px!important}
}
@media(max-width:350px){#mobileHome{padding-left:12px;padding-right:12px}.mh-heading{margin-left:-12px;margin-right:-12px;padding-left:16px;padding-right:16px}.mh-panel{padding:13px}.mh-recent{padding:0}.mh-icon{width:46px;height:46px}.mh-grid{gap:16px 3px}#mobileHome .mh-shortcut{font-size:11px}.mh-mail-avatar{display:none}.mh-mail-top time{font-size:9px}.erp-window-header{gap:3px!important}#mobileMailFilters button{padding:8px 6px}}

@media(max-width:900px){.mh-account-actions{display:flex;gap:10px}.mh-account-actions button{flex:1;min-height:44px;border:1px solid #e0e6f2;border-radius:10px;background:white;color:#6781aa}}

/* Unified actions and mobile reading typography; screen-only, no print changes. */
.mail-header-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-left:auto}
.mail-header-actions button{white-space:nowrap}
.mail-account-tag{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#8692a5;font-size:11px;font-weight:400;line-height:1.4}
@media screen and (max-width:900px){
 html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
 #appView,.erp-window-body,dialog{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif;font-size:14px;line-height:1.5}
 .erp-window-body :is(button,input,select,textarea),dialog :is(button,input,select,textarea){font-family:inherit;line-height:1.5}
 .erp-window-body :is(button,label,th,td),dialog :is(button,label){font-size:14px}
 .erp-window-body .page>h2,.erp-window-body .page>.toolbar h2{font-size:20px;line-height:1.4}
 .erp-window-body :is(.card,.form-grid)>h3,dialog>h3{font-size:16px;line-height:1.5}
 .erp-window-body :is(input,select,textarea):not([type=checkbox]):not([type=radio]){font-size:16px}
 .erp-window-body .muted{font-size:12px;line-height:1.6}
 #mailPage>.toolbar{align-items:flex-start;flex-direction:column}
 #mailPage .mail-header-actions{width:100%;margin-left:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 #mailPage .mail-header-actions button{width:100%;margin:0;min-height:40px;padding:8px;font-size:13px;border-radius:9px}
 .mh-mail-account{display:block;font-size:11px;color:#8391a7;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:2px 0}
 #mailDetailDialog .mail-reader-meta{grid-template-columns:64px minmax(0,1fr);font-size:14px;line-height:1.6}
 #mailDetailDialog .mail-attachment-chip{font-size:13px}
 .erp-window-body .erp-window-header button{font-size:12px}
}

/* Mobile mail tools: settings row, writing row, then the visible owner picker. */
#mobileMailActions,#mobileMailOwner{display:none}
@media screen and (max-width:900px){
 #mailPage .mail-header-actions,#mobileMailActions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;gap:8px}
 #mailPage .mail-header-actions button,#mobileMailActions button{width:100%;min-width:0;min-height:42px;margin:0;padding:8px 4px;white-space:nowrap;font-size:13px;line-height:1.5;border-radius:9px}
 #mobileCompose{display:block}
 #mailPage .mail-sidebar>#composeMail,#mailPage>.mh-greeting-panel{display:none!important}
 #mobileMailOwner{display:block;margin:12px 0}
 #mobileMailOwner:has(#mailStaffPicker[hidden]){display:none}
 #mobileMailOwner #mailStaffPicker summary{font-size:14px;line-height:1.5;padding:11px 12px;background:white;border:1px solid #c7d3eb;border-radius:10px}
 #mobileMailOwner .mail-staff-popover{width:100%;max-width:100%;box-sizing:border-box;border-radius:10px}
 #mobileGreetingDialog #greetingSettingsForm{margin-bottom:16px}
}
@media screen and (max-width:350px){
 #mailPage .mail-header-actions,#mobileMailActions{gap:6px}
 #mailPage .mail-header-actions button,#mobileMailActions button{font-size:12px;padding:8px 2px}
}

#mobileGreetingDialog .mh-greeting-panel>summary{display:none}

@media(max-width:900px){#dashboardPage #customerLifecyclePanel{display:block!important;margin:12px;max-width:calc(100% - 24px);box-sizing:border-box}#customerLifecyclePanel .table-wrap{overflow:visible}#customerLifecyclePanel table,#customerLifecyclePanel tbody,#customerLifecyclePanel tr,#customerLifecyclePanel td{display:block;min-width:0;width:auto}#customerLifecyclePanel thead{display:none}#customerLifecyclePanel tr{border:1px solid #d6dfed;border-radius:10px;padding:10px;margin:12px 0}#customerLifecyclePanel tr[hidden]{display:none!important}#customerLifecyclePanel td{white-space:normal!important;overflow-wrap:anywhere;padding:6px}#customerLifecyclePanel td:before{content:attr(data-label);display:block;color:#607086;font-size:12px}#customerLifecyclePanel button{min-height:44px;margin:4px}#customerLifecyclePanel input[type=checkbox]{width:22px;height:22px;vertical-align:middle}#customerLifecycleReview{width:calc(100vw - 24px);max-width:560px;box-sizing:border-box;max-height:85vh;overflow:auto}}
