/* Shared contrast, keyboard and responsive corrections; loaded after page CSS. */
*, *::before, *::after { box-sizing: border-box; }
:focus-visible { outline: 3px solid #38bdf8 !important; outline-offset: 3px; }
.skip-link { position: fixed; top: -100px; right: 16px; z-index: 10000; padding: 12px 18px; background: #fff; color: #10223c; border-radius: 8px; }
.skip-link:focus { top: 12px; }
input, select, textarea { max-width: 100%; font: inherit; }
select option { background: var(--bgSoft, #fff); color: var(--text, #142033); }
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }
.main-container { min-width: 0; transition: margin-right .2s; }
.sidebar { overflow-y: auto; }
.sidebar.collapsed { visibility: hidden; }
.sidebar.collapsed ~ .main-container { margin-right: 0; }
.brand-text strong, .user-profile-btn, .dropdown-menu a, .nav-link { color: var(--text); }
.nav-link:hover, .nav-link.is-active { color: var(--text); }
.user-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--primary-soft); color: var(--text); }
.dropdown-menu button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 0 18px; background: transparent; border: 0; font: inherit; cursor: pointer; }
.topbar-left { min-width: 0; flex-wrap: wrap; }
.table-wrapper, .table-wrap, .table-scroll { max-width: 100%; overflow-x: auto; }
.buy-price { font: inherit; color: inherit; background: transparent; border: 0; cursor: pointer; padding: 8px; }
.cart-status { color: #b91c1c; margin: 0 0 16px; }
[data-theme="dark"] .cart-status, [data-theme="dark"] #addressStatus { color: #fca5a5; }
#addressStatus { color: #b91c1c; }
.modal-content { max-height: calc(100dvh - 36px); overflow-y: auto; overscroll-behavior: contain; }
.modal-content input, .modal-content select { background: var(--bgSoft); color: var(--text); border: 1px solid var(--border); }
.cart-info, .product-info, .summary-box, .order-summary { min-width: 0; overflow-wrap: anywhere; }
.operations-card { background: var(--glass-surface-strong); border-color: var(--border); color: var(--text); }
.operations-header p, .timeline span, .change-list header span, .operations-page .empty { color: var(--textSoft); }
.operations-card pre { max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; direction: ltr; text-align: left; }
.timeline article > *, .change-list header > * { min-width: 0; overflow-wrap: anywhere; }
.change-list li { overflow-wrap: anywhere; }
body[data-theme="light"] .change-list del { color: #b91c1c; }
body[data-theme="light"] .change-list ins { color: #166534; }
body[data-theme="light"] .inventory-header__badge { color: #166534; }
.priority-form { flex-wrap: wrap; }
.priority-form input, .priority-form select, .priority-form button { background: var(--bgSoft); color: var(--text); border: 1px solid var(--border); padding: 8px; border-radius: 7px; min-width: 0; }
.page-order-view .card { background: var(--glass-surface-strong); color: var(--text); border-color: var(--border); }
.page-order-view th { background: var(--bgSoft); color: var(--text); }
.page-order-view .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; overflow-wrap: anywhere; }
.page-order-view .grid .full { grid-column: 1 / -1; }
body[data-theme] { --ui-text: var(--text); --ui-text-soft: var(--textSoft); --ui-text-muted: var(--textSoft); --ui-hover: var(--primary-soft); --ui-table-header: var(--bgSoft); --ui-table-total: var(--bgSoft); }
body[data-theme="dark"] { color-scheme: dark; }
body[data-theme="light"] { color-scheme: light; }
.auth-card { color-scheme: dark; }
@media (max-width: 992px) { .sidebar-backdrop.show { display: block; } }
@media (max-width: 768px) {
  .timeline article > strong, .timeline article > span { display: block; margin-block: 5px; }
  .topbar { height: auto; min-height: 76px; gap: 10px; padding-block: 10px; }
  .topbar-left { justify-content: flex-end; gap: 8px; }
  .topbar-left > .btn { padding-inline: 10px; font-size: 11px; }
  .icon-btn { width: 40px; height: 40px; flex-shrink: 0; }
  .user-profile-btn { padding-inline: 10px; height: 44px; }
  .page-order-view .grid { grid-template-columns: minmax(0, 1fr); }
  .page-order-view .card { padding: 16px; }
  .shop-navbar { visibility: hidden; }
  .shop-navbar.active { visibility: visible; }
  .store-toast { max-width: calc(100vw - 32px); right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

body { font-family: var(--font-ui); }
@media(max-width:992px) { .sidebar { visibility:hidden; } .sidebar.active { visibility:visible; } }
