/* Step 602 — external focus frames removed and one blur owner per surface.

   Two defects are corrected here.

   Focused controls painted a gold outline outside their own shell. Chromium
   engines such as Opera GX showed it far more often than WebKit because
   :focus-visible heuristics are deliberately engine-defined, so the same
   interaction produced a visible frame in one browser and nothing in another.
   Keyboard feedback is retained inside each control instead.

   Two surfaces also asked the compositor to blur through a filtered or fixed
   dark ancestor. Nested backdrop filters have no settled cross-engine
   behaviour, so Opera resolved the darker intermediate layer while Safari
   resolved more of the underlying page. Each affected surface now owns its
   blur alone, at the strength already accepted.

   Nothing here changes gradients, dimensions or state colours. This layer
   removes duplicate filters and outer frames, keeps non-Classic column bars
   neutral, and gives the fixed 5px table blur one browser-independent owner. */

/* 1a. File pickers. The native input is invisible and covers the whole shell,
   so the frame appeared outside the visible control rather than on it. */
html body .file-picker-shell:focus-within,
html body .file-picker-shell input[type="file"]:focus,
html body .file-picker-shell input[type="file"]:focus-visible {
  outline: 0 !important;
  outline-offset: 0 !important;
}

/* Keyboard focus is now an internal neutral edge on the shell itself. */
html body .file-picker-shell:focus-within,
html[data-visionx-theme] body.visionx-shell #registry-import-dialog .file-picker-shell:focus-within {
  border-color: rgba(207, 211, 206, .46) !important;
  box-shadow:
    inset 0 0 0 1px rgba(207, 211, 206, .22),
    inset 0 1px .25rem rgba(0, 0, 0, .3) !important;
}

/* 1b. Primary navigation. The established metallic text change already
   communicates focus, so the outer frame is redundant. */
html body .primary-nav button:focus-visible,
html body .brand-copy > .primary-nav button:focus-visible {
  outline: 0 !important;
  outline-offset: 0 !important;
}

/* 1c. Whole-page panels. Views carry tabindex="-1" and receive focus only
   programmatically after navigation, so no frame belongs around the page.
   The selected tab and the revealed panel remain the state signal. */
html body .view:focus-visible,
html body main#main-content:focus-visible {
  outline: 0 !important;
  outline-offset: 0 !important;
}

/* 2a. Detached column bar. Chromium and WebKit do not agree when the
   scrolling table and its backdrop filter share the same local compositor
   subtree. The filtered veil is therefore portalled beside <main> and CSS
   anchors keep it physically attached to its source table shell.

   The visible detached header remains sharp. Its child header also carries no
   filter, so the body-level veil is the one and only 5px blur owner. */
html[data-visionx-theme] body.visionx-shell .visionx-table-header-viewport,
html[data-visionx-theme] body.visionx-shell .visionx-table-header-viewport thead {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* 2b. Publication readiness. The diagnostics surface carried a fixed black
   background that every Glass card then blurred through. It now consumes the
   active themed card material and owns the single Glass blur. */
html[data-visionx-theme] body.visionx-shell main#main-content .view .publication-diagnostics {
  position: relative !important;
  isolation: isolate !important;
  border-color: var(--visionx-card-surface-border) !important;
  background: var(--visionx-card-surface-background) !important;
  background-clip: var(--visionx-card-surface-background-clip) !important;
  box-shadow: var(--visionx-card-surface-shadow) !important;
}

html[data-visionx-theme="glass"] body.visionx-shell main#main-content .view .publication-diagnostics {
  -webkit-backdrop-filter: blur(10px) saturate(106%) !important;
  backdrop-filter: blur(10px) saturate(106%) !important;
}

/* The cards keep their red/green borders, tint and restrained glow exactly,
   and simply stop filtering the surface they sit on. */

/* The enclosing `.window` is itself filtered, so in Chromium it remains the
   backdrop root any nested Glass surface samples, while WebKit reaches further
   back into the page. That boundary is deliberate and unchanged here; what this
   layer removes is the duplicated filter and the fixed black material that made
   the difference legible as tint. If a residual difference is still visible at
   0% Glass, the next scoped correction is to stop nesting a second blur inside
   `.window` for the affected surface — never to add tint to compensate. */
html[data-visionx-theme="glass"] body.visionx-shell main#main-content .view .publication-gate-card {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* 3. Non-Classic column-bar paint. Classic deliberately keeps its established
   warm metallic edge and #9c9689 header ink. Glass and custom-gradient bars
   should not inherit those Classic cues: retain the structural dark seal only,
   remove both warm inset separator lines, and use an equal-luminance neutral
   gray for the detached header text. */
html[data-visionx-theme="glass"][data-visionx-custom-tabs="false"] body.visionx-shell .visionx-table-header-viewport thead,
html[data-visionx-theme][data-visionx-custom-tabs="true"] body.visionx-shell .visionx-table-header-viewport thead {
  box-shadow:
    0 -3px 0 3px rgba(7, 8, 6, .96) !important;
}

html[data-visionx-theme="glass"][data-visionx-custom-tabs="false"] body.visionx-shell .visionx-table-header-viewport th,
html[data-visionx-theme][data-visionx-custom-tabs="true"] body.visionx-shell .visionx-table-header-viewport th {
  color: #969696 !important;
}

/* 4. Top chrome occlusion.
   The body-level separated-table header intentionally sits above page content
   so Chromium can render its 5px backdrop blur correctly. Keep the application
   header above that portal so a table column bar cannot paint through the
   global header while the page scrolls. This changes stacking only; portal
   positioning, blur strength and scrolling remain untouched. */
html[data-visionx-theme] body.visionx-shell #app-header {
  z-index: 100 !important;
}
