/* NovaAI V51 — display controls + mobile compact glass. UI-only layer. */
#enableCompassBtn{display:none!important}
.v51-display-settings{align-items:flex-start!important}
.v51-display-controls{display:grid;gap:10px;width:min(100%,560px)}
.v51-toggle-row,.v51-fullscreen-row{display:flex!important;align-items:center;justify-content:space-between;gap:16px;padding:12px 14px;border:1px solid rgba(115,184,255,.16);border-radius:14px;background:rgba(5,18,38,.42)}
.v51-toggle-row>span,.v51-fullscreen-row>span{display:grid;gap:3px;min-width:0}
.v51-toggle-row small,.v51-fullscreen-row small{font-size:11px;line-height:1.35;color:rgba(205,220,240,.62);font-weight:400}
.v51-toggle-row input{width:20px;height:20px;accent-color:#55bfff;flex:0 0 auto}
body.nova-compass-disabled #novaCompassLogo{transform:none!important}
body.nova-compass-disabled .north-orb{left:50%!important;top:calc(50% - 72px)!important;transform:translate(-50%,-50%)!important}

@media(max-width:600px){
  /* More compact frosted conversation cards without changing message semantics. */
  .messages{padding-top:14px!important;padding-bottom:104px!important}
  .message{grid-template-columns:34px minmax(0,1fr)!important;gap:8px!important;margin-bottom:10px!important}
  .message .avatar{width:34px!important;height:34px!important;border-radius:12px!important}
  .message-body{max-width:96%!important;padding:10px 12px 9px!important;border-radius:16px!important;background:linear-gradient(145deg,rgba(8,25,50,.58),rgba(3,13,29,.64))!important;backdrop-filter:blur(22px) saturate(135%)!important;-webkit-backdrop-filter:blur(22px) saturate(135%)!important;box-shadow:0 10px 28px rgba(0,0,0,.24),inset 0 1px 0 rgba(255,255,255,.06)!important}
  .message.user .message-body{max-width:82%!important;padding:9px 11px 8px!important;background:linear-gradient(145deg,rgba(14,50,82,.56),rgba(5,24,47,.62))!important}
  .message.assistant .message-body{background:linear-gradient(145deg,rgba(8,24,49,.60),rgba(3,13,29,.66))!important}
  .message-role{margin-bottom:3px!important;font-size:9px!important;line-height:1.25!important}
  .message-content{font-size:14px!important;line-height:1.48!important}
  .message-content p{margin:.42em 0!important}
  .message-actions{margin-top:7px!important;padding-top:6px!important;gap:5px!important}
  .message-action{min-height:34px!important;padding:6px 9px!important;font-size:11px!important;border-radius:10px!important}
  .v51-toggle-row,.v51-fullscreen-row{padding:10px 11px}
  .v51-fullscreen-row{align-items:flex-start;flex-direction:column}
}

/* V52 — user-controlled overlay. Hidden unless explicitly enabled in Settings. */
#novaPresence{display:none!important}
body.nova-overlay-enabled #novaPresence{display:block!important}
body:not(.nova-overlay-enabled) #novaAssistOverlay{display:none!important}

/* V52 — keep the composer focused instead of stretching across large/fullscreen displays. */
@media(min-width:821px){
  body:has(.app-shell) .composer-wrap{padding-left:clamp(24px,4vw,64px)!important;padding-right:clamp(24px,4vw,64px)!important}
  body:has(.app-shell) #composer.composer{width:min(980px,calc(100vw - 360px))!important;max-width:980px!important;margin-left:auto!important;margin-right:auto!important}
  body:fullscreen:has(.app-shell) #composer.composer,
  body:-webkit-full-screen:has(.app-shell) #composer.composer{width:min(980px,72vw)!important;max-width:980px!important}
}

/* V53 — authoritative user-controlled NovaAI overlay visibility.
   Must outrank legacy #novaPresence display:flex rules in novaai.css. */
html body:not(.nova-overlay-enabled) #novaPresence.nova-presence {
  display:none !important;
  visibility:hidden !important;
  pointer-events:none !important;
}
html body.nova-overlay-enabled #novaPresence.nova-presence {
  visibility:visible !important;
}
html body:not(.nova-overlay-enabled) #novaAssistOverlay.nova-assist-overlay {
  display:none !important;
  visibility:hidden !important;
  pointer-events:none !important;
}


/* V54 — compact desktop composer. Width and height only; message behaviour untouched. */
@media(min-width:821px){
  body:has(.app-shell) #composer.composer{
    width:min(760px,calc(100vw - 400px))!important;
    max-width:760px!important;
    padding:8px 10px 7px!important;
    border-radius:17px!important;
  }
  body:fullscreen:has(.app-shell) #composer.composer,
  body:-webkit-full-screen:has(.app-shell) #composer.composer{
    width:min(760px,64vw)!important;
    max-width:760px!important;
  }
  body:has(.app-shell) #promptInput{
    min-height:26px!important;
    padding:2px 4px 5px!important;
    line-height:1.4!important;
  }
}


/* V55 — overlay anchor/fullscreen/mobile polish only. */
html:fullscreen body.nova-overlay-enabled #novaPresence.nova-presence,
html:-webkit-full-screen body.nova-overlay-enabled #novaPresence.nova-presence{
  display:flex!important;visibility:visible!important;pointer-events:none!important;z-index:2147483646!important;
}
html:fullscreen body.nova-overlay-enabled #novaAssistOverlay.nova-assist-overlay:not([hidden]),
html:-webkit-full-screen body.nova-overlay-enabled #novaAssistOverlay.nova-assist-overlay:not([hidden]){
  display:flex!important;visibility:visible!important;pointer-events:auto!important;z-index:2147483647!important;
}
@media(max-width:600px){
  html body #novaPresence.nova-presence #novaOrb.nova-orb{width:58px!important;height:58px!important;min-width:58px!important;min-height:58px!important;max-width:58px!important;max-height:58px!important}
  body:has(.app-shell) #composer.composer{width:calc(100vw - 24px)!important;max-width:calc(100vw - 24px)!important;padding:7px 9px 6px!important;border-radius:16px!important}
  body:has(.app-shell) #promptInput{min-height:24px!important;line-height:1.35!important}
}
