/* Spaceron shared accessibility and interaction safeguards. */
:where(a, button, input, select, textarea, summary, [role="button"], [tabindex]):focus-visible {
  outline: 3px solid #69b7ff !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 5px rgba(11, 92, 180, .28) !important;
}

.skip-link {
  position: fixed !important;
  z-index: 10050 !important;
  top: -96px !important;
  left: 12px !important;
  min-height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 16px !important;
  border: 2px solid currentColor !important;
  border-radius: 8px !important;
  background: Canvas !important;
  color: CanvasText !important;
  text-decoration: none !important;
  transition: top .16s ease !important;
}
.skip-link:focus, .skip-link:focus-visible { top: 12px !important; }

:where(button, input, select, textarea) { accent-color: #2d8cf0; }
:where(button, [role="button"], summary) { touch-action: manipulation; }
:where(input, select, textarea) { max-width: 100%; }
:where(dialog) { max-height: min(88vh, 760px); overflow: auto; }
:where(dialog)::backdrop { background: rgba(0, 4, 12, .76); backdrop-filter: blur(4px); }
:where([aria-disabled="true"]) { cursor: not-allowed; opacity: .64; }
:where([hidden]) { display: none !important; }

/* Preserve readable content when users increase text size. */
:where(p, li, label, input, textarea, select, button, a) { overflow-wrap: anywhere; }

@media (pointer: coarse) {
  :where(button, input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), select, textarea, summary, [role="button"], .button, .account-sidebar a, .account-bottom-nav a, .admin-sidebar a, .primary-nav a) {
    min-height: 44px !important;
  }
  :where(input[type="checkbox"], input[type="radio"]) {
    min-width: 24px;
    min-height: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

@media (forced-colors: active) {
  :where(.button, button, input, select, textarea, dialog, .panel) { border: 1px solid CanvasText !important; }
  :where(a) { text-decoration: underline; }
}

.environment-banner{position:relative;z-index:10000;padding:.45rem 1rem;text-align:center;background:#ffd166;color:#111;font-weight:800;letter-spacing:.08em;font-size:.78rem}.environment-banner+ .skip-link{top:2.4rem}

/* Fix 19: semantic interaction, text zoom, dialog, and responsive safeguards. */
.sr-only,
[data-a11y-status],
[data-a11y-alert] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

html.has-modal-dialog,
html.has-modal-dialog body { overflow: hidden !important; }
:where(dialog[open], .dialog-fallback-open) { position: fixed; }
:where(dialog[open]):focus { outline: none; }
:where([inert]) { pointer-events: none !important; user-select: none !important; }

/* Do not rely on pointer-type detection alone for usable control dimensions. */
:where(button, input:not([type="hidden"]), select, textarea, summary, [role="button"], .button) {
  min-block-size: 32px;
}
:where(input[type="checkbox"], input[type="radio"]) {
  min-inline-size: 24px;
  min-block-size: 24px;
}

/* The account search panel is a real modal dialog in Fix 19. */
.account-search-drawer {
  width: auto;
  max-width: none;
  margin: 0;
  color: inherit;
}
.account-search-drawer::backdrop { background: rgba(0, 4, 12, .72); }

/* Semantic card actions preserve the visual cards without placing focus on articles. */
.stories-card-action,
.kit-detail-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: .75rem;
  padding: .55rem .85rem;
  border: 1px solid currentColor;
  border-radius: .35rem;
  background: transparent;
  color: #69b7ff;
  font: inherit;
  cursor: pointer;
}

/* Responsive administrator shell. The old fixed 1180px canvas is intentionally removed. */
.admin-mobile-menu,
.admin-sidebar-close,
.admin-mobile-backdrop { display: none; }

@media (max-width: 900px) {
  html, body { min-width: 0 !important; max-width: 100%; overflow-x: hidden; }
  body { -webkit-text-size-adjust: 100%; }

  :where(button, a, summary, input:not([type="hidden"]), select, textarea, [role="button"], .button) {
    min-block-size: 44px !important;
  }
  :where(input, select, textarea) { font-size: 16px !important; }

  .admin-layout { display: block !important; min-height: 100vh !important; }
  .admin-content { width: 100%; min-width: 0; }
  .admin-sidebar {
    position: fixed !important;
    z-index: 240;
    inset: 0 auto 0 0;
    width: min(320px, 88vw) !important;
    height: 100dvh !important;
    padding-bottom: calc(16px + env(safe-area-inset-bottom)) !important;
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: 24px 0 70px rgba(0, 0, 0, .72);
  }
  body.admin-menu-open { overflow: hidden; }
  body.admin-menu-open .admin-sidebar { transform: translateX(0); }
  .admin-mobile-backdrop {
    position: fixed;
    z-index: 230;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(0, 4, 12, .76);
  }
  .admin-mobile-backdrop:not([hidden]) { display: block; }
  .admin-mobile-menu {
    display: inline-grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(105, 183, 255, .45);
    border-radius: 7px;
    background: #07182b;
    color: #eef6ff;
  }
  .admin-mobile-menu span,
  .admin-mobile-menu::before,
  .admin-mobile-menu::after {
    content: "";
    display: block;
    width: 19px;
    height: 2px;
    background: currentColor;
  }
  .admin-mobile-menu span { margin: 4px 0; }
  .admin-sidebar-close {
    display: grid;
    place-items: center;
    position: absolute;
    top: 14px;
    right: 12px;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(105, 183, 255, .35);
    border-radius: 7px;
    background: #07182b;
    color: #eef6ff;
    font-size: 24px;
  }
  .admin-top {
    position: sticky;
    z-index: 100;
    top: 0;
    min-height: 66px;
    height: auto !important;
    padding: 9px 12px !important;
    gap: 10px;
    background: rgba(2, 8, 17, .96);
    backdrop-filter: blur(16px);
  }
  .admin-top form[data-global-search] { width: min(100%, 420px) !important; min-width: 0; flex: 1; }
  .admin-top kbd { display: none; }
  .admin-top > div > span:not(.admin-avatar),
  .admin-profile-menu { display: none; }
  .admin-main { padding: 16px 12px calc(24px + env(safe-area-inset-bottom)) !important; }
  .admin-heading { height: auto !important; min-height: 0; margin-bottom: 16px; }
  .admin-heading h1 { font-size: clamp(28px, 8vw, 36px) !important; line-height: 1.1; }
  .admin-heading p { font-size: 13px !important; line-height: 1.55; }

  .admin-kpis,
  .ops-kpis,
  .core-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .admin-kpi,
  .ops-kpi { height: auto !important; min-height: 116px; }
  .admin-grid,
  .top-grid,
  .middle-grid,
  .bottom-grid,
  .ops-grid,
  .ops-top-grid,
  .ops-middle-grid,
  .ops-bottom-grid,
  .core-grid.two,
  .core-grid.three,
  .core-review-layout,
  .core-customer-layout,
  .core-gift-layout,
  .core-support-layout,
  .workflow-admin-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    height: auto !important;
  }
  .admin-panel { height: auto !important; min-width: 0; overflow-x: auto; }
  .admin-panel header { min-height: 48px; height: auto !important; gap: 10px; }
  .admin-table,
  .admin-table-head,
  .ops-table,
  .core-table { min-width: 680px; }
  .core-table-head,
  .core-table-row { min-width: 680px; }
  .core-row,
  .core-customer-row,
  .core-gift-row,
  .core-conversation {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
  }
  .core-row > *,
  .core-customer-row > *,
  .core-gift-row > *,
  .core-conversation > * { grid-column: auto !important; }
  .workflow-admin > .admin-heading { align-items: flex-start !important; flex-wrap: wrap; }
  .workflow-row { grid-template-columns: minmax(0, 1fr) !important; }
  .workflow-row-actions { justify-content: flex-start !important; }
  .workflow-dialog,
  .admin-dialog { width: calc(100vw - 24px) !important; max-height: calc(100dvh - 24px) !important; padding: 20px !important; }

  /* Existing visual CSS used 5–9px labels. Preserve hierarchy while keeping text readable. */
  :where(.admin-main, .admin-sidebar, .admin-top, .admin-dialog, .workflow-dialog)
  :where(p, li, label, small, button, a, input, select, textarea, dt, dd, time, span, em, i) {
    font-size: max(12px, 1em) !important;
    line-height: 1.4;
  }
  :where(.dashboard-main, .account-sidebar, .account-topbar, .account-dialog, .account-search-drawer, .account-mobile-bottom)
  :where(p, li, label, small, button, a, input, select, textarea, dt, dd, time, span, em, i) {
    font-size: max(12px, 1em) !important;
    line-height: 1.4;
  }
  .account-mobile-bottom a span { font-size: 11px !important; }
  .account-mobile-bottom { min-height: calc(68px + env(safe-area-inset-bottom)); height: auto !important; }
}

@media (max-width: 480px) {
  .admin-kpis,
  .ops-kpis,
  .core-kpis { grid-template-columns: minmax(0, 1fr) !important; }
  .admin-top form[data-global-search] { max-width: calc(100vw - 118px); }
  .workflow-dialog form { grid-template-columns: minmax(0, 1fr) !important; }
}

@media (prefers-reduced-motion: reduce) {
  .admin-sidebar { transition: none !important; }
  .account-mobile-menu span { transition: none !important; }
}


.primary-nav .primary-nav-account { display: none; }

/* Tablet-safe public navigation and artwork containment. */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

@media (max-width: 1100px) {
  .site-header .header-inner,
  body.journey-kit-exact .header-inner,
  body.verification-exact .header-inner {
    width: 100% !important;
    height: 72px !important;
    padding: 0 16px !important;
    margin: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 48px !important;
    gap: 10px !important;
  }
  .site-header,
  body.journey-kit-exact .site-header,
  body.verification-exact .site-header {
    position: sticky !important;
    top: 0;
    height: 72px !important;
    background: rgba(1, 5, 12, .96) !important;
    border-bottom: 1px solid rgba(122, 160, 203, .16) !important;
    backdrop-filter: blur(16px) !important;
  }
  .site-header .brand,
  body.journey-kit-exact .brand,
  body.verification-exact .brand { align-self: center !important; margin: 0 !important; }
  .site-header .brand img,
  body.journey-kit-exact .brand img,
  body.verification-exact .brand img {
    width: 148px !important;
    height: 58px !important;
    object-fit: contain;
    object-position: left center;
  }
  .site-header .nav-toggle {
    display: grid !important;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 8px;
    border: 1px solid rgba(118, 155, 198, .28);
    border-radius: 8px;
    background: #07111e;
  }
  .site-header .primary-nav,
  body.journey-kit-exact .primary-nav,
  body.verification-exact .primary-nav {
    position: fixed !important;
    z-index: 120;
    inset: 72px 12px auto 12px !important;
    width: auto !important;
    max-height: calc(100dvh - 88px);
    overflow: auto;
    display: none !important;
    flex-direction: column;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    padding: 10px !important;
    border: 1px solid #1c416b;
    border-radius: 12px;
    background: rgba(3, 12, 24, .99);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .65);
  }
  .site-header .primary-nav.open { display: flex !important; }
  .site-header .primary-nav a,
  body.journey-kit-exact .primary-nav a,
  body.verification-exact .primary-nav a {
    min-height: 44px;
    padding: 0 13px !important;
    display: flex;
    align-items: center;
    border-radius: 7px;
    font-size: 14px !important;
  }
  .site-header .primary-nav a.active::after { display: none !important; }
  .site-header .primary-nav .primary-nav-account {
    display: flex !important;
    min-height: 48px;
    margin-top: 6px;
    justify-content: space-between;
    color: #fff;
    border: 1px solid #2b83d7;
    background: linear-gradient(90deg, #0b376d, #0a2443);
  }
  .site-header .header-cta { display: none !important; }

  .kit-hero-product {
    right: -64px !important;
    width: min(720px, 70vw) !important;
    height: min(452px, 44vw) !important;
  }
  .kit-hero-product img {
    width: 100% !important;
    height: 100% !important;
  }
  .verification-hero-art {
    right: -44px !important;
    width: min(620px, 58vw) !important;
  }
  .kit-stage,
  .verification-stage,
  .kit-shell,
  .verification-shell { overflow-x: clip !important; }
}

/* VEVL Page 77 — administrator shell alignment after shared accessibility rules */
@media (max-width: 1180px) {
  .admin-current-section { display: block !important; }
  .admin-profile-menu { display: block !important; }
  .admin-user-copy { display: none !important; }
}
@media (max-width: 820px) {
  .admin-main:has(.admin77-overview) { padding: 86px 12px calc(28px + env(safe-area-inset-bottom)) !important; }
}

/* AIR08 shared admin-shell reconciliation: below 820px the global search moves to
   its own row, so it may use the full safe content width instead of the older
   inline-header cap that reserved room for account controls. */
@media (max-width: 820px) {
  .admin-top form[data-global-search] {
    width: calc(100vw - 32px) !important;
    max-width: none !important;
    flex: none;
  }
}
