/* Interaction feedback for the local business shell. Idle layouts belong to each page. */
@layer jp-interactions {
@media screen {
  :root {
    --jp-response: var(--ui-hover-time,150ms) var(--ui-ease,ease-out);
    --jp-focus: var(--color-focus);
    --jp-ui-time: var(--ui-hover-time,150ms);
    --jp-down-time: var(--ui-press-time,110ms);
    --jp-action-wash: var(--color-hover);
    --jp-field-ring: var(--color-focus-ring);
    --jp-press-light: .95;
  }
  @media (prefers-reduced-motion:reduce) {
    :root { --jp-response: 0s; --jp-ui-time: 0s; --jp-down-time: 0s; }
  }
  :root[data-theme="dark"] {
    --jp-focus: var(--color-focus);
    --jp-action-wash: var(--color-hover);
    --jp-field-ring: var(--color-focus-ring);
    --jp-press-light: 1.16;
  }
  /* The same control may be a native button, a link or a summary in older workspaces. */
  #jp-native-root :is(.n-toolbar,.n-panel-head,.n-page-title-actions,.n-actions,.n-form-actions,
      .n-pagination-controls,.v-pagination,.n-tabs,.v-tabs,.q-subtabs,.p-steps,.ops-sales-steps,
      .jp-purchase-status-tabs,.product-editor-tabs,.shell-nav-content,.jp-mobile-tabs,
      .inv-actions,.n-table,.v-table) :is(button,a[href],summary),
  #jp-native-root :is(.n-primary,.n-secondary,.n-danger,.inv-btn,.catalog-scan,.catalog-photo,
      .ops-overview-toggle,.jp-purchase-overview-toggle,.jp-ledger-tools-toggle,
      .jp-ledger-analysis-toggle,.catalog-filters-toggle,button[aria-expanded],button[aria-pressed]),
  #jp-native-root .mm-root :is(button,a[href]),
  dialog :is(button:not(.n-toast),a[href],summary) {
    transition-property: background-color,border-color,color,box-shadow,filter,opacity,transform !important;
    transition-duration: var(--jp-ui-time) !important;
    transition-timing-function: cubic-bezier(.2,.7,.2,1) !important;
  }
  #jp-native-root .native-print-toolbar :is(button,a[href]) {
    transition: background-color var(--jp-response), border-color var(--jp-response), filter var(--jp-response) !important;
    &:active:not(:disabled) {filter: brightness(var(--jp-press-light)) !important;}
  }
  #jp-native-root :is(a.training-step-link,a.jp-entry-back,a.jp-purchase-return,
      a.ops-header-link,a.jp-policy-link,summary.selection-summary) {
    transition: color var(--jp-response),background-color var(--jp-response),
                filter var(--jp-response) !important;
    @media (hover:hover) and (pointer:fine) {
      &:hover {
        color:var(--jp-focus) !important;
      }
    }
    &:active {filter:brightness(var(--jp-press-light)) !important;}
  }
  #jp-native-root :is(.n-toolbar,.n-panel-head,.n-page-title-actions,.n-actions,.n-form-actions,
      .n-pagination-controls,.v-pagination,.n-tabs,.v-tabs,.ops-sales-steps,.jp-purchase-status-tabs,
      .product-editor-tabs,.shell-nav-content,.jp-mobile-tabs) :is(button,a[href],summary):active:not(:disabled,[aria-disabled="true"]),
  #jp-native-root :is(.n-primary,.inv-btn,.catalog-photo,.ops-overview-toggle,button[aria-expanded]):active:not(:disabled,[aria-disabled="true"]),
  #jp-native-root .mm-root :is(button,a[href]):active:not(:disabled,[aria-disabled="true"]),
  dialog button:active:not(:disabled,[aria-disabled="true"]) {
    transition-duration: var(--jp-down-time) !important;
    filter: brightness(var(--jp-press-light)) !important;
  }
  /* Tab and navigation targets stay under the pointer throughout the gesture. */
  #jp-native-root :is(.n-tabs,.v-tabs,.ops-sales-steps,.jp-purchase-status-tabs,.product-editor-tabs,
      .shell-nav-content,.jp-mobile-tabs,.n-pagination-controls) :is(button,a[href],summary):active {
    transform: none !important;
  }
  #jp-native-root :is(.shell-nav-group-toggle,.shell-nav-items>a,.n-tabs>button,
      .v-tabs>button,.ops-sales-steps>button,.jp-purchase-status-tabs>button,
      .n-pagination-controls>button):not(:disabled,[aria-disabled="true"],.active,
      [aria-current],[aria-selected="true"],[aria-pressed="true"]) {
    @media (hover:hover) and (pointer:fine) {
      &:hover {background-color:var(--jp-action-wash) !important;}
    }
  }
  #jp-native-root :is(.n-field,.n-toolbar,.n-form-grid,.n-pagination-controls,.n-table,
      .ops-sales-information,.jp-purchase-inline-filters,.jp-ledger-filter-fields,.mm-root),
  dialog :is(.n-field,.n-toolbar,.n-form-grid) {
    & :is(input:not([type="checkbox"],[type="radio"],[type="range"],[type="file"],[type="color"]),textarea,select) {
      transition: background-color var(--jp-response), border-color var(--jp-response),
                  box-shadow var(--jp-response) !important;
      &:focus:not([aria-invalid="true"]):not(:disabled) {
        outline: 2px solid transparent !important; outline-offset: 0 !important;
        border-color: var(--jp-focus) !important;
        box-shadow: 0 0 0 3px var(--jp-field-ring) !important;
      }
    }
  }
  #jp-native-root :is(button,a[href],summary,[role="tab"],[role="button"],[role="option"],.catalog-card[tabindex]):not(.center-shell *):focus-visible,
  dialog :is(button,a[href],summary,[role="tab"],[role="button"]):focus-visible {
    outline: 2px solid var(--jp-focus) !important;
    outline-offset: 2px !important;
  }
  /* A filter's selection survives pointer exit. Keyboard focus is a separate outer ring. */
  #jp-native-root :is(button,a[href]):is(.e-metric,.inv-reading-cell,.jp-ledger-primary-readout) {
    transition: box-shadow var(--jp-response),filter var(--jp-response) !important;
    &:is(:active,:hover) {transform:none !important;}
    @media (hover:hover) and (pointer:fine) {
      &:hover:not(:disabled,[aria-disabled="true"]) {
        --jp-hover-depth: 0 4px 11px rgb(32 70 120 / .12),0 12px 22px -15px rgb(32 70 120 / .22);
        box-shadow: inset 0 0 0 1px rgb(76 133 209 / .45),0 4px 11px rgb(32 70 120 / .10),0 12px 22px -15px rgb(32 70 120 / .2) !important;
      }
    }
    &:is([aria-pressed="true"],.is-selected):not(:focus-visible) {
      outline: none !important;
      box-shadow: inset 0 0 0 2px color-mix(in srgb,var(--jp-focus) 72%,transparent),var(--jp-hover-depth,var(--depth,0 4px 14px -7px var(--color-shadow))) !important;
    }
    &:active:not(:disabled,[aria-disabled="true"]) {
      transition-duration:var(--jp-down-time) !important;
      filter:brightness(var(--jp-press-light)) !important;
    }
  }
  #jp-native-root :is(.n-sidebar-toggle,.n-pagination-controls button,.n-tabs button,
      .v-tabs button,.n-actions button,.n-primary,.catalog-photo,button.e-metric):disabled {
    cursor: default !important;
    filter: none !important;
  }
  /* Scoped to the existing display toggle. An interrupted toggle can immediately reverse. */
  .shell-nav-chevron {transition: transform var(--jp-ui-time) ease-out !important;}
  @media (prefers-reduced-motion:no-preference) {
  /* These panels already toggle their display. Let their own display rules decide when
     they are shown; a closed filter must immediately leave the keyboard tab order. */
  @supports (interpolate-size: allow-keywords) {
    #jp-native-root .jp-ledger-desktop-filter > form.n-form-grid {
      interpolate-size: allow-keywords;
      animation: jp-filter-open 140ms cubic-bezier(.2,.7,.2,1);
    }
    @media (max-width:767px) {
      #jp-native-root :is(.logs-query.is-expanded > #logs-filters,.q-filters .q-filter-extra.is-open) {
        interpolate-size: allow-keywords;
        animation: jp-filter-open 140ms cubic-bezier(.2,.7,.2,1);
      }
      #jp-native-root .users-query.is-expanded > .users-filter-extra {
        animation: jp-filter-appear 125ms ease-out;
      }
    }
    @keyframes jp-filter-open {
      from {height:0; opacity:.35; overflow:clip;}
      to {height:auto; opacity:1; overflow:clip;}
    }
    @keyframes jp-filter-appear {from{opacity:.45}to{opacity:1}}
  }
  @supports (interpolate-size: allow-keywords) and (transition-behavior: allow-discrete) {
    .shell-nav-content:not(.is-rail) .shell-nav-items {
      interpolate-size: allow-keywords;
      height: auto;
      overflow: clip;
      transition: height 155ms cubic-bezier(.2,.7,.2,1),opacity 110ms ease,
                  display 155ms allow-discrete !important;
      @starting-style {height:0; opacity:0;}
    }
    .shell-nav-content:not(.is-rail) .shell-nav-group:not(.is-expanded) > .shell-nav-items {
      height:0; opacity:0; visibility:hidden; pointer-events:none;
    }
    .shell-nav-items a:focus-visible {outline-offset:-2px !important;}
  }
  /* Switching a page must not shift the hit targets below a stationary pointer. */
  @keyframes jp-business-arrive {from{opacity:.90}to{opacity:1}}
  #jp-native-root .n-main .e-route-enter {
    animation: jp-business-arrive var(--ui-route-time,190ms) var(--ui-ease,ease-out) !important;
  }
  }
  @media (forced-colors:active) {
    #jp-native-root :focus-visible, dialog :focus-visible {
      outline: 2px solid Highlight !important;
    }
    #jp-native-root :is(button,a)[aria-pressed="true"] {
      outline: 2px solid Highlight !important; outline-offset:-3px !important;
    }
  }
}
}
/* Finger targets for mobile record selection and payroll drill-down. */
@layer jp-interactions {
  @media screen and (max-width:767px), screen and (pointer:coarse) {
    #jp-native-root :is(.advice-footer,.ia-expiry-footer) > .primary-button,
    #jp-native-root .ps-prices-empty > a.button,
    #jp-native-root .p-employee-card > .n-panel-head > button {
      min-height:44px !important;
      min-width:44px !important;
    }
    #jp-native-root .ops-product-card > header {
      grid-template-columns:44px 44px minmax(0,1fr) !important;
    }
    #jp-native-root .ops-product-card > header > label {
      min-width:44px !important; min-height:44px !important;
      display:grid;place-items:center;
    }
    #jp-native-root .n-table-selection > input[type=checkbox] {
      appearance:none !important;
      display:inline-grid !important;place-content:center;
      inline-size:44px !important;block-size:44px !important;min-block-size:44px !important;min-inline-size:44px !important;
      padding:0 !important;margin:0 !important;border:0 !important;
      background:transparent !important;box-shadow:none !important;vertical-align:middle;touch-action:manipulation;
    }
    #jp-native-root .n-table-selection > input[type=checkbox]::before,
    #jp-native-root .n-table-selection > input[type=checkbox]::after {content:"";grid-area:1/1;place-self:center;box-sizing:border-box;}
    #jp-native-root .n-table-selection > input[type=checkbox]::before {
      width:20px;height:20px;border:1.5px solid var(--color-text-secondary);border-radius:5px;background:var(--color-bg-card);
    }
    #jp-native-root .n-table-selection > input:is(:checked,:indeterminate)::before {
      background:var(--color-action);border-color:var(--color-action);
    }
    #jp-native-root .n-table-selection > input:checked::after {
      width:6px;height:11px;border:solid var(--color-on-primary);border-width:0 2px 2px 0;transform:translateY(-1px) rotate(45deg);
    }
    #jp-native-root .n-table-selection > input:indeterminate::after {
      width:10px;height:2px;border:0;transform:none;background:var(--color-on-primary);
    }
    #jp-native-root .n-table-selection > input:disabled::before {opacity:.7;}
    #jp-native-root .p-payroll-comparison .p-payroll-plot-scroll > svg[style*="--jp-payroll-touch-width"] {
      min-width:var(--jp-payroll-touch-width) !important;
    }
    #jp-native-root .p-payroll-comparison.is-trend .p-payroll-point:has([data-touch-bar]) > g {pointer-events:none;}
    @media (forced-colors:active) {
      #jp-native-root .n-table-selection > input:is(:checked,:indeterminate)::before {forced-color-adjust:none;background:Highlight;border-color:Highlight;}
      #jp-native-root .n-table-selection > input:checked::after {forced-color-adjust:none;border-color:HighlightText;}
      #jp-native-root .n-table-selection > input:indeterminate::after {forced-color-adjust:none;background:HighlightText;}
    }
  }
}
