/* Personal-space pages only.  This is a clean, site-aligned layout layer:
   it never targets forum, portal, category or thread routes. */
body.cid-space-page{background:#f7f3eb!important;color:#382b24!important}
body.cid-space-page #toptb .wp,
body.cid-space-page #hd,
body.cid-space-page #wp,
body.cid-space-page #ct{box-sizing:border-box!important;width:min(1080px,calc(100% - 32px))!important;max-width:none!important;margin-left:auto!important;margin-right:auto!important}

/* Use the same visual alignment and card language as the rest of the site. */
body.cid-space-page #hd{margin-top:26px!important;margin-bottom:20px!important;border-radius:14px!important}
body.cid-space-page #ct .bm,
body.cid-space-page #ct .block{box-sizing:border-box!important;background:#fff!important;border:1px solid #e4d9c8!important;border-radius:10px!important;box-shadow:0 7px 18px rgba(59,37,18,.05)!important}
body.cid-space-page #ct .bm_h,
body.cid-space-page #ct .blocktitle{box-sizing:border-box!important;min-height:42px!important;height:auto!important;padding:10px 15px!important;border-bottom:1px solid #eadfce!important;background:#fbf3e5!important;color:#8e1d18!important;line-height:22px!important;overflow:visible!important}

/* Space home: three readable columns inside the same site-wide 1080px line. */
@media(min-width:821px){
  body.cid-space-page.cid-space-home #ct{display:block!important;margin-top:26px!important;margin-bottom:60px!important;padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important}
  body.cid-space-page.cid-space-home #diypage{display:block!important;float:none!important;width:100%!important;min-width:0!important;margin:0!important;padding:0!important}
  body.cid-space-page.cid-space-home #frame1{display:grid!important;grid-template-columns:250px minmax(0,1fr) 220px!important;gap:20px!important;align-items:start!important;width:100%!important;min-width:0!important}
  body.cid-space-page.cid-space-home #frame1_left{grid-column:1!important}
  body.cid-space-page.cid-space-home #frame1_center{grid-column:2!important}
  body.cid-space-page.cid-space-home #frame1_right{grid-column:3!important}
  body.cid-space-page.cid-space-home #frame1_left,
  body.cid-space-page.cid-space-home #frame1_center,
  body.cid-space-page.cid-space-home #frame1_right{display:block!important;float:none!important;width:auto!important;min-width:0!important;margin:0!important}
  body.cid-space-page.cid-space-home #frame1 .block{width:100%!important;margin:0 0 16px!important}
}

/* All sub-pages: personal information/tools on the left, actual page content
   in one broad right column.  Any remaining auxiliary blocks follow the
   main content in that column instead of appearing beneath the left rail. */
@media(min-width:821px){
  body.cid-space-page:not(.cid-space-home) #ct{display:grid!important;grid-template-columns:250px minmax(0,1fr)!important;gap:22px!important;align-items:start!important;margin-top:26px!important;margin-bottom:60px!important;padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important}
  body.cid-space-page:not(.cid-space-home) #ct>.appl{display:block!important;grid-column:1!important;grid-row:1 / span 4!important;min-width:0!important;padding:0!important}
  body.cid-space-page:not(.cid-space-home) #ct>.mn,
  body.cid-space-page:not(.cid-space-home) #ct>.sd{display:block!important;grid-column:2!important;min-width:0!important;width:auto!important;padding:0!important}
  body.cid-space-page:not(.cid-space-home) #ct>.sd>.bm{margin:0 0 16px!important}
}

/* X5 fixed-width inner wrappers are the source of the text folding. */
body.cid-space-page #frame1_left .dxb_bc,
body.cid-space-page #frame1_left .bm_c,
body.cid-space-page #frame1_left #profile_content,
body.cid-space-page #ct>.appl .dxb_bc,
body.cid-space-page #ct>.appl .bm_c,
body.cid-space-page #ct>.appl #profile_content{box-sizing:border-box!important;float:none!important;width:100%!important;min-width:0!important;max-width:none!important;height:auto!important;overflow:visible!important;padding:16px!important}
body.cid-space-page #frame1_left .dxb_bc>* ,
body.cid-space-page #frame1_left .bm_c>* ,
body.cid-space-page #ct>.appl .dxb_bc>* ,
body.cid-space-page #ct>.appl .bm_c>*{max-width:100%!important}
body.cid-space-page #frame1_left p,
body.cid-space-page #ct>.appl p{width:100%!important;margin-left:0!important;margin-right:0!important;white-space:normal!important}
body.cid-space-page #frame1_left #album,
body.cid-space-page #frame1_left #doing{min-height:106px!important;height:auto!important;overflow:visible!important}

@media(max-width:820px){
  body.cid-space-page #toptb .wp,
  body.cid-space-page #hd,
  body.cid-space-page #wp,
  body.cid-space-page #ct{width:calc(100% - 22px)!important}
  body.cid-space-page #hd{margin-top:12px!important}
  body.cid-space-page.cid-space-home #frame1,
  body.cid-space-page:not(.cid-space-home) #ct{display:block!important}
  body.cid-space-page #frame1_left,
  body.cid-space-page #frame1_center,
  body.cid-space-page #frame1_right,
  body.cid-space-page #ct>.appl,
  body.cid-space-page #ct>.mn,
  body.cid-space-page #ct>.sd{margin-bottom:12px!important}
}
