/* RD NovaSphere V109 — direct-content entry, true fixed NovaAI overlay, alignment/mobile contract. */
:root{--rd-v109-nav-z:9800}

/* Background animation canvases are visual layers only. They may never create a blank page before content. */
body>canvas#network,
body>canvas#page-pattern,
body>canvas#linked-mesh,
body>canvas#nova-v103-constellation,
body>canvas#nova-v105-constellation,
body>canvas#network-canvas{
  position:fixed!important;inset:0!important;left:0!important;top:0!important;
  width:100vw!important;height:100vh!important;max-width:none!important;max-height:none!important;
  margin:0!important;padding:0!important;display:block!important;float:none!important;
  pointer-events:none!important;
}
/* Internal pages start with their first real interface, not a constellation-only spacer. */
html:not(.rd-homepage) body{padding-top:0!important}
html:not(.rd-homepage) body>.rd-v107-empty-lead{display:none!important;height:0!important;min-height:0!important;margin:0!important;padding:0!important}

/* Owner asked for no visible skip-to-content UI. */
.skip-link,.nova-skip-link,a.skip{display:none!important}

/* NovaAI contextual assistant must stay tied to viewport, never document flow. */
.nova-context-backdrop{position:fixed!important;inset:0!important;margin:0!important;z-index:2147482500!important}
.nova-context-panel{
  position:fixed!important;z-index:2147482600!important;
  margin:0!important;contain:layout paint style;
  overscroll-behavior:contain!important;
}
#novaUniversalLauncher,#novaTutorialLauncher{position:fixed!important}

/* Consistent alignment and intact words across cards, badges, tables and navigation. */
:where(.pill,.badge,.chip,.tag,.status-tag,.status-pill,.eyebrow,.btn,button,a[role="button"]){
  word-break:normal!important;overflow-wrap:normal!important;hyphens:none!important;
}
:where(.pill,.badge,.status-tag,.status-pill){
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  text-align:center!important;vertical-align:middle!important;white-space:nowrap!important;line-height:1.15!important;
}
:where(th,td){vertical-align:middle!important}
:where(.card,.panel,article,section,main,header,nav,footer,.shell,.container){min-width:0}
:where(h1,h2,h3,h4,h5,h6){text-wrap:balance;word-break:normal!important;overflow-wrap:normal!important;hyphens:none!important}
:where(p,li,label,small){word-break:normal!important;overflow-wrap:break-word!important;hyphens:none!important}

/* Stack-specific alignment: keep Long-term research and similar status pills intact. */
.nova-sovereign-stack .pill,
body:has(.topbar .brand small) .pill{min-width:max-content;padding-inline:.75rem!important}
.nova-sovereign-stack .table-wrap,
body:has(.topbar .brand small) .table-wrap{overflow-x:auto!important;-webkit-overflow-scrolling:touch}
.nova-sovereign-stack table,
body:has(.topbar .brand small) table{min-width:860px!important}

/* Full NovaAI workspace must always render above its background canvas. */
body:has(.app-shell)>.app-shell{position:relative!important;z-index:20!important;visibility:visible!important;opacity:1!important;transform:none!important}
body:has(.app-shell)>canvas#network{z-index:0!important}

@media(max-width:820px){
  html,body{width:100%;max-width:100%;overflow-x:hidden!important}
  :where(.shell,.container,.card,.panel,section,article,main){max-width:100%}
  img,video,svg{max-width:100%;height:auto}
  input,textarea,select,button{min-width:0;max-width:100%}
  .nova-context-panel{
    left:max(8px,env(safe-area-inset-left,0px))!important;
    right:max(8px,env(safe-area-inset-right,0px))!important;
    top:auto!important;bottom:max(8px,env(safe-area-inset-bottom,0px))!important;
    width:auto!important;max-width:none!important;max-height:min(82dvh,720px)!important;
  }
  .nova-context-messages{min-height:0!important}
  .nova-context-compose textarea{font-size:16px!important;width:100%!important}
  .nova-context-actions{min-width:0!important}
  .nova-context-send{flex:0 0 auto!important;white-space:nowrap!important}
  .table-wrap{max-width:100%;overflow-x:auto!important;-webkit-overflow-scrolling:touch}
  table{max-width:none}
  :where(.pill,.badge,.status-tag,.status-pill){max-width:none!important}
}

@media(max-width:480px){
  :where(h1,h2,h3,h4){max-width:100%}
  .nova-context-panel{border-radius:20px!important}
  .nova-context-head{grid-template-columns:minmax(0,1fr) auto!important}
  .nova-context-page,.nova-context-title{min-width:0;overflow-wrap:break-word!important}
  .nova-context-voicebar{gap:.4rem!important}
  .nova-context-voicebar button{white-space:nowrap!important}
}
