/* Shared closing and recovery controls, loaded after both CSS bundles. */
.mley-panel-controls[hidden], [data-panel-restore][hidden], #mley-nav-sidebar-toggle[hidden],
#mley-law-guide-sources[hidden], #mleyV2Inspector[hidden] { display: none !important; }
.mley-panel-controls {
  display: flex; gap: .4rem; overflow-x: auto; align-items: center;
  padding: .25rem max(.5rem, env(safe-area-inset-right)) .35rem max(.5rem, env(safe-area-inset-left));
  scrollbar-width: thin; max-width: 100%; min-width: 0;
}
.mley-panel-controls > button { flex: 0 0 auto; min-height: 44px; white-space: nowrap; font-size: .8rem; }
.mley-panel-controls :focus-visible, [data-panel-close]:focus-visible { outline: 2px solid var(--accent-color); outline-offset: -2px; }
.mley-page-offset { padding-top: max(4.75rem, calc(var(--mley-header-height, 60px) + 1rem)); }
@media (max-width:79.999em) {
  .fixed-header .mley-navbar__panel {
    top: calc(var(--mley-header-height, 60px) + .25rem);
    max-height: calc(100dvh - var(--mley-header-height, 60px) - 1rem);
  }
}

[data-panel-close] {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; min-width: 44px; height: 44px; padding: 0;
  color: var(--text-color); background: var(--bg-surface-2);
  border: 1px solid var(--border-color); border-radius: .5rem; cursor: pointer; font-size: 1.25rem;
}
#mley-nav-sidebar-toggle:not([hidden]) { display: inline-flex; }
.mley-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; position: sticky; top: 0; z-index: 2; background: var(--bg-surface); }
.mley-sources-hidden { grid-template-columns: minmax(0, 1fr); }
.mley-v2-topbar > .mley-panel-controls { grid-column: 1 / -1; }
body[data-page-kind="home-v2"].mley-inspector-hidden .mley-v2-workspace { grid-template-columns: minmax(0, 1fr); }
body[data-page-kind="home-v2"] .mley-v2-inspector__head { position: sticky; top: 0; z-index: 2; background: var(--v2-shell); }
body[data-page-kind="home-v2"] #mleyV2Inspector .mley-v2-inspector__close { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
.article-graph-details > .mley-panel-heading { margin-bottom: .5rem; }
@media (min-width:1081px) {
  body.mley-sidebar-collapsed #menu { display: none !important; }
  body.mley-sidebar-collapsed #panel { margin-left: 0 !important; }
  body.mley-sidebar-collapsed #panel :is(.home-content-shell, #contain_id.ley-content-shell) { width: 100% !important; max-width: 100% !important; padding-inline: 1rem !important; }
}
@media print { .mley-panel-controls, [data-panel-close] { display: none !important; } }

@media (min-width:1081px) {
  body.mley-oaj-page.mley-sidebar-collapsed:not(.mley-reader-open):not(.mley-cjf-document-open) #panel { margin-left: 0 !important; width: 100%; }
  body.mley-oaj-page .mley-oaj-navbar #mley-nav-sidebar-toggle:not([hidden]) { display: inline-flex !important; }
}

