/* Neko Chin motion: short entrances, immediate feedback, stable operational data. */
:root {
  --ui-motion-fast: 130ms;
  --ui-motion-normal: 200ms;
  --ui-motion-enter: 340ms;
  --ui-motion-ease: cubic-bezier(.22, 1, .36, 1);
  --ui-motion-accent: var(--ba-pink, #c476a2);
}

/* Content stays visible without the runtime. Focus rings remain instantaneous. */
:where(.app, .account-body, .auth-body, #business-assistant-root, .modal-overlay, .cm-dialog-overlay, .sl-modal-overlay, .pbk-modal-overlay, .sc-modal-backdrop, .nk-pos-modal, dialog) :where(button, .btn, .button, .text-link, .text-button, .primary-button, .secondary-button) {
  transition: background-color var(--ui-motion-fast) ease,
    border-color var(--ui-motion-fast) ease, color var(--ui-motion-fast) ease,
    box-shadow var(--ui-motion-normal) ease, opacity var(--ui-motion-fast) ease,
    transform var(--ui-motion-normal) var(--ui-motion-ease),
    translate var(--ui-motion-normal) var(--ui-motion-ease),
    scale var(--ui-motion-fast) var(--ui-motion-ease);
  -webkit-tap-highlight-color: transparent;
}
:where(.app, .account-body, .auth-body, #business-assistant-root, .modal-overlay, .cm-dialog-overlay, .sl-modal-overlay, .pbk-modal-overlay, .sc-modal-backdrop, .nk-pos-modal, dialog) :where(button, .btn, .button):not(:disabled, [aria-disabled="true"]):active {
  scale: .975;
  transition-duration: 70ms;
}
:where(.app, .account-body, .auth-body, #business-assistant-root, .modal-overlay, .cm-dialog-overlay, .sl-modal-overlay, .pbk-modal-overlay, .sc-modal-backdrop, .nk-pos-modal, dialog) :where(input, select, textarea) {
  transition: border-color var(--ui-motion-fast) ease, background-color var(--ui-motion-fast) ease,
    box-shadow var(--ui-motion-fast) ease;
}

/* Animate inside nav items without changing dropdown placement. */
.nav-caret { transition: transform var(--ui-motion-normal) var(--ui-motion-ease); }
.nav-ico, .nav-dropdown-ico {
  transition: background-color var(--ui-motion-normal) ease, color var(--ui-motion-normal) ease,
    translate var(--ui-motion-normal) var(--ui-motion-ease);
}
.nav-item-dropdown-container.open .nav-dropdown {
  transform-origin: top center;
  animation: ui-menu-enter var(--ui-motion-normal) var(--ui-motion-ease);
}
.nav-item.active .nav-ico { color: var(--accent, #c476a2); }
.nav-dropdown-item { transition: background-color var(--ui-motion-fast) ease, color var(--ui-motion-fast) ease; }

/* Selection underline follows a tab's existing active state. */
:is(.pb-tabs, .pc-tabs, .pbk-tabs, .cm-tabs, .cm-hr-tabs, .cs-tabs, .sc-tabs,
    .nk-manager-tabs, .nk-chart-tabs, .pe-editor-tabs, .mp-filter-tabs, .ranking-tabs, .nk-pos-discount-tabs) > button {
  position: relative;
}
:is(.pb-tabs, .pc-tabs, .pbk-tabs, .cm-tabs, .cm-hr-tabs, .cs-tabs, .sc-tabs,
    .nk-manager-tabs, .nk-chart-tabs, .pe-editor-tabs, .mp-filter-tabs, .ranking-tabs, .nk-pos-discount-tabs) > button::after {
  content: "";
  position: absolute;
  inset: auto 14px 0;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0;
  transform: scaleX(.35);
  transform-origin: center;
  transition: opacity var(--ui-motion-fast) ease, transform var(--ui-motion-normal) var(--ui-motion-ease);
  pointer-events: none;
}
:is(.pb-tabs, .pc-tabs, .pbk-tabs, .cm-tabs, .cm-hr-tabs, .cs-tabs, .sc-tabs,
    .nk-manager-tabs, .nk-chart-tabs, .pe-editor-tabs, .mp-filter-tabs, .ranking-tabs, .nk-pos-discount-tabs) > button:is(.active, .is-active, [aria-selected="true"], [aria-pressed="true"])::after {
  opacity: 1;
  transform: scaleX(1);
}
#content :where(tbody td) { transition: background-color var(--ui-motion-fast) ease; }
#content :where(.nk-kpi, .fh-kpi, .cm-kpi, .inv-kpi, .cs-kpi, .sl-kpi, .pm-kpi, .mp-stat, .pbk-stat, .sc-stat) {
  transition: border-color var(--ui-motion-normal) ease, box-shadow var(--ui-motion-normal) ease;
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  :where(.app, .account-body, .auth-body) :where(.btn, .button, .primary-button, .secondary-button, .pb-primary, .pc-primary, .pbk-primary, .ob-actions button):not(:disabled, [aria-disabled="true"]):hover { translate: 0 -1px; }
  #content :where(button.card, .nk-shortcut, .nk-pos-product):not(:disabled):hover { translate: 0 -2px; }
  .nav-item:hover .nav-ico, .nav-dropdown-item:hover .nav-dropdown-ico { translate: 0 -1px; }
  :where(.account-body, .auth-body) a.text-link { text-underline-offset: 4px; transition: color var(--ui-motion-fast) ease; }
  #content :where(.pb-thumb, .pe-gallery-picture, .pc-photo, .nk-pos-product-image) img { transition: scale 450ms var(--ui-motion-ease); }
  #content :where(.pb-product, .pe-gallery-picture, .pc-product, .nk-pos-product):hover img { scale: 1.035; }
}

/* Native dialogs retain the top layer during closing where the browser supports it. */
@supports (transition-behavior: allow-discrete) {
  .nav-dropdown {
    opacity: 0;
    translate: 0 -6px;
    transition: opacity var(--ui-motion-fast) ease,
      translate var(--ui-motion-normal) var(--ui-motion-ease),
      display var(--ui-motion-normal) allow-discrete;
  }
  .nav-item-dropdown-container.open .nav-dropdown { opacity: 1; translate: 0 0; animation: none; }
  @starting-style { .nav-item-dropdown-container.open .nav-dropdown { opacity: 0; translate: 0 -6px; } }
  dialog {
    opacity: 0;
    translate: 0 10px;
    transition: opacity var(--ui-motion-normal) ease,
      translate var(--ui-motion-normal) var(--ui-motion-ease),
      display var(--ui-motion-normal) allow-discrete, overlay var(--ui-motion-normal) allow-discrete;
  }
  dialog[open] { opacity: 1; translate: 0 0; }
  dialog::backdrop {
    opacity: 0;
    transition: opacity var(--ui-motion-normal) ease,
      display var(--ui-motion-normal) allow-discrete, overlay var(--ui-motion-normal) allow-discrete;
  }
  dialog[open]::backdrop { opacity: 1; }
  @starting-style {
    dialog[open] { opacity: 0; translate: 0 10px; }
    dialog[open]::backdrop { opacity: 0; }
  }
  .ba-panel {
    animation: none;
    opacity: 0;
    translate: 0 10px;
    transition: opacity var(--ui-motion-normal) ease,
      translate var(--ui-motion-normal) var(--ui-motion-ease),
      display var(--ui-motion-normal) allow-discrete;
  }
  .ba-panel:not([hidden]) { opacity: 1; translate: 0 0; }
  @starting-style { .ba-panel:not([hidden]) { opacity: 0; translate: 0 10px; } }
}
@supports not (transition-behavior: allow-discrete) {
  .ba-panel { transform-origin: bottom right; animation: ui-chat-enter 280ms var(--ui-motion-ease); }
}
.ba-message { animation: ui-message-enter 230ms var(--ui-motion-ease); }
.toast { animation: ui-toast-enter 280ms var(--ui-motion-ease); }
.ui-motion-leaving { pointer-events: none; }

/* A delayed, indeterminate line indicates navigation work, without a fake percentage. */
.ui-route-progress {
  position: fixed;
  z-index: 2000;
  inset: 0 0 auto;
  height: 3px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--ui-motion-fast) ease;
}
.ui-route-progress::before {
  content: "";
  display: block;
  width: 35%;
  height: 100%;
  background: var(--ui-motion-accent);
  border-radius: 0 3px 3px 0;
  transform: translateX(-110%);
}
.ui-route-progress.is-loading { opacity: 1; }
.ui-route-progress.is-loading::before { animation: ui-progress-travel 1.25s ease-in-out infinite; }
@keyframes ui-menu-enter { from { opacity: .55; translate: 0 -6px; } to { opacity: 1; translate: 0 0; } }
@keyframes ui-chat-enter { from { opacity: .5; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ui-message-enter { from { opacity: .5; translate: 0 5px; } to { opacity: 1; translate: 0 0; } }
@keyframes ui-toast-enter { from { opacity: 0; translate: 16px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes ui-progress-travel { to { transform: translateX(390%); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .ui-route-progress::before { animation: none !important; transform: none; width: 100%; }
  dialog { translate: none; }
  :where(.app, .account-body, .auth-body, #business-assistant-root, .modal-overlay, .cm-dialog-overlay, .sl-modal-overlay, .pbk-modal-overlay, .sc-modal-backdrop, .nk-pos-modal, dialog) :where(button, .btn, .button):active { scale: none !important; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: reduce) {
  :where(.app, .account-body, .auth-body) :where(button, .btn, .button, .nav-ico, .nav-dropdown-ico):hover { translate: none; }
  #content :where(.pb-product, .pe-gallery-picture, .pc-product, .nk-pos-product):hover img { scale: none; }
}
@media print {
  .ui-route-progress { display: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
