/* Nexus social-first refresh. Scoped to the Nexus route; global theme tokens remain authoritative. */
body.nord-nexus-active{--nx-line:var(--border);--nx-card:var(--surface)}
body.nord-nexus-active .nx-shell{background:var(--surface)!important;color:var(--text)}
body.nord-nexus-active .nx-tabs{background:var(--surface)!important;border-bottom:1px solid var(--nx-line)!important}
body.nord-nexus-active .nx-tabs button{font-size:13px!important;font-weight:700!important;letter-spacing:0!important}
body.nord-nexus-active .nx-tabs button.active:after{left:23%!important;right:23%!important;height:2px!important}
body.nord-nexus-active .nx-stories{background:var(--surface)!important;padding:20px 20px 16px!important;gap:16px!important}
body.nord-nexus-active .nx-story-card{transition:transform .18s ease}
body.nord-nexus-active .nx-story-card:hover{transform:translateY(-2px)}
body.nord-nexus-active .nx-compose{background:var(--surface)!important;padding:18px 22px!important;gap:14px!important;align-items:start}
body.nord-nexus-active .nx-compose textarea{font-size:14px!important;min-height:46px!important;line-height:1.55!important}
body.nord-nexus-active .nx-compose textarea::placeholder{opacity:1;color:var(--muted)}
body.nord-nexus-active .nx-compose button{border-radius:12px;transition:filter .15s ease,transform .15s ease}
body.nord-nexus-active .nx-compose button:hover{filter:brightness(1.05)}
body.nord-nexus-active .nx-instagram-post{background:var(--surface)!important;border-bottom:1px solid var(--nx-line)!important}
body.nord-nexus-active .nx-instagram-post .nx-post-head{padding:14px 20px!important;min-height:64px!important}
body.nord-nexus-active .nx-instagram-post .nx-post-head strong{font-size:13px!important}
body.nord-nexus-active .nx-instagram-post .nx-post-text{font-size:13px!important;line-height:1.65!important;padding:8px 20px 16px!important}
body.nord-nexus-active .nx-instagram-post .nx-action{font-size:12px!important}
body.nord-nexus-active .nx-instagram-post .nx-actions{padding:10px 13px 2px!important}
body.nord-nexus-active .nx-right{background:var(--surface)!important}
body.nord-nexus-active .nx-right>*,body.nord-nexus-active .nx-right>div{box-shadow:none!important}
body.nord-nexus-active .nx-main{background:var(--surface)!important}
body.nord-nexus-active #nordNexusSidebar{background:var(--surface)!important}
body.nord-nexus-active #nordNexusSidebar .nx-sidebar-inner{background:var(--surface)!important}
body.nord-nexus-active .nx-nav button,body.nord-nexus-active .nx-sidebar button{transition:background .18s ease,color .18s ease}
body.nord-nexus-active :is(.nx-compose,.nx-instagram-post,.nx-right) :is(button,a,textarea):focus-visible{outline:2px solid var(--accent)!important;outline-offset:3px}
@media(min-width:1121px){
  body.nord-nexus-active .nx-grid{grid-template-columns:minmax(0,1fr) 310px!important;gap:0!important;max-width:1200px!important;margin:0 auto!important;background:var(--surface)!important}
  body.nord-nexus-active .nx-main{border-left:1px solid var(--nx-line)!important;border-right:1px solid var(--nx-line)!important}
  body.nord-nexus-active .nx-right{padding:26px 20px!important}
}
@media(min-width:1025px){
  body.nord-nexus-active .nord-shell{grid-template-columns:var(--rail) 240px minmax(0,1fr)!important}
  body.nord-nexus-active #nordNexusSidebar{width:240px!important;min-width:240px!important;max-width:240px!important}
  body.nord-nexus-active #nordNexusSidebar .nx-sidebar-inner{padding:18px 11px!important}
  body.nord-nexus-active .nord-main{grid-template-rows:0 minmax(0,1fr)!important}
  body.nord-nexus-active .nord-topbar{height:0!important;min-height:0!important;padding:0!important;border:0!important;overflow:visible!important}
  body.nord-nexus-active .nord-topbar>*{visibility:hidden!important;pointer-events:none!important}
  body.nord-nexus-active .nord-topbar #nxTopbarNotifications{visibility:visible!important;pointer-events:auto!important;position:fixed!important;top:18px!important;right:20px!important;z-index:100!important}
  body.nord-nexus-active .nord-page{grid-row:2!important}
}
@media(min-width:1025px) and (max-width:1399px){
  body.nord-nexus-active .nx-grid{grid-template-columns:minmax(0,1fr) 265px!important}
}
@media(max-width:1120px){
  body.nord-nexus-active .nx-grid{grid-template-columns:minmax(0,1fr)!important}
  body.nord-nexus-active .nx-right{display:none!important}
}
@media(max-width:760px){
  body.nord-nexus-active .nx-stories{padding:12px!important;gap:10px!important}
  body.nord-nexus-active .nx-compose{padding:13px!important;grid-template-columns:36px minmax(0,1fr)!important}
  body.nord-nexus-active .nx-instagram-post .nx-post-head{padding:10px 12px!important}
  body.nord-nexus-active .nx-instagram-post .nx-post-text{padding:6px 12px 14px!important}
}
@media(prefers-reduced-motion:reduce){body.nord-nexus-active .nx-story-card,body.nord-nexus-active .nx-compose button{transition:none!important}}

/* Composer v2 – semantic dialog replaces the old inline textarea. */
body.nord-nexus-active .nx-compose-launcher{display:flex!important;align-items:center!important;gap:12px!important;min-height:92px}
body.nord-nexus-active .nx-compose-launcher>.nx-avatar{flex:0 0 auto}
body.nord-nexus-active .nx-compose-prompt{flex:1;min-width:0;padding:15px 8px;border:0;background:transparent;color:var(--muted);font:inherit;font-size:14px;text-align:left;cursor:pointer}
body.nord-nexus-active .nx-compose-image{flex:0 0 34px}
body.nord-nexus-active .nx-compose-launcher .nx-post-btn{flex:0 0 auto;padding:12px 18px;font-size:12px}
.nx-compose-overlay{position:fixed;inset:0;z-index:9000;display:grid;place-items:center;padding:18px;background:rgba(5,9,19,.64);backdrop-filter:blur(3px)}
.nx-compose-dialog{width:min(550px,100%);max-height:calc(100dvh - 36px);display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--border);border-radius:18px;background:var(--surface);color:var(--text);box-shadow:0 30px 90px rgba(0,0,0,.25)}
.nx-compose-dialog-head{display:flex;align-items:center;justify-content:center;position:relative;border-bottom:1px solid var(--border);padding:17px 52px}
.nx-compose-dialog-head h2{font-size:16px;margin:0;font-weight:800}
.nx-compose-close{position:absolute;right:12px;top:10px;width:36px;height:36px;border:0;border-radius:10px;background:var(--surface-2);color:var(--text);cursor:pointer}
.nx-compose-dialog-body{padding:20px;min-height:0;overflow-y:auto}
.nx-compose-identity{display:flex;gap:10px;align-items:center;font-size:13px}
.nx-compose-dialog textarea{display:block;width:100%;min-height:140px;margin-top:16px;padding:8px 0;border:0;background:transparent;color:var(--text);font:inherit;font-size:15px;line-height:1.6;resize:vertical;outline:none}
.nx-compose-dialog textarea::placeholder{color:var(--muted)}
.nx-compose-dialog .nx-media-field{display:block!important;margin:0;padding-top:12px;border-top:1px solid var(--border)}
.nx-compose-dialog .nx-media-field label{display:block;margin-bottom:8px;color:var(--muted);font-size:12px}
.nx-compose-dialog .nx-media-field input{width:100%;font-size:13px}
.nx-compose-preview:not([hidden]){display:grid;place-items:center;max-height:280px;margin-top:12px;border:1px solid var(--border);border-radius:12px;overflow:hidden}
.nx-compose-preview img{width:100%;max-height:280px;object-fit:contain}
.nx-compose-dialog-foot{padding:13px 20px;border-top:1px solid var(--border);display:flex;justify-content:space-between;align-items:center}
.nx-compose-dialog-foot .nx-post-btn{padding:11px 23px}
.nx-state-social{min-height:260px!important;background:var(--surface)}
.nx-state-social>div{max-width:360px;padding:32px 16px}
.nx-state-social strong{font-size:17px!important}
.nx-state-social small{font-size:13px!important;line-height:1.5!important}
.nx-empty-actions{display:flex;justify-content:center;flex-wrap:wrap;gap:9px;margin-top:18px}
.nx-empty-actions button{min-height:38px;border:1px solid var(--border);background:var(--surface);color:var(--text);border-radius:10px;padding:0 13px;font:inherit;font-size:12px;font-weight:700;cursor:pointer}
.nx-empty-actions button:last-child{border-color:var(--accent);background:var(--accent);color:white}
@media(max-width:580px){body.nord-nexus-active .nx-compose-launcher .nx-post-btn{display:none}.nx-compose-dialog-body{padding:16px}.nx-compose-dialog textarea{min-height:100px}}

/* Full-height Nexus viewport: keep the social surface flush with the bottom of the app. */
body.nord-nexus-active .nord-page{height:100%!important;min-height:0!important;background:var(--surface)!important}
body.nord-nexus-active #page-hub{height:100%!important;min-height:100%!important;background:var(--surface)!important}
body.nord-nexus-active #page-hub .nx-shell{display:flex!important;flex-direction:column!important;min-height:100%!important;height:auto!important;background:var(--surface)!important}
body.nord-nexus-active #page-hub .nx-grid{flex:1 0 auto!important;min-height:100%!important;align-items:stretch!important}
body.nord-nexus-active #page-hub .nx-main{display:flex!important;flex-direction:column!important;min-height:100%!important}
body.nord-nexus-active #page-hub #nxFeedList{flex:1 0 auto!important;display:flex!important;flex-direction:column!important}
body.nord-nexus-active #page-hub #nxFeedList>.nx-state:only-child{flex:1 0 300px!important;display:flex!important;align-items:center!important;justify-content:center!important}
body.nord-nexus-active #page-hub .nx-right{min-height:100%!important}
@media(max-width:1024px){body.nord-nexus-active #page-hub .nx-grid{min-height:100%!important}}

/* Re-enable the shared Nord account dropdown without duplicating account state. */
@media(min-width:1025px){
  body.nord-nexus-active .nord-topbar #nordAccountMenuWrap{
    visibility:visible!important;pointer-events:auto!important;position:fixed!important;
    top:17px!important;right:76px!important;z-index:160!important;
    display:block!important
  }
  body.nord-nexus-active .nord-topbar #nordAccountMenuWrap *,
  body.nord-nexus-active .nord-topbar #nordAccountTrigger,
  body.nord-nexus-active .nord-topbar #nordAccountDropdown{
    visibility:visible!important;pointer-events:auto!important
  }
  body.nord-nexus-active .nord-topbar #nordAccountTrigger{
    display:flex!important;min-height:44px!important;background:var(--surface)!important;
    border:1px solid var(--border)!important;border-radius:13px!important
  }
  body.nord-nexus-active .nord-topbar #nordAccountDropdown{
    position:absolute!important;top:calc(100% + 8px)!important;right:0!important;
    z-index:200!important
  }
  body.nord-nexus-active .nord-topbar #nxTopbarNotifications{right:20px!important}
}


/* Post composer: natural writing surface and native Nexus media upload. */
.nx-compose-dialog{width:min(600px,calc(100vw - 24px));max-height:85dvh}
.nx-compose-dialog textarea{resize:none!important;outline:0!important;border:0!important;box-shadow:none!important;min-height:120px;max-height:320px;overflow-y:auto}
.nx-compose-dialog textarea:focus{outline:none!important;box-shadow:none!important}
.nx-compose-dialog .nx-compose-drop{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;width:100%;min-height:126px;padding:18px;border:1px dashed var(--border);border-radius:14px;background:var(--surface-2);color:var(--text);cursor:pointer;text-align:center}
.nx-compose-dialog .nx-compose-drop i{font-size:24px;color:var(--accent)}
.nx-compose-dialog .nx-compose-drop strong{font-size:13px}
.nx-compose-dialog .nx-compose-drop small{font-size:11px;color:var(--muted)}
.nx-compose-dialog .nx-compose-drop:hover{border-color:var(--accent)}
.nx-compose-dialog .nx-compose-preview{position:relative}
.nx-compose-dialog .nx-compose-preview video{max-width:100%;max-height:280px}
.nx-compose-dialog .nx-compose-remove{position:absolute;top:8px;right:8px;display:grid;place-items:center;width:32px;height:32px;border:0;border-radius:50%;background:rgba(0,0,0,.7);color:#fff;font-size:24px;cursor:pointer}
.nx-compose-dialog .nx-compose-status{min-height:18px;font-size:12px;color:var(--muted);margin-top:8px}
.nx-compose-dialog-foot #nxComposeCount{margin-left:auto;margin-right:15px;font-size:11px;color:var(--muted)}
.nx-compose-dialog-foot #nxPublish:disabled{opacity:.5;cursor:not-allowed}
@media(max-width:640px){.nx-compose-overlay{padding:8px}.nx-compose-dialog{max-height:calc(100dvh - 16px)}}

/* Unified Nexus background token, scoped so other SaaS workspaces are unaffected.
   --bg now resolves to the active global surface color inside Nexus only. */
body.nord-nexus-active{
  --bg:var(--surface);
}
body.nord-nexus-active .nord-main,
body.nord-nexus-active .nord-page,
body.nord-nexus-active #page-hub,
body.nord-nexus-active #page-hub .nx-shell,
body.nord-nexus-active #page-hub .nx-grid,
body.nord-nexus-active #page-hub .nx-main,
body.nord-nexus-active #page-hub .nx-right{
  box-sizing:border-box!important;
  min-width:0!important;
  max-width:100%!important;
  background-color:var(--surface)!important;
}
body.nord-nexus-active #page-hub .nx-grid{
  width:100%!important;
}
body.nord-nexus-active .nord-page{
  overflow-x:hidden!important;
}
body.nord-nexus-active.nexus-explore-open #page-hub .nx-explore-page,
body.nord-nexus-active.nexus-explore-open #page-hub .nx-explore-content{
  box-sizing:border-box!important;
  min-width:0!important;
  max-width:100%!important;
  background:var(--surface)!important;
}
body.nord-nexus-active.nexus-explore-open #page-hub .nx-explore-page{
  width:100%!important;
}
body.nord-nexus-active.nexus-explore-open #page-hub .nx-explore-search-shell,
body.nord-nexus-active.nexus-explore-open #page-hub .nx-explore-filters{
  min-width:0!important;
  max-width:100%!important;
}

/* No artificial right-edge track: scroll only when content actually overflows. */
body.nord-nexus-active .nord-page{scrollbar-gutter:auto!important;padding-right:0!important;margin-right:0!important}
body.nord-nexus-active .nord-main,
body.nord-nexus-active #page-hub,
body.nord-nexus-active #page-hub .nx-shell{padding-right:0!important;margin-right:0!important}
body.nord-nexus-active #page-hub .nx-grid{max-width:100%!important}

/* The scroll viewport must extend to the browser edge, without a visible right-side track. */
body.nord-nexus-active .nord-page{
  width:100%!important;
  min-width:0!important;
  scrollbar-width:none!important;
  scrollbar-gutter:auto!important;
  border-right:0!important;
}
body.nord-nexus-active .nord-page::-webkit-scrollbar{display:none!important;width:0!important}
body.nord-nexus-active #page-hub,
body.nord-nexus-active #page-hub .nx-shell,
body.nord-nexus-active #page-hub .nx-grid{
  border-right:0!important;
  margin-right:0!important;
}

/* One calm loading state across all Nexus views; hide legacy feed skeleton cards. */
body.nord-nexus-active #page-hub .nx-unified-loading{
  min-height:max(340px,calc(100dvh - 180px));
  flex:1 1 auto;display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:10px;padding:36px 18px;text-align:center;background:var(--surface);color:var(--text);
}
body.nord-nexus-active #page-hub .nx-unified-loader{position:relative;display:grid;place-items:center;width:80px;height:80px;margin-bottom:6px}
body.nord-nexus-active #page-hub .nx-unified-logo{display:grid;place-items:center;width:55px;height:55px;border-radius:17px;background:linear-gradient(145deg,var(--accent),#25b8d5);color:white;font-size:24px;font-weight:900;letter-spacing:-.04em}
body.nord-nexus-active #page-hub .nx-unified-ring{position:absolute;inset:0;border:2px solid var(--border);border-top-color:var(--accent);border-radius:50%;animation:nxUnifiedSpin 1.25s linear infinite}
body.nord-nexus-active #page-hub .nx-unified-loading strong{font-size:16px;font-weight:800}
body.nord-nexus-active #page-hub .nx-unified-loading small{font-size:12px;color:var(--muted);line-height:1.5}
body.nord-nexus-active.nexus-explore-open #page-hub .nx-explore-content>.nx-unified-loading{width:100%;min-height:320px}
@keyframes nxUnifiedSpin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){body.nord-nexus-active #page-hub .nx-unified-ring{animation:none;border-color:var(--accent)}}
