/* Shared accessibility and navigation repairs for project 583. */
:root { --p583-header-offset: 88px; }
html { scroll-padding-top: var(--p583-header-offset); }
[id] { scroll-margin-top: var(--p583-header-offset); }
.site-header { position: sticky; top: 0; z-index: 1000; overflow: visible; height: auto; min-height: 76px; }
.site-header .header-inner { min-height: 76px; gap: 16px; }
.site-header .header-actions { flex-shrink: 0; }
.site-header .brand-logo { min-width: 0; }
.site-header .p583-navigation { display: block; position: relative; }
.p583-menu { position: relative; }
.p583-menu > summary { display: flex; align-items: center; justify-content: center; gap: 9px; min-width: 94px; min-height: 46px; padding: 10px 14px; border: 1px solid #d9d9e1; border-radius: 8px; background: #fff; color: #1b1b1b; cursor: pointer; font: 700 14px/1.25 var(--font-body, sans-serif); list-style: none; }
.p583-menu > summary::marker, .p583-menu > summary::-webkit-details-marker { display: none; content: ''; }
.p583-menu > summary:hover { background: #f8f8fa; border-color: #67676e; }
.p583-menu-icon { display: grid; gap: 4px; width: 20px; flex-shrink: 0; }
.p583-menu-icon i { display: block; width: 20px; height: 2px; background: currentColor; transition: transform .15s ease, opacity .15s ease; }
.p583-menu[open] .p583-menu-icon i:first-child { transform: translateY(6px) rotate(45deg); }
.p583-menu[open] .p583-menu-icon i:nth-child(2) { opacity: 0; }
.p583-menu[open] .p583-menu-icon i:last-child { transform: translateY(-6px) rotate(-45deg); }
.p583-menu-panel { position: absolute; top: calc(100% + 12px); right: 0; width: min(370px, calc(100vw - 32px)); max-height: min(680px, calc(100dvh - var(--p583-header-offset) - 20px)); overflow-y: auto; overscroll-behavior: contain; padding: 14px; border: 1px solid #dedee5; border-radius: 12px; background: #fff; color: #1b1b1b; box-shadow: 0 18px 50px rgba(16,16,16,.18); text-align: left; z-index: 1001; }
.p583-menu:not([open]) > .p583-menu-panel { display: none; }
.p583-menu-section + .p583-menu-section { margin-top: 12px; padding-top: 12px; border-top: 1px solid #e9e9ee; }
.p583-menu-section > p { margin: 4px 10px 8px; color: #67676e; font: 700 12px/1.5 var(--font-body, sans-serif); letter-spacing: .06em; text-transform: uppercase; }
.p583-menu-panel ul { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.p583-menu-panel li { margin: 0; padding: 0; list-style: none; }
.p583-menu-panel a { display: block; padding: 11px 12px; border-radius: 6px; color: #1b1b1b; text-decoration: none; font: 600 14px/1.4 var(--font-body, sans-serif); white-space: normal; overflow-wrap: anywhere; }
.p583-menu-panel a:hover { color: #1b1b1b; background: #f2f2f6; }
.p583-menu-panel a[aria-current="page"] { background: #fcebf2; color: #a9184e; box-shadow: inset 3px 0 #e52e71; }
:where(a, button, summary, input, [tabindex]):focus-visible { outline: 3px solid #a9184e; outline-offset: 3px; }
.p583-table-scroll { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; margin: 16px 0; }
.p583-table-scroll > table { margin-top: 0; margin-bottom: 0; }
.p583-table-scroll[data-overflow="true"] { border-radius: 6px; box-shadow: inset -5px 0 8px -8px #1b1b1b; }
.x920b-tab-input { display: block !important; position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
input[id^="x920b-tab-all"]:focus-visible ~ .x920b-tabs-nav label[for^="x920b-tab-all"],
input[id^="x920b-tab-slots"]:focus-visible ~ .x920b-tabs-nav label[for^="x920b-tab-slots"],
input[id^="x920b-tab-live"]:focus-visible ~ .x920b-tabs-nav label[for^="x920b-tab-live"],
input[id^="x920b-tab-crash"]:focus-visible ~ .x920b-tabs-nav label[for^="x920b-tab-crash"] { outline: 3px solid #a9184e; outline-offset: 3px; }
main, main > *, section { min-width: 0; }
@media (max-width: 640px) {
  .site-header, .site-header .header-inner { min-height: 68px; }
  .site-header .header-inner { padding: 8px 16px; gap: 10px; }
  .site-header .brand-logo { font-size: 17px; gap: 7px; }
  .p583-menu > summary { min-width: 82px; padding: 9px 10px; }
  .p583-menu-panel { position: fixed; left: 16px; right: 16px; top: var(--p583-header-offset); width: auto; }
  .site-header .header-actions { gap: 8px; }
  .site-header .header-actions > .butn-outline { font-size: 11px; padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  .p583-menu-icon i { transition: none; }
}
