/* Desktop WeCom workspace: reuse the mobile DOM and business actions. */
.desktop-nav-only{display:none!important}

@media(min-width:1024px){
  body{--desktop-rail:168px;--desktop-header:58px;--desktop-line:#e7e3e3;--desktop-accent:#b4232c}
  body #appShell:not(.hidden)>.topbar,
  body:not(.home-screen) #appShell:not(.hidden)>.topbar{
    display:flex!important;position:sticky!important;top:0;z-index:70;
    height:var(--desktop-header)!important;min-height:var(--desktop-header)!important;
    padding:0 24px!important;background:#fff!important;border-bottom:1px solid var(--desktop-line)!important;
    box-shadow:none!important;backdrop-filter:none!important;
  }
  #appShell .brand{min-width:0;gap:10px}
  #appShell .brand-mark{width:32px;height:32px;flex:none}
  #appShell .brand-title strong{font-size:16px!important;white-space:nowrap}
  #appShell .brand-copy small,#appShell .brand-title em{display:none!important}
  #appShell .account{min-width:0;gap:14px;font-size:13px;flex-wrap:wrap}
  #appShell .account select{max-width:340px;min-height:34px!important;font-size:13px!important}
  #appShell .current-company{max-width:340px;white-space:normal;overflow-wrap:anywhere}
  body #appShell:not(.hidden)>.workspace,
  body:not(.home-screen) #appShell:not(.hidden)>.workspace{
    width:calc(100% - var(--desktop-rail))!important;max-width:none!important;
    min-height:calc(100dvh - var(--desktop-header));margin:0 0 0 var(--desktop-rail)!important;
    padding:16px 24px 28px!important;background:#fcfaf9!important;
  }
  body #appShell:not(.hidden)>.portal-bottom-nav{
    display:flex!important;flex-direction:column;align-items:stretch;justify-content:flex-start;
    position:fixed!important;left:0!important;right:auto!important;top:var(--desktop-header)!important;bottom:0!important;
    width:var(--desktop-rail)!important;max-width:none!important;height:auto!important;max-height:calc(100dvh - var(--desktop-header));
    padding:16px 10px!important;margin:0!important;gap:4px;overflow-y:auto;
    transform:none!important;background:#fff!important;border:0!important;border-right:1px solid var(--desktop-line)!important;
    box-shadow:none!important;backdrop-filter:none!important;z-index:60!important;
  }
  body #appShell>.portal-bottom-nav button{
    display:flex!important;align-items:center;justify-content:flex-start;gap:10px!important;
    width:100%;min-height:40px;padding:9px 12px!important;border:0;border-radius:6px;
    background:transparent;color:#656970!important;text-align:left;flex:none;
  }
  body #appShell>.portal-bottom-nav button span{display:grid;place-items:center;width:22px;height:22px!important;flex:none}
  body #appShell>.portal-bottom-nav button span svg{width:19px!important;height:19px!important;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
  body #appShell>.portal-bottom-nav button strong{font-size:13px!important;font-weight:600!important;line-height:1.4!important}
  body #appShell>.portal-bottom-nav button:hover{background:#f8f4f4}
  body #appShell>.portal-bottom-nav button:focus-visible{outline:2px solid var(--desktop-accent);outline-offset:1px}
  body #appShell>.portal-bottom-nav button.active,
  body:has(#claimFlow:not(.hidden)) #appShell>.portal-bottom-nav [data-desktop-shortcut="startExpense"],
  body:has(:is(#selfDriveView,#driveRecordsView):not(.hidden)) #appShell>.portal-bottom-nav [data-desktop-shortcut="openSelfDrive"],
  body:has(#invoiceSearchView:not(.hidden)) #appShell>.portal-bottom-nav [data-desktop-shortcut="openInvoiceSearch"]{background:#f9eded;color:var(--desktop-accent)!important}
  body #appShell>.portal-bottom-nav .desktop-nav-only{display:flex!important}
  #appShell>.portal-bottom-nav [data-bottom-nav="home"]{order:0}
  #appShell>.portal-bottom-nav [data-desktop-shortcut="startExpense"]{order:1}
  #appShell>.portal-bottom-nav [data-bottom-nav="documents"]{order:2}
  #appShell>.portal-bottom-nav [data-desktop-shortcut="openSelfDrive"]{order:3}
  #appShell>.portal-bottom-nav [data-bottom-nav="trip"]{order:4}
  #appShell>.portal-bottom-nav [data-bottom-nav="risk-rules"]{order:5}
  #appShell>.portal-bottom-nav [data-bottom-nav="invoice-titles"]{order:6}
  #appShell>.portal-bottom-nav [data-desktop-shortcut="openInvoiceSearch"]{order:7}
  #appShell>.portal-bottom-nav [data-desktop-shortcut="openModelSettings"]{order:8}
  body #appShell>.portal-bottom-nav [data-desktop-shortcut="openInvoiceSearch"]{display:none!important}
  body:has(#openInvoiceSearch:not(:disabled):not(.hidden)) #appShell>.portal-bottom-nav [data-desktop-shortcut="openInvoiceSearch"]{display:flex!important}
  body #appShell>.portal-bottom-nav [data-desktop-shortcut="openModelSettings"]{display:none!important}
  body:has(#openModelSettings:not(.hidden)) #appShell>.portal-bottom-nav [data-desktop-shortcut="openModelSettings"]{display:flex!important}
  body.company-pending #appShell>.portal-bottom-nav{display:none!important}
  body.company-pending #appShell:not(.hidden)>.workspace{width:100%!important;margin-left:0!important}
  body #appShell .workspace>:is(#homeView,.claim-flow,.documents-view,.admin-feature-view,.trip-planner-view){
    width:100%!important;max-width:1320px!important;min-width:0;margin:0 auto!important;padding:0 0 16px!important;border:0!important;
  }
  body:not(.home-screen) :is(.documents-head,.claim-flow-head){
    position:static!important;min-height:44px;margin:0 0 12px!important;padding:0!important;
    grid-template-columns:32px minmax(0,1fr) auto;gap:8px;border:0!important;border-bottom:1px solid var(--desktop-line)!important;
    background:transparent!important;backdrop-filter:none;
  }
  body:not(.home-screen) :is(.documents-head,.claim-flow-head)>div{text-align:left!important}
  body:not(.home-screen) :is(.documents-head h1,.claim-flow-head strong){font-size:19px!important}
  body:not(.home-screen) .round-back{width:32px!important;height:32px!important;min-width:32px!important}
  body:not(.home-screen) :is(.button,input,select){min-height:36px}
  body:not(.home-screen) .button{padding:7px 12px;font-size:13px}
  body:not(.home-screen) #claimFlow .stepper{display:flex!important;max-width:760px;margin:4px 0 18px!important;gap:0}
  body:not(.home-screen) #claimFlow .stepper button{display:flex;align-items:center;gap:6px;min-width:0;font-size:12px}
  body:not(.home-screen) #claimFlow .stepper button b{width:24px;height:24px;font-size:12px;box-shadow:none}
  body:not(.home-screen) #claimFlow .stepper i{margin:12px 10px 0}
  body:not(.home-screen) #step1 .claim-create-grid{display:block!important;max-width:1000px}
  body:not(.home-screen) #claimFlow #claimForm{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 24px!important}
  body:not(.home-screen) #claimForm>:is(.claim-section-label,.field-group,.claim-basic-grid,.claim-purpose-field,.travel-fields,.claim-form-actions){grid-column:1/-1}
  body:not(.home-screen) #claimFlow .claim-basic-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:24px!important}
  body:not(.home-screen) #claimFlow .travel-fields{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px 24px!important}
  body:not(.home-screen) #claimFlow .travel-fields>.two-cols{grid-column:1/-1;gap:24px!important}
  body:not(.home-screen) #claimFlow :is(.claim-form-actions,.action-bar){width:100%;position:static!important;justify-content:flex-end!important}
  body:not(.home-screen) #claimFlow .action-bar .button.primary{flex:0 0 auto;min-width:160px}
  body:not(.home-screen) #step2 .invoice-entry-grid{max-width:620px;grid-template-columns:repeat(3,minmax(0,1fr))!important}
  body:not(.home-screen) #step2 .pending-picker-entry{min-height:48px;max-width:100%;display:flex!important;justify-content:space-between}
  body:not(.home-screen) #step2 .collection-fields{max-width:1000px}
  body:not(.home-screen) #step3 .summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:0 24px!important}
  body:not(.home-screen) #step3 .invoice-compact-row{min-height:46px!important}
  body:not(.home-screen) #step3 .invoice-compact-open strong{font-size:13px!important}
  body:not(.home-screen) #step3 .invoice-compact-open time{min-width:70px;text-align:right}
  body:not(.home-screen) #step4 .decision-card{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:24px!important;align-items:start}
  body:not(.home-screen) #step5 .workflow-grid{grid-template-columns:minmax(0,1.05fr) minmax(380px,.95fr)!important;gap:28px!important;align-items:start}
  body:not(.home-screen) #step5 .workflow-grid>section{min-width:0}
  body:not(.home-screen) #step5 #launchWorkflow{width:auto!important;min-width:180px}
  body:not(.home-screen) #documentsView .document-tabs{max-width:620px;margin-bottom:12px}
  body:not(.home-screen) #documentsView :is(.claim-document-column-head,.document-claim-open){grid-template-columns:110px minmax(180px,1fr) 120px 130px 160px!important;gap:14px!important}
  body:not(.home-screen) #documentsView .claim-document-column-head{padding-right:64px!important;background:#f3efef;border-bottom:1px solid var(--desktop-line);font-size:12px!important}
  body:not(.home-screen) #documentsView .claim-document-column-head span:nth-child(n+4){text-align:right}
  body:not(.home-screen) #documentsView .compact-document-row .document-claim-open{min-height:46px!important;padding:7px 2px!important}
  body:not(.home-screen) #documentsView .document-claim-open :is(time,span){font-size:12px!important}
  body:not(.home-screen) #documentsView .document-claim-open strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  body:not(.home-screen) #documentsView .document-claim-open b{text-align:right}
  body:not(.home-screen) #documentsView .claim-export-toolbar{display:flex!important;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px!important}
  body:not(.home-screen) #documentsView .claim-export-controls{flex:1;justify-content:flex-end}
  body:not(.home-screen) #documentsView .pending-group-toggle{grid-template-columns:minmax(0,1fr) auto!important;gap:14px}
  body:not(.home-screen) #documentsView .pending-group-toggle>span:first-child{display:grid!important;grid-template-columns:110px minmax(0,1fr)!important;gap:14px!important;min-width:0}
  body:not(.home-screen) #documentsView .pending-group-summary{justify-content:flex-end}
  body:not(.home-screen) #documentsView .pending-inline-detail{gap:16px!important}
  body:not(.home-screen) #documentsView .pending-inline-detail strong{font-size:13px!important}
  body:not(.home-screen) #documentsView .pending-inline-detail b{min-width:100px;text-align:right}
  body:not(.home-screen) #documentsView .pending-inline-detail time{min-width:70px;text-align:right}
  body:not(.home-screen) #documentsView .pending-doc-state{min-width:64px;text-align:center;font-size:11px!important}
  body:not(.home-screen) #documentsView .pending-group-actions{justify-content:flex-end;gap:8px}
  body:not(.home-screen) #documentsView .pending-group-actions .pending-group-delete{margin-left:0}
  body:not(.home-screen) #selfDriveView .drive-form{grid-template-columns:repeat(2,minmax(0,1fr))!important;max-width:1000px;gap:12px 24px!important}
  #selfDriveView .drive-form .drive-wide{grid-column:1/-1}
  #selfDriveView .drive-form>button[type=submit]{width:auto;min-width:160px;justify-self:end}
  #selfDriveView .drive-records-entry{max-width:1100px}
  #driveRecordsView .drive-record-filters{grid-template-columns:minmax(240px,1fr) 180px 180px;max-width:900px}
  body:not(.home-screen) :is(#invoiceTitlesView,#riskRulesView) .feature-list{display:block!important}
  body:not(.home-screen) :is(#invoiceTitlesView,#riskRulesView) .feature-card{padding:12px 0!important}
  body:not(.home-screen) .feature-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px 24px!important}
  body:not(.home-screen) .feature-form-grid :is(textarea,.feature-form-actions){grid-column:1/-1}
  body:not(.home-screen) #tripPlannerView .trip-planner-layout{display:grid!important;grid-template-columns:minmax(360px,.9fr) minmax(0,1.1fr)!important;gap:24px!important;align-items:start}
  body:not(.home-screen) .trip-side-column{min-width:0}
  body:not(.home-screen) .modal{padding:24px!important;align-items:center!important}
  body:not(.home-screen) .modal-card{width:min(760px,calc(100vw - 48px))!important;max-width:760px!important;max-height:calc(100dvh - 48px)!important;overflow-y:auto;overscroll-behavior:contain}
  body .modal .modal-actions{display:flex!important;justify-content:flex-end!important;gap:10px!important;flex:none}
  body .modal .modal-actions .button{width:auto!important;flex:0 0 auto!important;min-width:110px;min-height:38px!important;padding:8px 18px!important}
  body:not(.home-screen) #pendingPickerModal .pending-picker-modal-card{width:min(900px,calc(100vw - 48px))!important;max-width:900px!important}
  body:not(.home-screen) #pendingPickerGroupList{max-height:60dvh!important}
  body #drivePickerModal .modal-card{width:min(900px,calc(100vw - 48px))!important;max-width:900px!important;max-height:calc(100dvh - 48px)!important}
  #drivePickerModal .drive-picker-row{font-size:13px}
  #driveRecordsView .drive-record summary{grid-template-columns:85px minmax(0,1fr) 100px 100px 20px;gap:14px;font-size:13px}
  body #invoicePreviewModal .invoice-preview-modal-card{width:min(1160px,calc(100vw - 48px))!important;max-width:1160px!important;max-height:calc(100dvh - 48px)!important;overflow:auto;padding:22px!important}
  body #invoicePreviewModal .invoice-preview-modal-card.has-original{display:grid;grid-template-columns:minmax(280px,.8fr) minmax(0,1.2fr);grid-template-rows:auto auto minmax(0,1fr) auto;gap:10px 24px}
  #invoicePreviewModal .has-original #invoicePreviewTitle{grid-column:1/-1;grid-row:1;margin:0;padding-right:40px;font-size:18px}
  #invoicePreviewModal .has-original #invoicePreviewDetails{grid-column:1;grid-row:2/4;min-width:0;max-height:65dvh;overflow:auto;align-self:start}
  #invoicePreviewModal .has-original #toggleInvoiceOriginal{grid-column:2;grid-row:2;justify-self:start;width:auto;margin:0}
  #invoicePreviewModal .has-original #invoicePreviewFrame{grid-column:2;grid-row:3;min-width:0;height:58dvh;max-height:58dvh;overflow:auto;border:1px solid var(--desktop-line);border-radius:6px;background:#f4f4f4}
  #invoicePreviewModal .has-original #invoicePreviewImage{display:block;width:100%;height:auto;object-fit:contain}
  #invoicePreviewModal .has-original #invoicePreviewNote{grid-column:1/-1;grid-row:4}
  #invoicePreviewModal .invoice-detail-list>div{font-size:13px;padding:8px 0}
  #invoicePreviewModal .modal-close{position:absolute;right:12px;top:12px}
  body #modelSettingsDialog{width:min(820px,calc(100vw - 48px));max-width:820px;max-height:calc(100dvh - 48px);overflow:auto}
  body.home-screen #homeView .portal-welcome{aspect-ratio:auto!important;min-height:190px;height:240px;background-size:auto 100%;background-position:right center}
  body.home-screen #homeView .portal-app-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
  .isolation-compatibility-notice{left:calc(var(--desktop-rail) + 24px)!important;right:24px!important;bottom:12px!important;max-width:900px}
}

@media(min-width:1024px) and (max-width:1199px){
  body{--desktop-rail:144px}
  body #appShell:not(.hidden)>.workspace,body:not(.home-screen) #appShell:not(.hidden)>.workspace{padding-left:16px!important;padding-right:16px!important}
  body:not(.home-screen) #documentsView :is(.claim-document-column-head,.document-claim-open){grid-template-columns:90px minmax(130px,1fr) 80px 100px 120px!important;gap:10px!important}
  body:not(.home-screen) #step5 .workflow-grid{grid-template-columns:minmax(0,1fr) minmax(320px,1fr)!important;gap:20px!important}
  body:not(.home-screen) #tripPlannerView .trip-planner-layout{grid-template-columns:1fr!important}
}
