/* Shared interaction layer, gated by debug-interactions.js; no production rules. */
html[data-debug-interactions="1"] {
  --ux-fast: 160ms;
  --ux-ease: cubic-bezier(.2,.7,.2,1);
  --ux-focus: var(--primary-light);
  --ux-primary-ink: #fff;
  --ux-scroll-thumb: var(--text-secondary);
  --ux-scroll-track: var(--bg-surface);
  --ux-scroll-hover: var(--primary-light);
}
html[data-debug-interactions="1"][data-theme="light"] { --ux-focus: var(--primary-dark); }
html[data-debug-interactions="1"]:is([data-skin="dark-neon"], [data-skin="industrial"]) { --ux-primary-ink: #0a0c10; }
html[data-debug-interactions="1"] :where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--ux-focus) !important;
  outline-offset: 3px;
  scroll-margin-block: 90px;
}
html[data-debug-interactions="1"] :is(.btn, .tab-btn, .nav-item, .header-icon-btn, .design-lab-toggle) {
  transition: background-color var(--ux-fast) var(--ux-ease),
    color var(--ux-fast) var(--ux-ease), border-color var(--ux-fast) var(--ux-ease),
    box-shadow var(--ux-fast) var(--ux-ease), filter var(--ux-fast) var(--ux-ease),
    transform var(--ux-fast) var(--ux-ease);
}
html[data-debug-interactions="1"] .btn { min-height: 36px; }
html[data-debug-interactions="1"] .btn-sm { min-height: 30px; }
html[data-debug-interactions="1"] :is(button, .btn, [role="button"]):not(:disabled):not([aria-disabled="true"]) { cursor: pointer; }
@media (hover: hover) and (pointer: fine) {
  html[data-debug-interactions="1"] .btn:not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]):hover {
    transform: translateY(-1px);
    filter: brightness(1.12);
    box-shadow: 0 3px 0 color-mix(in srgb, var(--primary) 45%, transparent), var(--shadow-sm);
  }
  html[data-debug-interactions="1"] .btn.btn-primary:not(:disabled):not([aria-disabled="true"]):hover {
    background: var(--primary-dark);
    color: var(--ux-primary-ink);
    border-color: var(--primary-light);
  }
  html[data-debug-interactions="1"] :is(.btn-secondary, .btn-ghost):not(:disabled):not([aria-disabled="true"]):hover {
    background: color-mix(in srgb, var(--primary) 16%, var(--bg-elevated));
    border-color: var(--primary-light);
    color: var(--text-primary);
  }
  html[data-debug-interactions="1"] :is(.nav-item, .tab-btn):not(.locked):not(:disabled):not([aria-disabled="true"]):hover {
    background: var(--primary-alpha-strong);
    color: var(--text-primary);
    box-shadow: inset 3px 0 var(--primary-light);
  }
  html[data-debug-interactions="1"] .data-table tbody tr:hover {
    background: color-mix(in srgb, var(--primary) 8%, var(--bg-card));
  }
  html[data-debug-interactions="1"] :is(.form-control, .form-select):not(:disabled):not([readonly]):hover {
    border-color: var(--primary-light);
  }
}
html[data-debug-interactions="1"] .btn:not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]):active {
  transform: translateY(1px);
  filter: brightness(.94);
  box-shadow: none;
}
html[data-debug-interactions="1"] :is(.btn, button):is(:disabled, [aria-disabled="true"]) {
  cursor: not-allowed;
  filter: none;
  transform: none;
  box-shadow: none;
  animation: none;
}
html[data-debug-interactions="1"] :is(.btn, button)[aria-busy="true"] {
  cursor: progress;
  animation: none;
  transform: none;
}
html[data-debug-interactions="1"] :is(.form-control, .form-select) {
  transition: border-color var(--ux-fast), box-shadow var(--ux-fast), background-color var(--ux-fast);
}
html[data-debug-interactions="1"] :is(.form-control, .form-select):focus {
  border-color: var(--ux-focus);
  box-shadow: 0 0 0 3px var(--primary-alpha-strong);
}
html[data-debug-interactions="1"] .data-table tbody tr:focus-within {
  background: color-mix(in srgb, var(--primary) 10%, var(--bg-card));
}
/* A scanner readiness cue, not an indication that a scan has succeeded. */
html[data-debug-interactions="1"] .warehouse-hid-sticky {
  border-inline-start: 4px solid var(--primary);
  animation: debug-scan-arrive 600ms var(--ux-ease) 1;
  transition: border-color var(--ux-fast), box-shadow var(--ux-fast);
}
html[data-debug-interactions="1"] .warehouse-hid-sticky:focus-within {
  border-color: var(--ux-focus);
  box-shadow: 0 0 0 3px var(--primary-alpha-strong), var(--shadow-sm);
}
html[data-debug-interactions="1"] .warehouse-hid-input { min-height: 48px; font-size: 16px; }
html[data-debug-interactions="1"] .warehouse-hid-sticky .btn { min-height: 48px; }
html[data-debug-interactions="1"] .debug-action-ready:not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]) {
  border-color: var(--success);
  box-shadow: 0 0 0 2px var(--success-light);
  animation: debug-ready 700ms ease-out 2;
}
html[data-debug-interactions="1"] #toastNotif {
  max-width: min(380px, calc(100vw - 32px)) !important;
  overflow-wrap: anywhere;
  animation: debug-feedback-in 200ms var(--ux-ease) !important;
}
html[data-debug-interactions="1"], html[data-debug-interactions="1"] * {
  scrollbar-color: var(--ux-scroll-thumb) var(--ux-scroll-track);
  scrollbar-width: thin;
}
html[data-debug-interactions="1"] ::-webkit-scrollbar { width: 10px; height: 10px; }
html[data-debug-interactions="1"] ::-webkit-scrollbar-track { background: var(--ux-scroll-track); }
html[data-debug-interactions="1"] ::-webkit-scrollbar-thumb { background: var(--ux-scroll-thumb); border: 2px solid var(--ux-scroll-track); border-radius: 8px; }
html[data-debug-interactions="1"] ::-webkit-scrollbar-thumb:hover { background: var(--ux-scroll-hover); }
html[data-debug-interactions="1"] ::-webkit-scrollbar-thumb:active { background: var(--primary); }
@keyframes debug-scan-arrive {
  from { box-shadow: 0 0 0 5px var(--primary-alpha-strong); }
  to { box-shadow: 0 0 0 0 transparent; }
}
@keyframes debug-ready {
  0%, 100% { box-shadow: 0 0 0 2px var(--success-light); }
  50% { box-shadow: 0 0 0 6px var(--success-light); }
}
@keyframes debug-feedback-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (pointer: coarse) {
  html[data-debug-interactions="1"] :is(.btn, .tab-btn, .header-icon-btn) { min-height: 44px; min-width: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-debug-interactions="1"] *, html[data-debug-interactions="1"] *::before, html[data-debug-interactions="1"] *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  html[data-debug-interactions="1"] .btn { transform: none !important; }
}
@media (forced-colors: active) {
  html[data-debug-interactions="1"], html[data-debug-interactions="1"] * { scrollbar-color: auto; }
  html[data-debug-interactions="1"] :focus-visible { outline-color: Highlight !important; }
  html[data-debug-interactions="1"] .debug-action-ready { outline: 2px solid Highlight; }
}
