/* Hub Sfera layout contract · 2.9.1.
 *
 * Single structural contract for every Hub tab: one stable heading, tab bar,
 * width and content origin. Do not reintroduce the legacy white workspace
 * wrapper, whose geometry differed between Google Ads and ChatGPT Ads.
 * Content-specific cards, forms, API handlers and subnavigation stay native.
 */
#hub-view[data-sfera-ads-studio="ready"]{
  --hub-shared-gutter:28px;
  --hub-shared-navy:#0e2166;
  --hub-shared-canvas:#f3f6fb;
  background:var(--hub-shared-canvas)!important;
}
#hub-view[data-sfera-ads-studio="ready"] > .hub-shell{
  box-sizing:border-box!important;
  width:calc(100% - var(--hub-shared-gutter)*2)!important;
  max-width:none!important;
  min-width:0!important;
  margin:0 auto!important;
  padding:0!important;
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
}
/* The historic Hub header was being hidden for Google Ads only. Its empty
 * 5px/16px paddings still moved the title, tabs and KPI origin on other tabs.
 * The native action buttons remain mounted and callable via the topbar.
 */
#hub-view[data-sfera-ads-studio="ready"] .hub-shell > .hub-final-header,
#hub-view[data-sfera-ads-studio="ready"] .hub-shell > [data-hub-final-header]{
  display:none!important;
}
#hub-view[data-sfera-ads-studio="ready"] .hub-shell > .sfera-hub-heading{
  display:flex!important;
  align-items:center!important;
  min-height:34px!important;
  height:34px!important;
  padding:0 2px!important;
  margin:0 0 13px!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
#hub-view[data-sfera-ads-studio="ready"] .hub-shell > .sfera-hub-heading h1{
  margin:0!important;
  padding:0!important;
  color:#0e2166!important;
  font:500 clamp(18px,1.55vw,23px)/1.3 Poppins,"Open Sans",sans-serif!important;
  letter-spacing:-.025em!important;
  text-transform:none!important;
  white-space:nowrap!important;
}
/* A single nav geometry across Google Ads, ChatGPT Ads, Strategie, Pay and
 * BRT. Each tab's active state is still owned by the existing controller.
 */
#hub-view[data-sfera-ads-studio="ready"] .hub-shell > .hub-final-tabs{
  display:flex!important;
  flex-wrap:nowrap!important;
  align-items:stretch!important;
  gap:22px!important;
  width:100%!important;
  min-width:0!important;
  height:46px!important;
  min-height:46px!important;
  padding:0 3px!important;
  margin:0 0 20px!important;
  background:transparent!important;
  border:0!important;
  border-bottom:1px solid #e2e8f1!important;
  border-radius:0!important;
  box-shadow:none!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  scrollbar-width:thin!important;
}
#hub-view[data-sfera-ads-studio="ready"] .hub-shell > .hub-final-tabs .hub-subnav__item{
  display:inline-flex!important;
  position:relative!important;
  box-sizing:border-box!important;
  align-items:center!important;
  justify-content:center!important;
  flex:0 0 auto!important;
  gap:8px!important;
  min-height:46px!important;
  height:46px!important;
  margin:0!important;
  padding:11px 2px 13px!important;
  background:transparent!important;
  color:#8290a5!important;
  border:0!important;
  border-radius:0!important;
  font:600 11px/1.3 Poppins,"Open Sans",sans-serif!important;
  white-space:nowrap!important;
  transition:color .14s ease!important;
}
#hub-view[data-sfera-ads-studio="ready"] .hub-shell > .hub-final-tabs .hub-subnav__item:is(.is-active,[aria-current="page"]){
  color:#0e2166!important;
}
#hub-view[data-sfera-ads-studio="ready"] .hub-shell > .hub-final-tabs .hub-subnav__item:is(.is-active,[aria-current="page"])::after{
  content:""!important;
  position:absolute!important;
  bottom:0!important;
  left:0!important;
  right:0!important;
  height:2px!important;
  border-radius:3px!important;
  background:#0b7ff0!important;
}
#hub-view[data-sfera-ads-studio="ready"] .hub-shell > .hub-final-tabs .hub-subnav__item svg{
  display:block!important;
  width:16px!important;
  height:16px!important;
  flex:0 0 16px!important;
  fill:none!important;
  stroke:currentColor!important;
}
#hub-view[data-sfera-ads-studio="ready"] .hub-shell > .hub-final-tabs .hub-subnav__actions{
  display:none!important;
}
/* Every section starts flush beneath the very same tab strip. Individual
 * content widgets keep their own layouts and meaning.
 */
#hub-view[data-sfera-ads-studio="ready"] .hub-shell > :is(
  .sfera-ads-studio,#hub-chatgpt-ads,#check-strategie,
  #hub-migliorshop-pay,#hub-brt
){
  min-width:0!important;
  padding-top:0!important;
  margin-top:0!important;
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
}
#hub-view[data-sfera-ads-studio="ready"] #hub-chatgpt-ads > .sfera-chatgpt-studio,
#hub-view[data-sfera-ads-studio="ready"] .hub-shell > .sfera-ads-studio{
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  padding:0 0 24px!important;
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
}
/* The inner directory is the ONLY white panel surrounding each campaign
 * table. All four KPI cards are siblings on the CRM grey canvas.
 */
#hub-view[data-sfera-ads-studio="ready"] :is(
  .sfera-ads-studio,.sfera-chatgpt-studio
) > .sfera-ads-kpis{
  margin:0 0 12px!important;
  padding:0!important;
}
#hub-view[data-sfera-ads-studio="ready"] #hub-chatgpt-ads > .sfera-chatgpt-studio > .sfera-cg-kpis{
  margin:0 0 12px!important;
  padding:0!important;
}
#hub-view[data-sfera-ads-studio="ready"] :is(
  .sfera-ads-studio,.sfera-chatgpt-studio
) > .sfera-ads-directory{
  min-width:0!important;
  margin:0!important;
  background:#fff!important;
  border:1px solid #dfe7f2!important;
  border-radius:15px!important;
  box-shadow:0 6px 17px rgba(19,50,98,.035)!important;
}
/* Exactly the same distance from KPI row to results toolbar and from
 * results badge/funnel to the table in both advertising modules. */
#hub-view[data-sfera-ads-studio="ready"] :is(
  .sfera-ads-studio,.sfera-chatgpt-studio
) .sfera-ads-directory > .sfera-ads-toolbar{
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  min-height:61px!important;
  padding:7px 17px 13px!important;
  margin:0!important;
}
#hub-view[data-sfera-ads-studio="ready"] :is(
  .sfera-ads-studio,.sfera-chatgpt-studio
) .sfera-ads-directory > .sfera-ads-table-scroll{
  margin-top:0!important;
}
/* Requested common KPI icon badge: opaque Sfera navy, white glyph,
 * identical size and padding across all eight cards.
 */
#hub-view[data-sfera-ads-studio="ready"] :is(
  .sfera-ads-studio,.sfera-chatgpt-studio
) .sfera-ads-kpi .sfera-ads-kpi__top > svg{
  display:block!important;
  box-sizing:border-box!important;
  width:30px!important;
  height:30px!important;
  flex:0 0 30px!important;
  padding:7px!important;
  background:#0e2166!important;
  color:#fff!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.8!important;
  border-radius:9px!important;
}
#hub-view[data-sfera-ads-studio="ready"] .hub-shell > :is(#hub-migliorshop-pay,#hub-brt) .hub-section-header{
  min-height:0!important;
  margin:0!important;
  padding:0!important;
}
#signed-in .sfera-ads-topbar[data-hub-context="check"] .sfera-ads-topbar__new{
  display:none!important;
}
/* BRT now searches in the shared fixed bar, like Ads and Pay. */
#signed-in .sfera-ads-topbar :is(.sfera-ads-topbar__new,.sfera-ads-topbar__tool)[hidden]{
  display:none!important;
}
/* Stable gutters at all breakpoints, including narrow desktop viewports. */
@media(max-width:1023px){
  #hub-view[data-sfera-ads-studio="ready"]{--hub-shared-gutter:12px}
  #hub-view[data-sfera-ads-studio="ready"] .hub-shell > .hub-final-tabs{
    gap:16px!important;
  }
}
@media(max-width:760px){
  #hub-view[data-sfera-ads-studio="ready"]{--hub-shared-gutter:9px}
  #hub-view[data-sfera-ads-studio="ready"] .hub-shell > .hub-final-tabs{
    gap:13px!important;
    margin-bottom:16px!important;
  }
  #hub-view[data-sfera-ads-studio="ready"] .hub-shell > .hub-final-tabs .hub-subnav__item{
    padding:11px 2px 13px!important;
  }
}
@media(prefers-reduced-motion:reduce){
  #hub-view[data-sfera-ads-studio="ready"] .hub-shell > .hub-final-tabs .hub-subnav__item{
    transition:none!important;
  }
}


/* KPI group: genuine white containing surface with three nested indicators. */
#hub-view[data-sfera-ads-studio="ready"] .hub-shell > #hub-chatgpt-ads{
  box-sizing:border-box!important;width:100%!important;max-width:none!important;
  min-width:0!important;padding:0!important;margin-inline:0!important;
}
#hub-view[data-sfera-ads-studio="ready"] #hub-chatgpt-ads > .sfera-chatgpt-studio{
  width:100%!important;max-width:none!important;min-width:0!important;
  padding-inline:0!important;margin-inline:0!important;
}
#hub-view[data-sfera-ads-studio="ready"] :is(.sfera-ads-studio,.sfera-chatgpt-studio) > .sfera-ads-kpis{
  box-sizing:border-box!important;display:grid!important;
  width:100%!important;max-width:none!important;
  grid-template-columns:minmax(0,1.35fr) repeat(2,minmax(0,1fr))!important;
  gap:12px!important;margin:0 0 12px!important;padding:16px!important;
  background:#fff!important;border:1px solid #dfe7f2!important;
  border-radius:16px!important;box-shadow:0 6px 17px rgba(19,50,98,.035)!important;
}
#hub-view[data-sfera-ads-studio="ready"] :is(.sfera-ads-studio,.sfera-chatgpt-studio) > .sfera-ads-kpis > .sfera-ads-kpi{
  min-width:0!important;margin:0!important;background:#f9fbff!important;
  border-color:#e5ebf5!important;box-shadow:none!important;
}
#hub-view[data-sfera-ads-studio="ready"] :is(.sfera-ads-studio,.sfera-chatgpt-studio) > .sfera-ads-kpis > .sfera-ads-kpi--hero{
  background:#f4f8ff!important;
}
@media(max-width:1200px){
  #hub-view[data-sfera-ads-studio="ready"] :is(.sfera-ads-studio,.sfera-chatgpt-studio) > .sfera-ads-kpis{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  #hub-view[data-sfera-ads-studio="ready"] :is(.sfera-ads-studio,.sfera-chatgpt-studio) > .sfera-ads-kpis > .sfera-ads-kpi--hero{
    grid-column:1/-1!important;
  }
}
@media(max-width:590px){
  #hub-view[data-sfera-ads-studio="ready"] :is(.sfera-ads-studio,.sfera-chatgpt-studio) > .sfera-ads-kpis{
    grid-template-columns:minmax(0,1fr)!important;gap:9px!important;
    padding:10px!important;border-radius:13px!important;
  }
  #hub-view[data-sfera-ads-studio="ready"] :is(.sfera-ads-studio,.sfera-chatgpt-studio) > .sfera-ads-kpis > .sfera-ads-kpi--hero{
    grid-column:auto!important;
  }
}


/* 2.12.6 — definitive Hub KPI parity. The legacy ChatGPT selector directly
 * above was more specific than the generic 2.12.5 padding rule. These exact
 * section paths resolve that conflict without global !important overrides. */
#hub-view[data-sfera-ads-studio="ready"] .hub-shell > .sfera-ads-studio > .sfera-ads-kpis,
#hub-view[data-sfera-ads-studio="ready"] .hub-shell > #hub-chatgpt-ads > .sfera-chatgpt-studio > .sfera-cg-kpis{
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-columns:minmax(0,1.35fr) repeat(2,minmax(0,1fr))!important;
  gap:12px!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  margin:0 0 12px!important;
  padding:16px!important;
  background:#fff!important;
  border:1px solid #dfe7f2!important;
  border-radius:16px!important;
  box-shadow:0 6px 17px rgba(19,50,98,.035)!important;
}
#hub-view[data-sfera-ads-studio="ready"] .hub-shell > .sfera-ads-studio > .sfera-ads-kpis > .sfera-ads-kpi,
#hub-view[data-sfera-ads-studio="ready"] .hub-shell > #hub-chatgpt-ads > .sfera-chatgpt-studio > .sfera-cg-kpis > .sfera-ads-kpi{
  box-sizing:border-box!important;
  height:196px!important;
  min-height:196px!important;
  min-width:0!important;
  margin:0!important;
  padding:16px 18px!important;
  background:#f9fbff!important;
  border:1px solid #e5ebf5!important;
  border-radius:14px!important;
  box-shadow:none!important;
}
#hub-view[data-sfera-ads-studio="ready"] .hub-shell > .sfera-ads-studio > .sfera-ads-kpis > .sfera-ads-kpi--hero,
#hub-view[data-sfera-ads-studio="ready"] .hub-shell > #hub-chatgpt-ads > .sfera-chatgpt-studio > .sfera-cg-kpis > .sfera-ads-kpi--hero{
  background:#f4f8ff!important;
}
/* Search is an independent left-side sibling of the right action cluster. */
#signed-in .sfera-ads-topbar{position:relative;min-width:0}
#signed-in .sfera-ads-topbar > .sfera-ads-topbar__search{
  display:flex;
  flex:0 1 320px;
  width:clamp(190px,22vw,320px);
  max-width:320px;
  margin-left:clamp(12px,1.5vw,22px);
  margin-right:12px;
}
#signed-in .sfera-ads-topbar > .sfera-ads-topbar__search:focus-within{
  border-color:#86bafa;box-shadow:0 0 0 2px rgba(134,186,250,.17)
}
#signed-in .sfera-ads-topbar > .sfera-ads-topbar__search input:focus-visible{
  outline:0!important
}
@media(max-width:1200px){
  #hub-view[data-sfera-ads-studio="ready"] .hub-shell > .sfera-ads-studio > .sfera-ads-kpis,
  #hub-view[data-sfera-ads-studio="ready"] .hub-shell > #hub-chatgpt-ads > .sfera-chatgpt-studio > .sfera-cg-kpis{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  #hub-view[data-sfera-ads-studio="ready"] .hub-shell > .sfera-ads-studio > .sfera-ads-kpis > .sfera-ads-kpi--hero,
  #hub-view[data-sfera-ads-studio="ready"] .hub-shell > #hub-chatgpt-ads > .sfera-chatgpt-studio > .sfera-cg-kpis > .sfera-ads-kpi--hero{
    grid-column:1/-1!important;
  }
}
/* Collapsed search keeps the fixed title and right buttons usable on tablets
 * and narrow desktops; the existing search-trigger JS still opens the input. */
@media(max-width:980px){
  #signed-in .sfera-ads-topbar > .sfera-ads-topbar__search{
    display:none!important;
    position:absolute;
    z-index:900;
    top:calc(100% + 5px);
    left:10px;
    right:10px;
    width:auto!important;
    max-width:none!important;
    margin:0!important;
    padding:0 13px;
    background:#0e2166;
    box-shadow:0 8px 22px rgba(14,33,102,.25);
  }
  #signed-in .sfera-ads-topbar.is-search-open > .sfera-ads-topbar__search{
    display:flex!important;
  }
  #signed-in .sfera-ads-topbar__search-trigger{display:grid!important}
}
@media(max-width:590px){
  #hub-view[data-sfera-ads-studio="ready"] .hub-shell > .sfera-ads-studio > .sfera-ads-kpis,
  #hub-view[data-sfera-ads-studio="ready"] .hub-shell > #hub-chatgpt-ads > .sfera-chatgpt-studio > .sfera-cg-kpis{
    grid-template-columns:minmax(0,1fr)!important;
    gap:9px!important;
    padding:10px!important;
    border-radius:13px!important;
  }
  #hub-view[data-sfera-ads-studio="ready"] .hub-shell > .sfera-ads-studio > .sfera-ads-kpis > .sfera-ads-kpi--hero,
  #hub-view[data-sfera-ads-studio="ready"] .hub-shell > #hub-chatgpt-ads > .sfera-chatgpt-studio > .sfera-cg-kpis > .sfera-ads-kpi--hero{
    grid-column:auto!important;
  }
  #hub-view[data-sfera-ads-studio="ready"] .hub-shell > .sfera-ads-studio > .sfera-ads-kpis > .sfera-ads-kpi,
  #hub-view[data-sfera-ads-studio="ready"] .hub-shell > #hub-chatgpt-ads > .sfera-chatgpt-studio > .sfera-cg-kpis > .sfera-ads-kpi{
    height:auto!important;
    min-height:165px!important;
  }
}
@media(prefers-reduced-motion:reduce){
  #signed-in .sfera-ads-topbar > .sfera-ads-topbar__search{transition:none!important}
}
