.nexus-launcher {
  position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 1100; display: flex; align-items: center; justify-content: center; gap: 10px;
  min-width: 64px; min-height: 64px; padding: 10px; border: 2px solid #fff; border-radius: 22px;
  background: var(--brand-nature-dark, #015c55); color: #fff; text-decoration: none;
  box-shadow: 0 4px 14px #10283326; transition: background 160ms ease;
}
body .nexus-launcher svg { color: #fff; width: 42px; height: 42px; flex: none; }
.nexus-launcher:hover { background: #10463f; color: #fff; }
.nexus-launcher:focus-visible, .nexus-return:focus-visible { outline: 3px solid #f9b703; outline-offset: 4px; }
.nexus-launcher-label { display: none; font: 700 14px/1.4 var(--font-ui, system-ui); padding-right: 6px; }
.nexus-launcher-label span { display: block; font-size: 12px; font-weight: 400; }
@media (hover: hover) and (min-width: 761px) {
  .nexus-launcher:hover .nexus-launcher-label, .nexus-launcher:focus-visible .nexus-launcher-label { display: block; }
}
.nexus-fullbar { position: sticky; top: 0; z-index: 1100; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--line); }
.nexus-fullbar > div { display: flex; align-items: center; gap: 10px; color: var(--brand-nature-dark); }
.nexus-fullbar svg { width: 36px; height: 36px; }
.nexus-return { color: var(--brand-nature-dark); font-weight: 700; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.nexus-return:hover { background: var(--surface-evidence); }
.nexus-launcher[hidden], .nexus-fullbar[hidden] { display: none !important; }
body.nexus-full > .observer-nav, body.nexus-full > .topbar, body.nexus-full > .site-footer { display: none; }
body.nexus-full .shell { display: block; width: 100%; max-width: 1600px; margin: 0 auto; padding: 24px; min-height: calc(100dvh - 80px); }
body.nexus-full .shell > :not(.content), body.nexus-full .content > :not(#agentPanel) { display: none !important; }
body.nexus-full #agentPanel { margin: 0; width: 100%; }
body.nexus-full .agent-head h2 { font-size: 1.5rem; }
body:has(.nexus-launcher) .site-footer { padding-bottom: 100px; }
@media(max-width: 760px) {
  .nexus-launcher { min-width: 56px; min-height: 56px; padding: 7px; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); border-radius: 19px; }
  body .nexus-launcher svg { color: #fff; width: 36px; height: 36px; }
  .nexus-fullbar { padding: 8px 12px; gap: 8px; }
  .nexus-fullbar strong { font-size: 14px; }
  .nexus-return { font-size: 13px; padding: 10px 8px; }
  body.nexus-full .shell { padding: 16px 12px; }
}
@media(prefers-reduced-motion: reduce) { .nexus-launcher { transition: none; } }
@media print { .nexus-launcher, .nexus-fullbar { display: none !important; } }

/* Keep the original document mounted: filters, pagination and scroll survive. */
.nexus-launcher.nexus-obscured { visibility: hidden; pointer-events: none; }
html.nexus-overlay-open { overflow: hidden; }
dialog.nexus-overlay { position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: var(--paper); color: var(--ink); }
dialog.nexus-overlay[open] { display: flex; flex-direction: column; }
.nexus-overlay::backdrop { background: var(--paper); }
.nexus-overlay-bar { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 12px; padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); background: var(--panel); border-bottom: 1px solid var(--line); }
.nexus-overlay-bar > div { display: flex; align-items: center; gap: 8px; color: var(--brand-nature-dark); }
.nexus-overlay-bar svg { width: 32px; height: 32px; }
.nexus-overlay iframe { display: block; width: 100%; flex: 1; min-height: 0; border: 0; background: var(--paper); }
@media(max-width:760px) {
 .nexus-overlay-bar { gap: 8px; padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: 8px; }
 .nexus-overlay-bar strong { font-size: 13px; }
 .nexus-overlay-bar .nexus-return { min-height: 44px; font-size: 12px; white-space: normal; }
 .nexus-overlay-bar > div { min-width: 0; }
}
.nexus-overlay-bar button.nexus-return { background: var(--panel); color: var(--brand-nature-dark); border: 1px solid var(--line); box-shadow: none; }
.nexus-overlay-bar button.nexus-return:hover { background: var(--surface-evidence); }

/* Embedded routes share the same frame without hiding their own filters. */
body.radar-embedded-screen > .observer-nav,
body.radar-embedded-screen > .topbar,
body.radar-embedded-screen > .site-footer { display: none; }
body.radar-embedded-screen .shell { width: 100%; max-width: 1600px; margin: 0 auto; padding: 20px; }
@media(max-width:760px) { body.radar-embedded-screen .shell { padding: 12px; } }
.nexus-overlay-bar button.nexus-return { width: auto; flex: 0 0 auto; }
