/* Bunn 101291.9 — Ana Merkez visual balance final
   Keep the 101291.6 host shell/safe-area math untouched.
   This layer only balances the visible center content inside the existing viewport. */

body.personal-center-mode #view{
  overflow:hidden!important;
}

/* The center is a six-row composition. Do not stretch the hero/action rows until the last card
   hits the bottom edge; keep explicit responsive row sizes and distribute the remaining room
   between rows. This makes the first controls and the final Bi Jest card feel equally anchored. */
body.personal-center-mode .personal-center{
  grid-template-rows:
    36px
    92px
    clamp(216px,27.2dvh,232px)
    clamp(174px,22.2dvh,190px)
    66px
    66px!important;
  gap:6px!important;
  align-content:space-between!important;
  padding-top:calc(4px + env(safe-area-inset-top,0px))!important;
  padding-bottom:calc(18px + env(safe-area-inset-bottom,0px))!important;
  transform:none!important;
}

/* Top controls: same center axis, but not glued to the two outer edges. */
body.personal-center-mode .pc-topbar{
  width:calc(100% - 32px)!important;
  margin-inline:auto!important;
  height:36px!important;
  grid-template-columns:36px minmax(0,1fr) 36px!important;
}
body.personal-center-mode .pc-utility{
  width:36px!important;
  height:36px!important;
  min-width:36px!important;
  min-height:36px!important;
}

/* Identity follows the same inward visual axis as the top controls. */
body.personal-center-mode .pc-identity{
  height:92px!important;
  grid-template-columns:86px minmax(0,1fr)!important;
  padding:0 18px!important;
  gap:14px!important;
}
body.personal-center-mode .pc-profile-photo{
  width:82px!important;
  height:82px!important;
  flex-basis:82px!important;
}

/* Final horizontal actions are compact enough to preserve a visible lower breathing line. */
body.personal-center-mode .pc-wide{
  height:66px!important;
  min-height:66px!important;
}

/* Shorter real phone/WebView heights: reduce content itself, never the host chrome. */
@media(max-height:820px){
  body.personal-center-mode .personal-center{
    grid-template-rows:34px 84px 202px 166px 62px 62px!important;
    gap:5px!important;
    padding-top:calc(3px + env(safe-area-inset-top,0px))!important;
    padding-bottom:calc(14px + env(safe-area-inset-bottom,0px))!important;
  }
  body.personal-center-mode .pc-topbar{
    width:calc(100% - 28px)!important;
    height:34px!important;
    grid-template-columns:34px minmax(0,1fr) 34px!important;
  }
  body.personal-center-mode .pc-utility{
    width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;
  }
  body.personal-center-mode .pc-identity{
    height:84px!important;
    grid-template-columns:76px minmax(0,1fr)!important;
    padding:0 16px!important;
  }
  body.personal-center-mode .pc-profile-photo{
    width:72px!important;height:72px!important;flex-basis:72px!important;
  }
  body.personal-center-mode .pc-wide{height:62px!important;min-height:62px!important;}
}

@media(max-height:720px){
  body.personal-center-mode .personal-center{
    grid-template-rows:32px 76px 176px 146px 58px 58px!important;
    gap:4px!important;
    padding-top:calc(2px + env(safe-area-inset-top,0px))!important;
    padding-bottom:calc(10px + env(safe-area-inset-bottom,0px))!important;
  }
  body.personal-center-mode .pc-topbar{
    width:calc(100% - 24px)!important;
    height:32px!important;
    grid-template-columns:32px minmax(0,1fr) 32px!important;
  }
  body.personal-center-mode .pc-utility{
    width:32px!important;height:32px!important;min-width:32px!important;min-height:32px!important;
  }
  body.personal-center-mode .pc-identity{
    height:76px!important;
    grid-template-columns:68px minmax(0,1fr)!important;
    padding:0 14px!important;
    gap:12px!important;
  }
  body.personal-center-mode .pc-profile-photo{
    width:64px!important;height:64px!important;flex-basis:64px!important;
  }
  body.personal-center-mode .pc-wide{height:58px!important;min-height:58px!important;}
}

/* Bunn Videoları: preserve the existing shell; keep bottom actions visible. */
body.bunn-video-mode .bunn-short-actions{
  bottom:max(138px,calc(env(safe-area-inset-bottom,0px) + 120px))!important;
}
body.bunn-video-mode .bunn-short-copy{
  bottom:max(26px,calc(env(safe-area-inset-bottom,0px) + 18px))!important;
  padding-bottom:4px!important;
}

/* Normal premium pages retain the 101291.6 top reservation and only receive lower breathing room. */
body.premium-shell-active:not(.personal-center-mode):not(.bunn-video-mode) #view{
  padding-bottom:max(24px,calc(env(safe-area-inset-bottom,0px) + 16px))!important;
}

@media(prefers-reduced-motion:reduce){
  body.personal-center-mode .personal-center{transform:none!important;}
}
