/* ==========================================================
   BuddySocial v9.89
   Pimp compact width + unified BuddySocial background
   ========================================================== */

/* Main Pimp canvas: not too wide on large screens */
body[data-page="pimp_profile"] main.pimp-page,
body[data-page="admin_pimp_profile"] main.pimp-page{
  width:min(1180px,calc(100% - 28px)) !important;
  max-width:1180px !important;
  margin-left:auto !important;
  margin-right:auto !important;
}

/* More balanced 3-column proportions */
body[data-page="pimp_profile"] main.pimp-page.pimp-layout-v987,
body[data-page="admin_pimp_profile"] main.pimp-page.pimp-layout-v987{
  grid-template-columns:205px minmax(0,1fr) 220px !important;
  column-gap:10px !important;
  row-gap:10px !important;
}

/* Center column never grows wider than sensible reading/editing width */
body[data-page="pimp_profile"] .pimp-site-center,
body[data-page="admin_pimp_profile"] .pimp-site-center{
  width:100% !important;
  max-width:740px !important;
  justify-self:center !important;
}

/* Hero same visual width as the grid */
body[data-page="pimp_profile"] .pimp-hero,
body[data-page="admin_pimp_profile"] .pimp-hero{
  max-width:1180px !important;
}

/* Unified page background with the same site image */
body[data-page="pimp_profile"],
body[data-page="admin_pimp_profile"]{
  background:
    linear-gradient(rgba(238,246,251,.72),rgba(238,246,251,.72)),
    var(--site-bg-image, url("../images/buddysocial-fixed-pages-bg-v965.png")) center top / cover fixed !important;
  background-color:#edf5fa !important;
}

/* Main Pimp area gets one soft shared panel rather than loose floating pieces */
body[data-page="pimp_profile"] main.pimp-page::before,
body[data-page="admin_pimp_profile"] main.pimp-page::before{
  content:"" !important;
  position:fixed !important;
  inset:147px max(12px,calc((100vw - 1210px)/2)) 20px !important;
  z-index:-1 !important;
  pointer-events:none !important;
  background:
    linear-gradient(rgba(255,255,255,.34),rgba(255,255,255,.34)),
    var(--site-bg-image, url("../images/buddysocial-fixed-pages-bg-v965.png")) center top / cover !important;
  border:1px solid rgba(171,198,216,.42) !important;
  box-shadow:0 8px 28px rgba(31,65,91,.06) !important;
}

/* Bring all visible boxes into one coordinated transparency level */
body[data-page="pimp_profile"] :is(
  .pimp-hero,
  .pimp-tabs-organized,
  .pimp-site-center > .retro-box,
  .pimp-site-center > section,
  .pimp-site-rightbar .retro-box,
  .pimp-setting-card,
  fieldset.theme-field.block-text-studio,
  .pimp-dashboard > a
),
body[data-page="admin_pimp_profile"] :is(
  .pimp-hero,
  .pimp-tabs-organized,
  .pimp-site-center > .retro-box,
  .pimp-site-center > section,
  .pimp-site-rightbar .retro-box,
  .pimp-setting-card,
  fieldset.theme-field.block-text-studio,
  .pimp-dashboard > a
){
  background:
    linear-gradient(rgba(255,255,255,.88),rgba(255,255,255,.88)),
    var(--site-bg-image, url("../images/buddysocial-fixed-pages-bg-v965.png")) center top / cover !important;
  border-color:#aec8d9 !important;
}

/* Header bars: same blue family everywhere */
body[data-page="pimp_profile"] :is(
  .retro-box-title,
  .pimp-block-toolbar,
  .pimp-design-card-toolbar,
  .pimp-v984-cardbar,
  .pimp-v984-group-head
),
body[data-page="admin_pimp_profile"] :is(
  .retro-box-title,
  .pimp-block-toolbar,
  .pimp-design-card-toolbar,
  .pimp-v984-cardbar,
  .pimp-v984-group-head
){
  background:linear-gradient(180deg,#e1f0fa,#c9e3f3) !important;
  color:#285f86 !important;
  border-bottom-color:#acc7d9 !important;
}

/* Warm orange accents consistent across the studio */
body[data-page="pimp_profile"] :is(
  .orange-btn,
  .pimp-reset-btn,
  .pimp-reset-block,
  .pimp-design-reset
),
body[data-page="admin_pimp_profile"] :is(
  .orange-btn,
  .pimp-reset-btn,
  .pimp-reset-block,
  .pimp-design-reset
){
  background:linear-gradient(180deg,#ffb443,#e98a08) !important;
  border-color:#c97800 !important;
  color:#fff !important;
}

/* Softer spacing so pages do not feel stretched */
body[data-page="pimp_profile"] .pimp-site-center,
body[data-page="admin_pimp_profile"] .pimp-site-center{
  gap:8px !important;
}

body[data-page="pimp_profile"] .retro-pad,
body[data-page="admin_pimp_profile"] .retro-pad{
  padding:10px !important;
}

body[data-page="pimp_profile"] .pimp-setting-card,
body[data-page="admin_pimp_profile"] .pimp-setting-card,
body[data-page="pimp_profile"] fieldset.theme-field.block-text-studio,
body[data-page="admin_pimp_profile"] fieldset.theme-field.block-text-studio{
  margin-bottom:9px !important;
}

/* Cards/forms should not stretch awkwardly */
body[data-page="pimp_profile"] :is(
  .color-settings,
  .skin-layout,
  .theme-setting-grid,
  .block-text-controls,
  .titlebar-controls
),
body[data-page="admin_pimp_profile"] :is(
  .color-settings,
  .skin-layout,
  .theme-setting-grid,
  .block-text-controls,
  .titlebar-controls
){
  max-width:100% !important;
}

body[data-page="pimp_profile"] input[type="text"],
body[data-page="pimp_profile"] input[type="url"],
body[data-page="pimp_profile"] input[type="number"],
body[data-page="pimp_profile"] select,
body[data-page="pimp_profile"] textarea,
body[data-page="admin_pimp_profile"] input[type="text"],
body[data-page="admin_pimp_profile"] input[type="url"],
body[data-page="admin_pimp_profile"] input[type="number"],
body[data-page="admin_pimp_profile"] select,
body[data-page="admin_pimp_profile"] textarea{
  max-width:100% !important;
}

/* Dashboard cards more compact */
body[data-page="pimp_profile"] .pimp-dashboard,
body[data-page="admin_pimp_profile"] .pimp-dashboard{
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:7px !important;
}

body[data-page="pimp_profile"] .pimp-dashboard > a,
body[data-page="admin_pimp_profile"] .pimp-dashboard > a{
  min-height:64px !important;
  padding:9px !important;
}

/* Right column compact */
body[data-page="pimp_profile"] .pimp-site-rightbar,
body[data-page="admin_pimp_profile"] .pimp-site-rightbar{
  gap:8px !important;
}

body[data-page="pimp_profile"] .pimp-side-card .retro-pad,
body[data-page="admin_pimp_profile"] .pimp-side-card .retro-pad{
  padding:8px !important;
}

/* Left menu compact and stable */
body[data-page="pimp_profile"] .pimp-site-navgroup a,
body[data-page="admin_pimp_profile"] .pimp-site-navgroup a{
  min-height:32px !important;
  padding:6px 8px !important;
}

/* Keep chat untouched */
body[data-page="pimp_profile"] #friend-chat,
body[data-page="pimp_profile"] .friend-chat-window,
body[data-page="admin_pimp_profile"] #friend-chat,
body[data-page="admin_pimp_profile"] .friend-chat-window{
  background:unset !important;
}

/* Tablet */
@media(max-width:1050px){
  body[data-page="pimp_profile"] main.pimp-page,
  body[data-page="admin_pimp_profile"] main.pimp-page{
    width:min(940px,calc(100% - 18px)) !important;
  }

  body[data-page="pimp_profile"] main.pimp-page.pimp-layout-v987,
  body[data-page="admin_pimp_profile"] main.pimp-page.pimp-layout-v987{
    grid-template-columns:190px minmax(0,1fr) !important;
  }

  body[data-page="pimp_profile"] .pimp-site-center,
  body[data-page="admin_pimp_profile"] .pimp-site-center{
    max-width:none !important;
  }
}

/* Mobile */
@media(max-width:760px){
  body[data-page="pimp_profile"],
  body[data-page="admin_pimp_profile"]{
    background-attachment:scroll !important;
  }

  body[data-page="pimp_profile"] main.pimp-page,
  body[data-page="admin_pimp_profile"] main.pimp-page{
    width:calc(100% - 10px) !important;
    max-width:none !important;
    margin:6px auto 88px !important;
  }

  body[data-page="pimp_profile"] main.pimp-page::before,
  body[data-page="admin_pimp_profile"] main.pimp-page::before{
    display:none !important;
  }

  body[data-page="pimp_profile"] .pimp-site-center,
  body[data-page="admin_pimp_profile"] .pimp-site-center{
    max-width:none !important;
  }

  body[data-page="pimp_profile"] .pimp-dashboard,
  body[data-page="admin_pimp_profile"] .pimp-dashboard{
    grid-template-columns:1fr !important;
  }
}
