/* GPT_FUNCTION_HEADERS_V1: Moments' 40px controls + 1px rule, below iPhone's safe area.
   No button, icon, SVG, horizontal toolbar layout or checklist rules are changed. */
html body .gfh-header {
  box-sizing:border-box!important;
  height:calc(env(safe-area-inset-top,0px) + 41px)!important;
  min-height:calc(env(safe-area-inset-top,0px) + 41px)!important;
  max-height:calc(env(safe-area-inset-top,0px) + 41px)!important;
  flex-shrink:0!important;
  padding-top:env(safe-area-inset-top,0px)!important;
  padding-bottom:0!important;
  margin-top:0!important;
  margin-bottom:0!important;
}

html body .gfh-page {
  padding-top:0!important;
  gap:0!important;
  overflow:hidden!important;
}
html body .gfh-content {
  flex:1 1 0%!important;
  min-height:0!important;
  padding-top:0!important;
}
/* Preserve the two toolbars' original horizontal footprint after reparenting. */
html body #hushPanel .profile-header.gfh-header {
  margin-left:18px;
  margin-right:18px;
}
html body #tonightRead .profile-header.gfh-header {
  margin-left:-12px;
  margin-right:-12px;
}

/* Memory and settings already scroll their own page; pin their existing row. */
html body .gfh-self-scroll {
  padding-top:0!important;
  isolation:isolate;
}
html body .gfh-self-scroll > .gfh-header {
  position:sticky!important;
  top:0;
  z-index:5;
  background:var(--gfh-paper,var(--bg-primary));
}

/* Title typography only; the existing controls retain their own typography. */
html:root body :is(.profile-page,.settings-page,.fullscreen-panel,#keptPanel,#keepsakePanel,#diaryPanel,#searchPanel)
  > .gfh-header :is(.profile-title,.settings-title,.panel-title,.kp-title,.ks-title) {
  font-size:22px!important;
  line-height:1!important;
}
/* Remove the translated subtitle beneath the Still / Our pictures title. */
html body .gfh-header :is(.kp-sub,.ks-sub),
html body #kpTabs .kp-tab small {
  display:none!important;
}

/* The count scrolls with Still; keep the existing action row at the same x positions. */
html body #keptPanel .kp-top-r {
  justify-content:center;
  height:40px;
}
/* Beat Petal Still's earlier +3px safe-area override without changing its controls. */
html:root body #keptPanel .kp-top.gfh-header {
  padding-top:env(safe-area-inset-top,0px)!important;
}
html body #keptPanel .gfh-count {
  margin-top:0;
  margin-bottom:4px;
  text-align:right;
}
html body #keptPanel .gfh-count:empty {
  display:none;
}
