/* 0.7.13: progressive smartphone workspace. No offline cache of private records. */
.mobile-topbar,.mobile-bottom-nav,.mobile-menu-close,.mobile-order-list{display:none}.mobile-menu-shade[hidden]{display:none!important}.skip-link{position:fixed;top:-100px;left:16px;z-index:1500;padding:12px;background:#fff;color:#111}.skip-link:focus{top:8px}
.portfolio-context{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin:0 0 14px;font-size:13px;color:#445165}.portfolio-context-dot{width:8px;height:8px;background:#cf2734;border-radius:50%}.portfolio-context>span:last-child{font-size:12px;color:#626e80}.scope-explanation{font-size:13px;line-height:1.55;background:#f0f5fa;border:1px solid #dce6ef;border-radius:10px;padding:12px;margin:0 0 16px;color:#40566e}
.portfolio-account-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.portfolio-account{margin:0!important}.portfolio-account label{display:block;margin-top:16px}.portfolio-account input,.portfolio-account select{width:100%}.portfolio-account .panel-heading{gap:10px;flex-wrap:wrap}.portfolio-account .panel-heading h2{margin:0}.portfolio-account p{overflow-wrap:anywhere}.customer-quick-actions{display:flex;flex-wrap:wrap;gap:10px;margin:0 0 18px}.customer-quick-actions .button{gap:8px;display:inline-flex;align-items:center}.customer-quick-actions .app-icon{width:19px;height:19px}.backup-job-progress{width:100%;height:16px;accent-color:#c82534;margin:16px 0}.backup-job-meta{display:flex;flex-wrap:wrap;gap:18px;font-size:13px}.backup-job-actions{display:flex;flex-wrap:wrap;gap:10px;margin:20px 0}.backup-job-error{white-space:pre-wrap;overflow-wrap:anywhere}.backup-digest{overflow-wrap:anywhere;font-size:12px}.mobile-filter-options>summary{font-weight:700;cursor:pointer;padding:12px 0}.mobile-filter-options{border-top:1px solid #e4e9ee}.mobile-filter-options>div{display:grid;gap:12px}.mobile-segment-picker>summary{padding:12px;font-weight:700}.mobile-segment-picker{border:1px solid #dde4ec;border-radius:12px;margin:12px 0}.mobile-segment-picker .sales-segments{padding:0 12px}
:where(a,button,input,select,textarea,summary):focus-visible{outline:3px solid #2e72b8;outline-offset:3px}html{scroll-padding-bottom:160px;scroll-padding-top:90px}.check-label{display:flex;gap:12px;align-items:flex-start}.check-label input{width:22px;min-width:22px;height:22px}
@media(min-width:1001px){.sidebar{display:flex;flex-direction:column;height:100vh;overflow:hidden}.sidebar nav{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain}.sidebar-status{flex-shrink:0}.mobile-menu-shade{display:none}.mobile-filter-options{display:contents}.mobile-filter-options>summary{display:none}}
@media(max-width:1000px){
:root{--mobile-bottom:calc(65px + env(safe-area-inset-bottom));--mobile-top:calc(63px + env(safe-area-inset-top))}
body.app-page{display:block!important;background:#f3f5f8;font-size:16px;padding:0!important;overflow-x:clip}body.mobile-menu-open{overflow:hidden}
.mobile-topbar{display:flex;position:sticky;top:0;z-index:110;min-height:var(--mobile-top);padding:calc(10px + env(safe-area-inset-top)) 16px 10px;align-items:center;justify-content:space-between;background:#fff;border-bottom:1px solid #e1e6ec;gap:10px}
.mobile-brand{display:flex;align-items:center;gap:10px;color:#172536;text-decoration:none;min-width:0}.mobile-brand>span{display:grid;place-items:center;background:#cf2634;color:#fff;width:38px;height:38px;border-radius:11px;font-size:17px;font-weight:900}.mobile-brand b{font-size:16px;line-height:1.3}.mobile-brand small{display:block;color:#667488;font-size:11px;font-weight:500;margin-top:3px}.mobile-icon-button{display:grid;place-items:center;width:46px;height:44px;border:1px solid #dbe2eb;border-radius:11px;background:#fff}.mobile-icon-button svg{width:23px;height:23px}
body.app-page .sidebar{display:flex!important;flex-direction:column;position:fixed!important;inset:0 auto 0 0!important;width:min(88vw,360px)!important;max-width:360px;min-width:0;height:100dvh;max-height:100dvh;z-index:130;transform:translateX(-105%);visibility:hidden;transition:transform .2s ease,visibility .2s;padding:18px 14px!important;overflow:hidden;margin:0!important;border-radius:0!important}body.app-page.mobile-menu-open .sidebar{transform:translateX(0);visibility:visible}.sidebar .brand{margin:4px 4px 14px}.sidebar nav{display:block!important;flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-right:4px}.sidebar .nav-item{min-height:46px;white-space:normal;font-size:14px;padding:11px 12px;margin:3px 0}.sidebar .nav-section-title{margin:16px 12px 7px}.sidebar .sidebar-status{display:block!important;padding:10px 12px 4px;margin-top:8px;font-size:12px;flex-shrink:0}.sidebar-status .sidebar-status-row,.sidebar-access,.sidebar-divider{display:none}.sidebar-status .sidebar-account-details{margin-top:8px}.sidebar-status .sidebar-account-details summary{min-height:44px;padding:10px 0}.sidebar-status .button{min-height:44px}.mobile-menu-close{display:block;align-self:flex-end;min-height:44px;padding:8px 14px;background:#2a323f;color:#fff;border:1px solid #596371;border-radius:10px;margin-bottom:6px;font:inherit}.mobile-menu-shade{position:fixed;inset:0;z-index:125;border:0;padding:0;background:rgba(14,24,38,.48)}
.desktop-shell{margin:0!important;width:100%!important;min-width:0;display:block!important}.main-shell,.main-shell.with-desktop-header{margin:0!important;padding:18px 14px calc(var(--mobile-bottom) + 24px)!important;width:100%!important;min-width:0;max-width:none!important}.desktop-topbar{display:none!important}.portfolio-context{font-size:12px;margin-bottom:12px}.portfolio-context>span:last-child{font-size:11px}.scope-explanation{font-size:12px;line-height:1.5}
.mobile-bottom-nav{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));position:fixed;bottom:0;left:0;right:0;height:var(--mobile-bottom);padding:5px 4px calc(5px + env(safe-area-inset-bottom));background:#fff;border-top:1px solid #dfe5ed;z-index:115;box-shadow:0 -3px 18px #1022390a}.mobile-bottom-nav a,.mobile-bottom-nav button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:52px;border:0;border-radius:10px;background:transparent;color:#5d6c7e;text-decoration:none;font:inherit;font-size:10px;font-weight:600;cursor:pointer}.mobile-bottom-nav svg{width:21px;height:21px}.mobile-bottom-nav [aria-current=page]{color:#b51f2d;background:#fff0f1}.mobile-bottom-nav [aria-expanded=true]{background:#edf2f7;color:#233849}.keyboard-open .mobile-bottom-nav{display:none}
.app-page .button,.app-page button:not(.mobile-bottom-nav button),.app-page select,.app-page input:not([type=checkbox]):not([type=radio]):not([type=hidden]){min-height:46px}.app-page input,.app-page select,.app-page textarea{font-size:16px!important;max-width:100%;min-width:0}.app-page input[type=checkbox],.app-page input[type=radio]{min-height:22px;width:22px;height:22px}.app-page label{min-width:0;line-height:1.5}.app-page .button{font-size:14px;padding:11px 14px;white-space:normal;line-height:1.4;text-align:center}.app-page .form-grid,.app-page .form-grid.three,.app-page .form-grid.two,.app-page .desktop-order-filters{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:14px}.app-page .span-two,.app-page .span-three{grid-column:auto!important}.app-page .form-actions{display:flex;flex-wrap:wrap;gap:8px}.app-page .form-actions .button{flex:1}.panel{border-radius:14px!important;max-width:100%;min-width:0}.compact-panel,.desktop-filter-panel{padding:18px!important}.panel-heading,.desktop-panel-heading,.page-header{align-items:flex-start;gap:12px;flex-wrap:wrap}.page-header h1,.app-page h1{font-size:25px;line-height:1.2;overflow-wrap:anywhere}.app-page h2{font-size:19px;line-height:1.35;overflow-wrap:anywhere}.app-page p{line-height:1.6;overflow-wrap:anywhere}.desktop-result-count{font-size:12px;white-space:normal}.saved-filters-bar{overflow-x:auto;max-width:100%}.portfolio-account-grid{grid-template-columns:1fr}.portfolio-account .badge{font-size:11px}
.mobile-order-list{display:grid;gap:13px;margin:18px 0}.mobile-order-card{background:#fff;border:1px solid #dfe6ef;border-radius:15px;padding:17px;box-shadow:0 2px 5px #182c4310}.mobile-order-card h2{font-size:18px!important;margin:9px 0;line-height:1.4}.mobile-order-card h2 a{text-decoration:none;color:#192b40;display:block;min-height:44px}.mobile-order-card-top{display:flex;justify-content:space-between;gap:8px;font-size:12px;color:#657589}.mobile-new-response{color:#b12031;font-weight:700}.mobile-order-reference{font-size:12px;color:#627187;margin:6px 0 15px}.mobile-order-facts{display:flex;align-items:center;justify-content:space-between;gap:12px}.mobile-order-facts>strong{font-size:20px;color:#1d354b;text-align:right;white-space:nowrap}.mobile-order-facts small{display:block;font-size:10px;font-weight:400;margin-top:3px}.mobile-order-facts .commission-state{white-space:normal;font-size:11px;line-height:1.4}.mobile-order-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid #e7ecf2;padding-top:12px;margin-top:14px}.mobile-order-footer>span{font-size:11px;color:#66778b;flex:1}.mobile-order-footer .button{min-height:44px;flex-shrink:0;font-size:12px;padding:10px}.desktop-orders-table>.table-scroll{display:none!important}.desktop-orders-table{background:transparent!important;border:0!important;box-shadow:none!important}.pagination{padding:14px 0!important;display:flex;gap:10px;flex-wrap:wrap;align-items:center;justify-content:space-between}.pagination .button{min-width:84px}
.sales-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:16px 0}.sales-summary strong{font-size:23px}.sales-summary small{font-size:12px;line-height:1.45}.sales-summary .sales-text-value{font-size:16px}.sales-segments{grid-template-columns:1fr!important}.sales-nav{gap:8px}.sales-nav a{min-height:44px;display:flex;align-items:center;font-size:13px}.sales-summary>a,.sales-summary>div{padding:14px}.sales-inline-actions{display:flex;gap:8px;width:100%}.sales-inline-actions .button{flex:1;min-width:0}.customer-quick-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-bottom:15px}.customer-quick-actions .button{font-size:12px;padding:10px 6px;display:flex;justify-content:center}.customer-quick-actions .app-icon{width:17px}.sales-detail-grid{display:flex;flex-direction:column;gap:0}.profile-grid{grid-template-columns:1fr!important}.profile-grid strong{font-size:16px}.profile-actions a{min-height:44px;display:flex;align-items:center;font-size:14px}.profile-grid a{overflow-wrap:anywhere}.sales-results>.panel-heading{padding:16px!important}.sales-source{font-size:12px!important}.customer-page .sales-results{background:transparent!important;border:0!important;box-shadow:none!important}.customer-page .sales-results>.panel-heading{padding:10px 0!important}
/* Table markup is preserved for existing editing scripts. Labels are progressive enhancement. */
.table-scroll{max-width:100%;overflow-x:auto}table.mobile-cards{width:100%!important;min-width:0!important;border-collapse:separate!important;display:block}table.mobile-cards>thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}table.mobile-cards>tbody{display:grid;gap:14px;width:100%}table.mobile-cards>tbody>tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 12px;padding:16px!important;border:1px solid #dfe6ef;border-radius:14px;background:#fff;width:100%}table.mobile-cards>tbody>tr>td{display:block;min-width:0!important;max-width:none!important;width:auto!important;white-space:normal!important;text-align:left!important;border:0!important;padding:8px 0!important;font-size:14px;line-height:1.5;overflow-wrap:anywhere}table.mobile-cards>tbody>tr>td:before{content:attr(data-label);display:block;font-size:10px;letter-spacing:.04em;text-transform:uppercase;font-weight:700;color:#65768b;margin-bottom:6px}table.mobile-cards>tbody>tr>td:first-child{grid-column:1/-1;font-size:16px;font-weight:600}table.mobile-cards>tbody>tr>td:first-child:before{display:none}table.mobile-cards>tbody>tr>td[colspan],table.mobile-cards>tbody>tr>td.sales-reason,table.mobile-cards>tbody>tr>td:last-child{grid-column:1/-1}table.mobile-cards>tbody>tr>td:last-child .button{width:100%;display:flex;align-items:center;justify-content:center}table.mobile-cards small{font-size:12px;font-weight:400}table.mobile-cards .sales-reason{font-weight:400}.sales-table .sales-client a strong{font-size:17px}.sales-table .sales-priority{font-size:12px}.sales-table ul{padding-left:18px;font-size:14px}
.order-tabs{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));padding:6px!important;gap:5px;overflow:visible!important;border:1px solid #dfe6ef;border-radius:12px!important;margin:14px 0}.order-tabs a{min-width:0!important;min-height:46px;white-space:normal!important;line-height:1.3;display:flex;justify-content:center;align-items:center;font-size:11px;padding:8px 5px!important;text-align:center;border-radius:8px}.order-tabs a.active{background:#fff0f2;color:#b12433}.order-header,.order-workspace-header,.commission-header{flex-wrap:wrap;gap:10px;padding:16px!important}.order-header h1,.commission-title{font-size:24px!important;white-space:normal!important}.commission-document-filters,.commission-document-summary,.summary-grid,.check-grid,.metric-grid,.kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px}.commission-document-filters{grid-template-columns:1fr!important;padding:12px!important}.commission-document-summary{padding:0 12px 14px!important}.commission-document-summary article{display:block;padding:12px}.commission-document-summary .document-summary-icon{display:none}.document-filter-chips{flex-wrap:wrap}.filter-chip{flex:1;min-height:44px!important;padding:8px}.commission-workspace,.order-detail-grid,.detail-grid,.workspace-grid,.order-overview-grid,.two-column{display:block!important}.commission-workspace>*{min-width:0}.summary-grid article{min-width:0;padding:14px}.summary-grid article strong{font-size:21px;overflow-wrap:anywhere}.check-grid{grid-template-columns:1fr!important}.check-grid article{gap:12px;min-width:0}.autosave-indicator{bottom:calc(var(--mobile-bottom) + 8px)!important;max-width:calc(100vw - 24px);left:12px;right:12px}.conflict-dialog{width:calc(100vw - 28px);max-height:calc(100dvh - 80px);padding:18px}.app-page dialog{max-width:calc(100vw - 28px);overflow:auto}.backup-job-actions .button{flex:1}.backup-job-meta{flex-direction:column;gap:6px}.backup-progress-panel{padding:18px!important}
}
@media(max-width:380px){.main-shell,.main-shell.with-desktop-header{padding-left:10px!important;padding-right:10px!important}.customer-quick-actions .app-icon{display:none}.mobile-brand b{font-size:15px}.mobile-order-facts>strong{font-size:18px}.mobile-bottom-nav a,.mobile-bottom-nav button{font-size:10px}}
@media(prefers-reduced-motion:reduce){.sidebar{transition:none!important}*{scroll-behavior:auto!important}}

.mobile-topbar-actions{display:flex;gap:8px;align-items:center;flex-shrink:0}.mobile-topbar-actions .mobile-icon-button{color:#22354b;text-decoration:none;flex-shrink:0}

/* Compact summary without duplicating fields or changing the save forms. */
.mobile-order-details>summary{padding:14px 2px;cursor:pointer;font-weight:600;font-size:13px;line-height:1.5;color:#334e69}
@media(min-width:1001px){.mobile-order-details{display:contents}.mobile-order-details>summary{display:none}}
@media(max-width:1000px){
.commission-summary-surface{padding:15px!important}.commission-summary-primary{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:14px!important}.commission-summary-primary .customer-cell{grid-column:1/-1}.commission-summary-primary .customer-cell strong{font-size:20px!important;line-height:1.4;white-space:normal!important}.commission-summary-primary article{min-width:0}.commission-summary-primary strong{font-size:14px;white-space:normal!important;overflow-wrap:anywhere}.commission-copy-actions{grid-column:1/-1;display:flex;gap:8px}.commission-copy-actions .button{flex:1;font-size:12px!important}.commission-summary-secondary{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:14px!important;margin-top:0!important}.commission-summary-secondary article:nth-child(3),.commission-summary-secondary .order-type-summary{grid-column:1/-1}.commission-summary-secondary article{min-width:0}.commission-summary-secondary strong{white-space:normal!important;overflow-wrap:anywhere}.commission-summary-secondary .order-type-form{display:flex!important;gap:8px;min-width:0}.commission-summary-secondary .order-type-form select{flex:1;min-width:0}
.draft-workflow-summary{display:flex!important;flex-direction:column;min-width:0;gap:12px;padding:16px!important}.draft-workflow-summary>div{min-width:0;width:100%}.draft-workflow-summary dl{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;width:100%;gap:12px!important}.draft-workflow-summary dl>div{min-width:0!important;padding:0!important}.draft-workflow-summary dd{white-space:normal!important;font-size:11px;overflow-wrap:anywhere}.draft-workflow-summary .draft-alert-icon{display:none}
table.mobile-cards .sales-client a,table.mobile-cards .sales-client strong{white-space:normal!important;overflow-wrap:anywhere!important;max-width:100%}
}
