/* StormCore action finish: screen-only; navigation, calendar dates and print stay native. */
@layer stormcore-actions {
@media screen {
  :where(#platformHome,#productionWorkspace,#workspaceModule,#platformEstimate,#modalBody,#stormcoreAuthGate,
    .sc-confirm-dialog,.sc-location-consent,.fieldcam-delete,.workflow-content,.workflow-summary,
    .workflow-project-actions,.workflow-next,.estimateActions,.proposalActions,.modal,.sc-measure-dialog,.roofProductDialog)
  :is(button,a.secondary,a.module-primary,a.hosted-payment-button,.schedule-actions>a):not(:where(.workday-calendar button,.close,.fieldcam-delete-close,.sc-close,.dot,.customer-expand,
    .record-picker,.resource-link,.schedule-period-day>button)) {
    --sc-action-fill:linear-gradient(135deg,#0878dd,#075fc7);
    --sc-action-ink:#fff;
    --sc-action-border:#238de8;
    box-sizing:border-box!important;
    align-items:center!important;justify-content:center!important;
    gap:6px!important;min-height:40px!important;min-width:40px!important;max-width:100%!important;
    height:auto!important;padding:7px 12px!important;border:1px solid var(--sc-action-border)!important;
    border-radius:8px!important;background:var(--sc-action-fill)!important;color:var(--sc-action-ink)!important;
    font:650 12.5px/1.3 system-ui,-apple-system,"Segoe UI",sans-serif!important;letter-spacing:.01em!important;
    white-space:normal!important;word-break:normal!important;overflow-wrap:normal!important;hyphens:none!important;
    text-align:center!important;text-decoration:none!important;flex:0 1 auto!important;
    box-shadow:inset 0 1px 0 #ffffff26,0 3px 8px #02162625!important;
    transition:background-color .16s,border-color .16s,box-shadow .16s!important;
    cursor:pointer;
  }
  :where(#platformHome,#productionWorkspace,#workspaceModule,#platformEstimate,#modalBody,#stormcoreAuthGate,
    .sc-confirm-dialog,.sc-location-consent,.fieldcam-delete,.workflow-content,.workflow-summary,
    .workflow-project-actions,.workflow-next,.estimateActions,.proposalActions,.modal,.sc-measure-dialog,.roofProductDialog)
  :is(button,a.secondary,a.module-primary,a.hosted-payment-button,.schedule-actions>a):focus-visible {
    outline:3px solid #0788ec!important;outline-offset:3px!important;
  }
  :where(#platformHome,#productionWorkspace,#workspaceModule,#platformEstimate,#modalBody,#stormcoreAuthGate,
    .sc-confirm-dialog,.workflow-content,.workflow-summary,.workflow-project-actions,.workflow-next,.modal,.sc-measure-dialog)
  :is(.primary,.module-primary,.production-new,.workday-add-appointment,.schedule-add-appointment,
    .sc-home-primary,[type=submit],#stormcoreAuthSubmit,a.hosted-payment-button) {
    --sc-action-fill:linear-gradient(135deg,#0878dd,#075fc7);
    --sc-action-ink:#fff;--sc-action-border:#238de8;
    box-shadow:0 1px 0 #70dfff80 inset,0 3px 8px #0655a829!important;
  }
  :where(#platformHome,#productionWorkspace,#workspaceModule,#modalBody,.workflow-content,.workflow-summary)
  button:is([aria-pressed=true],[aria-selected=true],.active) {
    --sc-action-fill:linear-gradient(135deg,#164e79,#102e49);--sc-action-ink:#fff;--sc-action-border:#153f60;
    box-shadow:0 1px 0 #58cfff50 inset,0 2px 5px #102e491c!important;
  }
  :where(#modalBody,.sc-confirm-dialog,.fieldcam-delete,.workflow-content,.modal)
  :is(button.danger,button.destructive,#confirmDelete,[data-discard]) {
    --sc-action-fill:linear-gradient(135deg,#ba3447,#9b2437);--sc-action-ink:#fff;--sc-action-border:#932135;
  }
  :where(#platformHome,#productionWorkspace,#workspaceModule,#modalBody,#stormcoreAuthGate,.workflow-content,
    .workflow-summary,.workflow-project-actions,.workflow-next,.modal,.sc-measure-dialog)
  button:disabled {opacity:.52!important;cursor:not-allowed!important;box-shadow:none!important;}

  :where(#platformHome,#productionWorkspace,#workspaceModule,#modalBody,.workflow-content,.workflow-next,.modal)
  :is(.module-actions,.form-actions,.customer-file-actions,.schedule-actions,.sc-confirm-actions,
    .workday-schedule-actions,.dispatch-links,.estimateActions,.workflow-project-actions,.proposalActions,.quickAdds) {
    gap:10px!important;row-gap:12px!important;flex-wrap:wrap!important;align-items:center;
  }
  :where(#workspaceModule,#modalBody) :is(.module-toolbar,.settings-section .jpb-cloud-actions) {
    gap:10px!important;row-gap:12px!important;flex-wrap:wrap!important;
  }
  .schedule-workspace .schedule-toolbar {
    display:grid!important;grid-template-columns:minmax(160px,1fr) auto minmax(180px,1fr) auto!important;
    align-items:center!important;gap:12px!important;margin:8px 0 18px!important;
  }
  .schedule-period-controls {display:flex;gap:8px;align-items:center;}
  .schedule-period-controls>button {flex:1 0 auto!important;}
  .schedule-toolbar :is(input,select) {
    width:100%!important;min-width:0!important;min-height:44px!important;margin:0!important;
    border:1px solid #abc5dc!important;border-radius:10px!important;padding:10px 12px!important;background:#fff!important;
  }
  .schedule-workspace .schedule-tabs {
    display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
    width:min(100%,460px)!important;box-sizing:border-box;gap:6px!important;
    padding:5px!important;margin:12px 0!important;border:1px solid #bbd0e2;border-radius:14px;background:#e4eef7;
  }
  .schedule-workspace .schedule-tabs>button {min-width:0!important;width:100%!important;margin:0!important;padding:7px 10px!important;box-shadow:none!important;--sc-action-fill:linear-gradient(135deg,#0878dd,#075fc7);--sc-action-ink:#fff;--sc-action-border:#238de8;}
  .schedule-workspace .schedule-tabs>button[aria-pressed=true] {--sc-action-fill:linear-gradient(135deg,#164e79,#102e49);--sc-action-ink:#fff;--sc-action-border:#153f60;}
  .contacts-tabs {display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;}
  .contacts-tabs>button {width:100%!important;min-width:0!important;}
  #platformHome .workday-calendar-heading {gap:10px!important;}
  #productionWorkspace .dispatch-row-actions {gap:8px!important;flex-wrap:wrap;}
  #productionWorkspace .dispatch-row-actions button {min-height:40px!important;padding:7px 9px!important;font-size:12px!important;}
  .schedule-period-day>button {min-height:44px!important;white-space:normal!important;}
  #productionWorkspace .production-status-tabs {gap:8px!important;}
  #productionWorkspace .job-view-toolbar {gap:10px!important;flex-wrap:wrap!important;}
  @media(max-width:1180px) and (min-width:541px) {
    .schedule-workspace .schedule-toolbar {grid-template-columns:minmax(160px,1fr) minmax(220px,1fr)!important;}
    .schedule-toolbar>.schedule-add-appointment {justify-self:stretch;}
  }
  @media(max-width:800px),(pointer:coarse) {
    :where(#platformHome,#productionWorkspace,#workspaceModule,#platformEstimate,#modalBody,#stormcoreAuthGate,
      .sc-confirm-dialog,.sc-location-consent,.workflow-content,.workflow-summary,.workflow-project-actions,
      .workflow-next,.estimateActions,.proposalActions,.modal,.sc-measure-dialog)
    :is(button,a.secondary,a.module-primary,a.hosted-payment-button,.schedule-actions>a):not(:where(.workday-calendar button,.close,.sc-close,.fieldcam-delete-close)) {min-height:44px!important;}
    #productionWorkspace .dispatch-row-actions button {min-height:44px!important;}
    #productionWorkspace .job-row .dot {width:44px!important;min-width:44px!important;height:44px!important;}
  }
  @media(max-width:540px) {
    .schedule-workspace .schedule-toolbar {grid-template-columns:minmax(0,1fr)!important;}
    .schedule-toolbar>.schedule-period-controls {width:100%;}
    .schedule-toolbar>.schedule-add-appointment {width:100%!important;}
    .schedule-workspace .schedule-tabs>button {padding:8px 6px!important;}
    .contacts-tabs {grid-template-columns:repeat(2,minmax(0,1fr))!important;}
    :where(#modalBody,.modal) .form-actions {display:flex!important;}
    :where(#modalBody,.modal) .form-actions>button {flex:1 1 120px!important;}
    #platformHome .workday-schedule-actions>button {flex:1 1 auto!important;}
  }
  @media(hover:hover) {
    :where(#platformHome,#productionWorkspace,#workspaceModule,#modalBody,#stormcoreAuthGate,
      .workflow-content,.workflow-summary,.workflow-project-actions,.workflow-next,.modal,.sc-measure-dialog)
    button:not(:where(:disabled,.close,.sc-close,.dot,.customer-expand,.record-picker,.resource-link,.workday-calendar button)):hover {
      border-color:#389be3!important;box-shadow:0 1px 0 #fff5 inset,0 3px 10px #0876d225!important;
    }
  }
  @media(prefers-reduced-motion:reduce) {button{transition:none!important;}}
}
}

/* Original approved PNG, rotated by the compositor without resampling the source. */
@keyframes stormcoreCrispOrbit {from{transform:rotate(0deg)}to{transform:rotate(360deg)}}
@media screen {
  :is(.production-brand,.sc-mobile-app-brand,.sc-platform-brand,.login-brand)>img[src$="stormcore-brand-swirl.png"] {
    display:block;object-fit:contain;transform-origin:50% 50%;image-rendering:auto;
    animation:stormcoreCrispOrbit 14s linear infinite;will-change:transform;backface-visibility:hidden;
  }
  :is(.production-brand,.sc-mobile-app-brand)>img[src$="stormcore-brand-swirl.png"] {width:36px;height:36px;flex:0 0 36px;}
  html[data-sc-logo-motion=pause] img[src$="stormcore-brand-swirl.png"] {animation-play-state:paused!important;}
  html[data-sc-logo-motion=lock] img[src$="stormcore-brand-swirl.png"] {animation:none!important;transform:none;will-change:auto;}
  @media(prefers-reduced-motion:reduce) {
    img[src$="stormcore-brand-swirl.png"] {animation:none!important;transform:none;will-change:auto;}
  }
}

/* FINAL131: smaller controls everywhere except header descendants. */
@layer stormcore-compact{@media screen{
 html body :is(#stormcoreApp,#stormcoreAuthGate) :is(button,a.secondary,a.module-primary,a.hosted-payment-button,.settings-upload,.schedule-actions>a):not(:where(header *, .sc-platform-nav *, .dot, .customer-expand, .close, .sc-close, #closeModal, .fieldcam-delete-close, .workday-calendar button, .schedule-period-day>button)){
 box-sizing:border-box!important;min-height:28px!important;min-width:28px!important;height:auto!important;padding:4px 8px!important;border-radius:6px!important;font-size:11px!important;line-height:1.25!important;gap:4px!important;
 }
 html body #stormcoreApp #platformHome .workspace-metric-link{width:fit-content!important;min-width:56px!important;align-self:flex-start!important;}
 html body #stormcoreApp .production-sidebar button{min-height:30px!important;padding:6px 9px!important;gap:8px!important;font-size:12px!important;}
 html body #stormcoreApp .sc-mobile-bottom-nav button{min-height:36px!important;padding:4px 5px!important;font-size:10px!important;}
 html body #stormcoreApp .sc-mobile-bottom-nav{min-height:48px!important;}
 html body :is(#stormcoreApp,#stormcoreAuthGate) :is(.dot,.customer-expand,.record-picker,.resource-link,.close,.sc-close,#closeModal,.fieldcam-delete-close):not(header *){padding:3px!important;}
 @media(max-width:800px),(pointer:coarse){html body :is(#stormcoreApp,#stormcoreAuthGate) :is(button,a.secondary,a.module-primary,a.hosted-payment-button,.settings-upload,.schedule-actions>a):not(:where(header *, .sc-platform-nav *, .dot, .customer-expand, .close, .sc-close, #closeModal, .fieldcam-delete-close, .workday-calendar button, .schedule-period-day>button)){min-height:34px!important;padding:5px 8px!important;font-size:12px!important;}}
}}

@layer stormcore-compact{@media screen{html body #stormcoreApp :is(.close,.sc-close,#closeModal,.fieldcam-delete-close):not(header *){width:26px!important;height:26px!important;min-width:26px!important;min-height:26px!important;padding:3px!important;}html body #stormcoreApp :is(.workday-calendar button,.schedule-period-day>button):not(header *){min-height:26px!important;padding:3px!important;font-size:11px!important;}html body #stormcoreApp .dot:not(header *){width:16px!important;height:16px!important;min-width:16px!important;min-height:16px!important;padding:0!important;}}}

/* FINAL132: restrained action hierarchy, without changing header or sizing. */
@layer stormcore-compact{@media screen{
 html body :is(#platformHome,#productionWorkspace,#workspaceModule,#modalBody,#stormcoreAuthGate,.sc-confirm-dialog,.fieldcam-delete) :is(button,a.secondary,a.module-primary,a.hosted-payment-button):not(:where(header *,nav *, .dispatch-permit-cell button, .dot,.customer-expand,.record-picker,.resource-link,.close,.sc-close,#closeModal,.fieldcam-delete-close,.workday-calendar button,.schedule-period-day>button)){
 background:#fff!important;color:#294d6b!important;border:1px solid #becedb!important;box-shadow:none!important;text-shadow:none!important;font-weight:600!important;}
 html body #stormcoreApp :is(.workspace-metric-link,.workspace-text-action,.dispatch-row-actions button,.module-record .module-actions button,.customer-file-actions .secondary):not(header *){background:transparent!important;border-color:transparent!important;color:#075fae!important;box-shadow:none!important;}
 html body #stormcoreApp :is(.workspace-metric-link,.dispatch-row-actions button:first-child):not(header *)::after{content:'↗';display:inline-block;margin-left:5px;font-size:13px;line-height:1;}
 html body #stormcoreApp :is(.production-status-tabs button,.contacts-tabs button,.schedule-tabs button,#statusViewButton,#contractorViewButton,#resetJobView):not(header *){background:#edf4fa!important;border-color:#d5e2ed!important;color:#365b79!important;box-shadow:none!important;}
 html body #stormcoreApp :is(.production-status-tabs button,.contacts-tabs button,.schedule-tabs button):is([aria-pressed=true],[aria-selected=true],.active):not(header *){background:#d8eafa!important;border-color:#94bce0!important;color:#114c7b!important;box-shadow:none!important;}
 html body :is(#platformHome,#productionWorkspace,#workspaceModule,#modalBody,#stormcoreAuthGate,.sc-confirm-dialog) :is(button.primary,button.module-primary,button[type=submit],.production-new,.workday-add-appointment,.schedule-add-appointment,.workspace-new-estimate,#stormcoreAuthSubmit,#saveCustomer,#saveContractor,#saveVendor,#confirm,a.module-primary,a.hosted-payment-button):not(header *){background:#075fae!important;border-color:#075fae!important;color:#fff!important;box-shadow:none!important;}
 html body :is(#modalBody,#workspaceModule,.sc-confirm-dialog,.fieldcam-delete) :is(button.danger,button.destructive,#confirmDelete,[data-discard]):not(header *){background:#fff!important;color:#a52938!important;border-color:#d9a6ad!important;box-shadow:none!important;}
 html body :is(#platformHome,#productionWorkspace,#workspaceModule,#modalBody,#stormcoreAuthGate) button:not(:where(header *,nav *, .dot,.customer-expand,.record-picker,.resource-link,.close,.sc-close,#closeModal,.workday-calendar button)):not(:disabled):hover{filter:brightness(.96);}
 html body :is(#platformHome,#productionWorkspace,#workspaceModule,#modalBody,#stormcoreAuthGate) button:not(header *):disabled{opacity:.48!important;cursor:not-allowed!important;}
}}
