/* The desktop workbench remains complete. All portable styles are scoped. */
.p-header,.p-nav{display:none}
body.portable{--p-bottom:calc(66px + env(safe-area-inset-bottom,0px));--p-header:calc(62px + env(safe-area-inset-top,0px));background:#f6f4ef;color:#2c2a25}
.portable .layout{display:block;min-height:100dvh}.portable .sidebar,.portable .topbar,.portable #message-dock,.portable #live-status{display:none!important}
.portable .p-header{display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:12;height:var(--p-header);padding:env(safe-area-inset-top,0px) 18px 0;background:#fcfbf9;border-bottom:1px solid #e9e4db}
.p-brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:#2d2b25}.portable .p-brand .company-logo{width:36px;height:36px;margin:0;border-radius:10px}.p-brand>span:last-child{font-size:20px;font-weight:600;letter-spacing:3px}.p-brand small{display:block;font-size:9px;letter-spacing:1px;font-weight:400;color:#9c917b;line-height:1.4}.p-header>div{display:flex;align-items:center;gap:12px}.p-live{width:6px;height:6px;border-radius:50%;background:#c59b51}.p-live.online{background:#57886b}.p-account{width:35px;height:35px;border-radius:50%;padding:0;background:#eee6d4;border:1px solid #e5dbc2;color:#8a6a1e;font-size:14px}
.portable .content{padding:20px 16px calc(var(--p-bottom) + 24px);max-width:100%;margin:0}.portable .p-nav{position:fixed;bottom:0;left:0;right:0;height:var(--p-bottom);padding:5px 10px calc(5px + env(safe-area-inset-bottom,0px));z-index:18;background:#fcfbf9f5;backdrop-filter:blur(16px);border-top:1px solid #e9e4db;display:grid;grid-template-columns:repeat(4,1fr);gap:4px}
.p-nav a{min-width:0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:2px;color:#918b7f;text-decoration:none;font-size:11px;border-radius:12px}.p-tab-icon{position:relative;padding:3px 16px;border-radius:20px;display:flex}.p-tab-icon svg{width:22px;height:22px}.p-nav a[aria-current=page]{color:#80621b;font-weight:600}.p-nav a[aria-current=page] .p-tab-icon{background:#f0e8d3}.p-tab-icon b{position:absolute;right:4px;top:-2px;background:#ae4938;color:white;font-size:9px;min-width:16px;height:16px;line-height:16px;text-align:center;padding:0 4px;border-radius:9px;border:1px solid #fcfbf9}.p-tab-icon b[hidden]{display:none}
.portable h1{font-size:24px;letter-spacing:-.5px}.portable h2{font-size:16px}.portable button,.portable a{touch-action:manipulation}.portable input,.portable textarea,.portable .select-trigger{font-size:16px}.portable button{min-height:40px}.p-greeting,.p-title{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:20px}.p-greeting p,.p-title p{font-size:12px;color:#968d7c;margin:0 0 5px}.p-title p{margin:6px 0 0}.p-create{border-radius:12px!important;padding:12px 14px!important;white-space:nowrap}.p-stats{display:grid;grid-template-columns:repeat(3,1fr);background:#fff;border:1px solid #e9e4db;border-radius:16px;padding:19px 0;margin-bottom:26px;box-shadow:0 4px 16px #6b573804}.p-stats a{text-align:center;text-decoration:none;color:#8f826a;display:flex;flex-direction:column;gap:4px;font-size:11px}.p-stats a+a{border-left:1px solid #eee9de}.p-stats strong{font-size:27px;font-weight:550;color:#685326;font-variant-numeric:tabular-nums;line-height:1.25}
.p-section{margin-bottom:26px}.p-section>header,.p-data-card>header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;gap:8px}.p-section header a,.p-data-card header a{font-size:12px;text-decoration:none;display:flex;gap:4px;align-items:center;min-height:32px}.p-section header svg,.p-data-card header svg{width:14px;height:14px}.p-reminders{background:#fcf8ef;border:1px solid #ece2ca;border-radius:14px;overflow:hidden}.p-reminders button{display:flex;width:100%;gap:10px;align-items:center;text-align:left;border:0;border-radius:0;padding:14px 12px;background:transparent}.p-reminders button+button{border-top:1px solid #ece4d4}.p-reminders button>span:nth-child(2){flex:1;min-width:0}.p-reminders strong{font-size:13px;line-height:1.6;display:block;overflow-wrap:anywhere}.p-reminders small{font-size:11px;line-height:1.6;display:block;color:#998260;margin-top:3px}.p-reminder-icon{display:grid;place-items:center;width:32px;height:34px;color:#a37b2d;flex-shrink:0}.p-reminder-icon svg{width:20px;height:20px}.p-reminders button>svg{width:16px;height:16px;flex-shrink:0;color:#ab9975}
.p-order{width:100%;display:block;text-align:left;background:#fff;border:1px solid #e7e1d5;border-radius:14px;padding:14px;margin-bottom:10px;color:#343027}.p-order-top{display:flex;align-items:center;justify-content:space-between;gap:8px}.p-order-top small{font:10px ui-monospace,monospace;overflow-wrap:anywhere}.p-order>strong{font-size:15px;line-height:1.55;display:block;margin:9px 0 10px;font-weight:550;overflow-wrap:anywhere}.p-order-tags{display:flex;gap:6px}.p-order .chip{font-size:10px}.p-order-foot{display:flex;flex-wrap:wrap;gap:3px 12px;justify-content:space-between;border-top:1px solid #f0ece4;margin-top:12px;padding-top:10px;font-size:11px;line-height:1.6;color:#8e8576}.p-order-foot>span:first-child{overflow-wrap:anywhere;max-width:100%}
.p-data-links{display:grid;grid-template-columns:1fr 1fr;gap:10px}.p-data-links a{display:flex;flex-wrap:wrap;gap:10px;text-decoration:none;background:#fff;border:1px solid #e7e1d5;border-radius:14px;padding:15px;color:#8a6a1e}.p-data-links a>svg:first-child{width:22px;height:22px}.p-data-links a>span{width:100%}.p-data-links b{font-size:14px;font-weight:550;color:#3d372c;display:block}.p-data-links small{font-size:10px;margin-top:3px;display:block;color:#a0947e}.p-data-links a>svg:last-child{width:15px;height:15px;margin-left:auto;margin-top:-79px}.p-secondary{display:flex;align-items:center;gap:10px;background:#eeeadf;color:#8e8062;border-radius:12px;padding:14px;text-decoration:none;font-size:12px}.p-secondary svg{width:18px;height:18px}.p-secondary svg:last-child{margin-left:auto}
.p-scope{display:flex;padding:4px;background:#eae5d9;border-radius:12px;margin-bottom:16px}.p-scope button{flex:1;border:0;background:none;color:#8d8168;padding:8px 5px;min-height:38px;font-size:13px;border-radius:9px}.p-scope button[aria-pressed=true]{background:#fff;color:#775b20;box-shadow:0 2px 8px #65501e0b;font-weight:600}.portable #p-order-search{border-radius:12px;border-color:#e7e0d3;background:#fff;padding:12px}.p-filters{display:flex;gap:7px;overflow:auto;padding:13px 0 8px;scrollbar-width:none}.p-filters button{flex-shrink:0;border-color:#e4ddd0;background:none;color:#968970;border-radius:18px;font-size:11px;padding:6px 11px;min-height:32px}.p-filters button[aria-pressed=true]{background:#8a6a1e;border-color:#8a6a1e;color:#fff}.p-result-count{font-size:11px;color:#9a8e77;margin:8px 0 11px}.p-back{display:inline-flex;align-items:center;min-height:40px;padding:8px 12px;border:1px solid #e5dece;border-radius:10px;text-decoration:none;font-size:12px;white-space:nowrap;background:#fcfbf9}.p-data-card{border:1px solid #e8e1d3;border-radius:14px;padding:16px;background:#fff;margin-bottom:14px}.p-data-card header>span{font-size:10px;color:#a28c60}.p-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 12px}.p-metrics>div{min-width:0}.p-metrics small{display:block;font-size:11px;color:#908674}.p-metrics strong{display:block;font-size:24px;color:#645130;margin:6px 0;overflow-wrap:anywhere;font-weight:500}.p-metrics em{font-size:11px;font-style:normal}.p-metrics span,.p-data-empty,.p-source{font-size:11px;color:#9d927e;line-height:1.7}.p-data-empty{padding:12px 0 0}.p-source{border-top:1px solid #eee8dc;padding-top:12px;margin-top:14px}.p-account-details{padding:4px 0 20px}.p-account-details b{font-size:22px}.p-account-details p{margin:8px 0}.p-account-actions{display:grid;gap:10px}
.portable dialog{width:calc(100vw - 16px);max-height:calc(var(--p-vh,100dvh) - 20px);border-radius:18px}.portable .dialog-head{position:sticky;top:0;background:#fff;z-index:3;padding:14px 16px}.portable .dialog-content{padding:18px 16px}.portable .form-grid{grid-template-columns:1fr;gap:16px}.portable .form-footer{position:sticky;bottom:-18px;background:#fff;padding:12px 0 calc(12px + env(safe-area-inset-bottom,0px));z-index:2}.portable .form-footer button{min-height:44px}.portable .select-popup{z-index:100}.portable .detail-grid{grid-template-columns:1fr 1fr;gap:14px}.portable .detail-grid dd{overflow-wrap:anywhere}.portable .panel-head{padding:15px}.portable .list-row{padding:14px}.portable .list-row h3{font-size:13px}.portable .list-row button{flex-shrink:0}.portable .page-head{flex-wrap:wrap}.portable .eyebrow{display:none}.portable #toast{bottom:calc(var(--p-bottom) + 12px);max-width:calc(100vw - 32px);width:max-content;z-index:40}
/* Fit communication to the actual visual viewport, including soft keyboards. */
.portable.p-chat,.portable.p-mail{overflow:hidden}.portable.p-chat .main,.portable.p-mail .main{position:fixed;top:var(--p-top,0px);left:0;right:0;height:var(--p-vh,100dvh);display:flex;flex-direction:column;overflow:hidden}.portable.p-chat .p-header,.portable.p-mail .p-header{flex-shrink:0;position:relative}.portable.p-chat .content,.portable.p-mail .content{flex:1;min-height:0;padding:0 0 var(--p-bottom)!important;display:flex;flex-direction:column}.portable #chat-root{height:100%;min-height:0;display:flex;flex-direction:column}.portable .im-page-head{flex-shrink:0;padding:12px 16px;margin:0;gap:12px;flex-wrap:nowrap;min-height:60px}.portable .im-page-head h1{font-size:20px}.portable .im-eyebrow,.portable .im-head-note{display:none}.portable .im-page-head>div{flex:1}.portable .im-page-head>button{font-size:12px;padding:8px 12px;min-height:36px}.portable #im-error{margin:0;padding:0 16px;flex-shrink:0}.portable #im-error:empty{display:none}.portable .im-layout{display:grid;grid-template-columns:1fr;flex:1;height:auto;min-height:0;border:0;border-top:1px solid #e9e4db;border-radius:0}.portable .im-layout:not(.im-open) #im-thread{display:none}.portable .im-layout.im-open .im-conversations{display:none}.portable .im-conversations{min-height:0;overflow-y:auto;border:0}.portable #im-thread{min-height:0;overflow:hidden}.portable #im-back{display:grid;min-height:36px;min-width:32px;place-items:center}.portable .im-thread-head{padding:10px 12px;gap:8px;min-height:60px;flex-wrap:nowrap}.portable .im-thread-head .im-avatar{width:30px;height:30px;flex-shrink:0}.portable .im-thread-head b{font-size:13px}.portable .im-thread-head small{font-size:10px}.portable .im-call-tools{margin-left:auto;flex-shrink:0;gap:4px}.portable .im-call-tools button{min-height:36px;width:36px;padding:8px}.portable .im-call-tools button span{display:none}.portable #im-members{max-width:60px;padding:4px;font-size:10px}.portable #im-feed{min-height:0;padding:12px;overscroll-behavior:contain}.portable #im-compose{padding:10px 12px;border-top:1px solid #e9e4db}.portable #im-compose .im-compose-tools{gap:20px;margin-bottom:8px}.portable #im-compose .im-file,.portable #im-record{font-size:11px;min-height:28px}.portable .im-upload-limit{display:none}.portable #im-compose textarea{font-size:16px;min-height:44px;height:54px;max-height:110px;padding:6px}.portable .im-compose-footer{margin-top:6px}.portable .im-send-hint{font-size:9px}.portable .im-compose-footer .primary{min-height:38px;padding:8px 17px}.portable .im-reminder-feed{min-height:0;overflow-y:auto}.portable .im-system-note{font-size:10px;padding:10px}.portable #im-dialog{max-height:calc(var(--p-vh,100dvh) - 20px)}
.portable .mail-reader-page{height:100%;display:flex;flex-direction:column;min-height:0;padding:12px 10px 0}.portable .mail-reader-page .page-head{display:none}.portable .mail-reader-toolbar{flex-shrink:0;gap:8px;margin-bottom:10px;flex-wrap:nowrap}.portable .mail-reader-toolbar>div{min-width:0;flex:1;display:block}.portable .mail-reader-toolbar label{display:none}.portable .mail-reader-toolbar button{font-size:12px;min-height:40px;white-space:nowrap}.portable .mail-reader-toolbar .select-trigger{width:100%;font-size:13px;min-height:40px}.portable .mail-reader{flex:1;min-height:0;display:flex;flex-direction:column;border-radius:12px 12px 0 0}.portable .mail-reader iframe{flex:1;min-height:0;height:100%;width:100%}.portable #mail-reader-status{font-size:11px;padding:10px;flex-shrink:0}.portable #mail-reader-status.mail-reader-connected{display:none}.portable.p-keyboard .p-nav{display:none}.portable.p-keyboard.p-chat .content,.portable.p-keyboard.p-mail .content{padding-bottom:0!important}.portable.p-keyboard #toast{bottom:12px}
@media(prefers-reduced-motion:reduce){.portable *{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
.portable .layout{padding-top:0}.portable .main{padding-top:0}.p-order-optional{border:1px solid #e8e0d2;border-radius:10px;padding:0 12px}.p-order-optional summary{padding:14px 0;cursor:pointer;font-size:12px;color:#96815c}.p-order-optional>div{display:grid;gap:14px;padding-bottom:14px}.portable .form-grid{padding-bottom:12px}.portable .dialog-content .form-footer{margin-top:14px}
.portable dialog{scroll-padding-top:76px;scroll-padding-bottom:90px}.p-order-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:16px 0}.p-order-actions button{min-height:44px;padding:8px;font-size:13px;border-radius:10px}.p-order-actions button[data-arg$="|confirm"],.p-order-actions button[data-arg$="|submit"],.p-order-actions button[data-arg$="|accept"]{background:#8a6a1e;border-color:#8a6a1e;color:#fff}.p-order-summary{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:14px;background:#f6f2e9;border-radius:10px;margin:12px 0}.p-order-summary dt{font-size:11px;color:#968567;margin-bottom:4px}.p-order-summary dd{font-size:13px;margin:0;overflow-wrap:anywhere;line-height:1.7}.p-tracking{border-top:1px solid #ece5d7;border-bottom:1px solid #ece5d7;margin:14px 0;padding:2px 0}.p-tracking summary{color:#927e56;cursor:pointer;font-size:12px;padding:12px 0}.p-tracking .actions{padding-bottom:12px}.portable .detail-grid{margin:12px 0}
/* Portable refinement: consistent rhythm, no negative-offset decorations. */
.portable{font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;--p-header:calc(54px + env(safe-area-inset-top,0px));--p-bottom:calc(62px + env(safe-area-inset-bottom,0px))}
.portable .p-header{padding-left:16px;padding-right:16px}.p-brand small{display:none}.p-brand>span:last-child{font-size:18px;letter-spacing:2px}.portable .p-brand .company-logo{width:32px;height:32px}
.portable .content{padding:20px 16px calc(var(--p-bottom) + 20px)}.portable h1{font-size:22px;line-height:1.35}.p-greeting,.p-title{margin-bottom:18px}.p-stats{padding:18px 0;margin-bottom:22px;box-shadow:none}.p-section{margin-bottom:22px}.p-data-links a{display:grid;grid-template-columns:24px minmax(0,1fr) 16px;gap:10px;padding:16px 12px;align-items:center}.p-data-links a>span{width:auto;min-width:0}.p-data-links a>svg:last-child{margin:0}.p-data-links small{font-size:11px;line-height:1.5}.p-data-links b{font-size:13px}.p-order-top{flex-wrap:wrap}.p-order-tags{flex-shrink:0}.p-order .chip{font-size:11px}.p-order-foot{font-size:12px}.p-order>strong{font-weight:600}.p-source,.p-data-empty{font-size:12px}.p-nav a{font-size:12px}.p-nav .p-tab-icon{padding:2px 16px}
.portable .mail-reader-page{padding:0;background:#fff}.portable .mail-reader-toolbar{padding:8px 12px;margin:0;border-bottom:1px solid #eee8dd;background:#fcfbf9;gap:8px}.portable .mail-reader-toolbar .select-trigger{background:transparent;border-color:transparent;min-height:36px;padding:6px 8px;font-size:13px}.portable .mail-reader-toolbar button{min-height:36px;padding:6px 10px;font-size:12px;border-radius:8px}.portable .mail-reader{border:0;border-radius:0;box-shadow:none;overflow:hidden}.portable .mail-reader iframe{display:block;border:0}.portable.p-mail .p-header{display:none}.portable.p-mail .mail-reader-toolbar{padding-top:calc(8px + env(safe-area-inset-top,0px))}
.portable .im-page-head{padding:10px 16px;min-height:54px}.portable #im-compose .im-compose-tools{gap:16px;flex-wrap:wrap}.portable .im-send-hint{display:none}.portable .im-compose-footer{justify-content:flex-end}.portable .im-thread-head>div{min-width:0}.portable .im-thread-head b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}
@media(max-width:374px){.p-data-links{grid-template-columns:1fr}.p-greeting{gap:8px}.p-create{padding:10px!important;font-size:12px!important}.p-stats strong{font-size:25px}}
.portable .p-brand .company-logo{flex:0 0 32px;aspect-ratio:1}.p-data-links a{position:relative;grid-template-columns:1fr;gap:10px;padding:16px}.p-data-links a>svg:last-child{position:absolute;right:14px;top:19px}.p-data-links b{font-size:14px}.p-data-links small{font-size:11px;line-height:1.6}
/* Connection controls are exceptional UI, not a permanent mobile header. */
.portable .mail-reader-toolbar{display:none!important}
.portable .mail-reader-page:has(.mail-reader-failed) .mail-reader-toolbar{display:flex!important}
.portable #mail-reader-status:not(.mail-reader-connected){padding:14px 16px;line-height:1.7}
/* Avatar sizing must not inherit the generic 40px button minimum. */
.portable .p-account{box-sizing:border-box;flex:0 0 40px;width:40px;height:40px;min-width:40px;min-height:40px;max-width:40px;max-height:40px;aspect-ratio:1;border-radius:50%;padding:0;display:grid;place-items:center;line-height:1}
.topbar-right>.avatar{box-sizing:border-box;flex-shrink:0;aspect-ratio:1;border-radius:50%;padding:0}
/* Consistent touch targets across the portable workspace. */
.portable button,.portable .select-trigger{min-height:44px}.portable .p-account{width:44px;height:44px;min-width:44px;min-height:44px;max-width:44px;max-height:44px;flex-basis:44px}.portable .p-scope button,.portable .p-filters button{min-height:44px}.portable .p-filters button{padding:9px 13px}.portable .p-back{min-height:44px}.portable .p-section header a,.portable .p-data-card header a{min-height:44px}
.portable .im-call-tools button,.portable #im-back{width:44px;min-width:44px;height:44px;min-height:44px}.portable #im-compose .im-file,.portable #im-record{min-height:44px;min-width:44px;display:inline-flex;align-items:center;justify-content:center}.portable #im-compose .im-compose-tools{gap:10px;margin-bottom:4px}.portable .im-compose-footer .primary,.portable .im-page-head>button{min-height:44px}.portable .im-thread-head{gap:6px}.portable #im-members{min-height:44px}
