/* Shared compact geometry. Loaded last on every branded page. Theme styling,
   visibility of unavailable actions and navigation behavior remain page-owned. */
:root{--bull-header-height:62px;--bull-header-button:44px;--bull-header-brand:236px;--bull-header-word:182px;--bull-header-icon:54px;--bull-header-logo-height:54px;--bull-header-gap:6px}
html body .unified-header{
 box-sizing:border-box!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;align-items:center!important;gap:var(--bull-header-gap)!important;
 height:calc(var(--bull-header-height) + env(safe-area-inset-top,0px))!important;min-height:calc(var(--bull-header-height) + env(safe-area-inset-top,0px))!important;
 padding:calc((var(--bull-header-height) - var(--bull-header-logo-height))/2 + env(safe-area-inset-top,0px)) max(10px,env(safe-area-inset-right,0px)) calc((var(--bull-header-height) - var(--bull-header-logo-height))/2) max(10px,env(safe-area-inset-left,0px))!important;
}
.unified-header>:first-child{min-width:0}
html body .unified-header :is(.board-header-actions,.stock-header-actions,.pulse-header-actions,.mp-header-actions){display:flex;align-items:center;justify-self:end;justify-content:flex-end;gap:var(--bull-header-gap);min-width:0;z-index:2}
html body .unified-header :is(.current-board-brand,.stock-brand,.pulse-brand,.mp-brand){position:relative!important;top:auto!important;left:auto!important;grid-column:2!important;justify-self:center;display:block;width:min(var(--bull-header-brand),var(--bull-header-available,calc(100vw - 440px)))!important;max-width:100%;container-type:inline-size;height:var(--bull-header-logo-height)!important;min-height:0;aspect-ratio:auto;padding:0!important;margin:0;transform:none;--bull-brand-icon-fit:min(var(--bull-header-icon),22.88cqw);--header-brand-icon-size:var(--bull-brand-icon-fit);--stock-brand-icon-size:var(--bull-brand-icon-fit);--header-brand-gap:0px}
html body .unified-header :is(.current-board-icon,.stock-brand-icon,.pulse-brand-icon,.mp-brand-icon){position:absolute;top:50%;left:0;width:var(--bull-brand-icon-fit)!important;height:var(--bull-brand-icon-fit)!important;max-height:none!important;object-fit:contain;transform:translateY(-50%)}
html body .unified-header :is(.stock-brand-final,.pulse-brand>img:not(.pulse-brand-icon),.mp-brand>img:not(.mp-brand-icon)){position:absolute;top:0;left:var(--bull-brand-icon-fit);width:calc(100% - var(--bull-brand-icon-fit))!important;height:var(--bull-header-logo-height)!important;max-height:var(--bull-header-logo-height)!important;object-fit:contain;margin:0;aspect-ratio:auto}
html body .unified-header :is(.header-logo,.portfolio-logo img,.compare-brand img){width:min(var(--bull-header-word),var(--bull-header-available,calc(100vw - 120px)))!important;max-width:100%;height:var(--bull-header-logo-height)!important;max-height:var(--bull-header-logo-height)!important;object-fit:contain}
html body .unified-header :is(.header-logo-link,.portfolio-logo,.compare-brand){grid-column:2;justify-self:center;max-width:100%;width:min(var(--bull-header-word),var(--bull-header-available,calc(100vw - 120px)));height:var(--bull-header-logo-height);min-height:0;padding:0}
html body .unified-header>.header-logo{grid-column:2;justify-self:center}
html body .unified-header :is(.back-to-board,.portfolio-back,.pulse-board-switch,.mp-board-switch,.theme-toggle,.header-theme-toggle,.pulse-theme-toggle,.mp-theme){box-sizing:border-box!important;position:relative;width:var(--bull-header-button)!important;min-width:var(--bull-header-button)!important;max-width:none;height:var(--bull-header-button)!important;min-height:var(--bull-header-button)!important;max-height:var(--bull-header-button)!important;padding:0!important;border-radius:12px!important;flex:0 0 var(--bull-header-button);align-items:center;justify-content:center}
html body .unified-header :is(.theme-toggle,.header-theme-toggle,.pulse-theme-toggle,.mp-theme){justify-self:end}
html body .unified-header :is(.theme-icon,.header-theme-icon,.mp-theme svg){width:21px;height:21px}
/* Use the same compact eco control at every width, without a stretched switch. */
html body .unified-header :is(.header-power-save,.pulse-power-control,.mp-power){display:flex;align-items:center;width:var(--bull-header-button)!important;min-width:var(--bull-header-button)!important;height:var(--bull-header-button)!important;min-height:var(--bull-header-button)!important;padding:0!important;border:0;background:transparent;box-shadow:none;flex:none}
html body .unified-header :is(.header-power-save,.pulse-power-control,.mp-power)>:is(span,b){display:none!important}
html body .unified-header :is(.power-save-toggle,#pulsePowerToggle,#mpPower){position:relative!important;display:grid!important;place-items:center;box-sizing:border-box;width:var(--bull-header-button)!important;min-width:var(--bull-header-button)!important;height:var(--bull-header-button)!important;min-height:var(--bull-header-button)!important;padding:0!important;border:1px solid rgba(18,127,80,.25);border-radius:12px!important;box-shadow:0 4px 12px rgba(10,52,70,.12);background:linear-gradient(145deg,#fff,#e8f5ef);color:#53615b}
html body .unified-header :is(.power-save-toggle,#pulsePowerToggle,#mpPower)>:not(.mobile-power-glyph){display:none!important}
html body .unified-header .mobile-power-glyph{display:block!important;position:static!important;width:auto!important;height:auto!important;min-width:0!important;background:none!important;box-shadow:none!important;color:inherit!important;font-size:12px!important;font-weight:1000;line-height:1;transform:none!important}
html body .unified-header :is(.power-save-toggle,#pulsePowerToggle,#mpPower)[aria-checked="true"]{background:linear-gradient(145deg,#11c36b,#078d49)!important;color:#fff!important}
html[data-theme="dark"] body .unified-header :is(.power-save-toggle,#pulsePowerToggle,#mpPower):not([aria-checked="true"]){background:linear-gradient(145deg,#22362d,#15241e);color:#c3d2ca;border-color:#456452}
html body .unified-header :is(.stockbull-switch-link,.bitbull-switch-link){box-sizing:border-box;width:88px!important;min-width:0;height:var(--bull-header-button)!important;min-height:0;padding:4px 7px!important;border-radius:12px;gap:4px}
html body .unified-header :is(.stockbull-switch-link,.bitbull-switch-link) img{width:66px!important;height:28px!important;max-height:28px!important;object-fit:contain}
html body .unified-header .split-view-button{height:var(--bull-header-button)!important;min-height:var(--bull-header-button)!important;border-radius:12px!important}
html[data-split-pane="true"] body .unified-header .split-view-button{width:var(--bull-header-button)!important;padding:0!important}
/* Expand 40px visual controls to 44px touch targets without increasing the bar. */
html body .unified-header :is(button:not(.compare-brand),.back-to-board,.portfolio-back,.pulse-board-switch,.mp-board-switch)::after{content:"";position:absolute;inset:-2px;pointer-events:auto}
html body .power-save-notice{top:calc(var(--bull-header-height) + env(safe-area-inset-top,0px) + 8px)}
html body .phase-two-nav{top:calc(var(--bull-header-height) + env(safe-area-inset-top,0px))}
html body .detail-panel{scroll-margin-top:calc(var(--bull-header-height) + env(safe-area-inset-top,0px) + 12px)}
/* Full-viewport heatmaps allocate the exact shared bar height to row one. */
html body .mp-app{grid-template-rows:calc(var(--bull-header-height) + env(safe-area-inset-top,0px)) 34px auto auto minmax(0,1fr)!important}
html body .pulse-app{grid-template-rows:calc(var(--bull-header-height) + env(safe-area-inset-top,0px)) auto auto auto auto minmax(0,1fr)!important}
@media(max-width:720px){:root{--bull-header-height:54px;--bull-header-button:40px;--bull-header-brand:201px;--bull-header-word:155px;--bull-header-icon:46px;--bull-header-logo-height:46px;--bull-header-gap:5px}}
@media(max-width:430px){:root{--bull-header-gap:4px}}
@media(max-width:370px){:root{--bull-header-gap:3px}html body .unified-header :is(.stockbull-switch-link,.bitbull-switch-link){width:76px!important;padding-inline:4px!important}html body .unified-header :is(.stockbull-switch-link,.bitbull-switch-link) img{width:56px!important}}
@media(orientation:landscape) and (max-height:520px){:root{--bull-header-height:50px;--bull-header-button:40px;--bull-header-brand:184px;--bull-header-word:142px;--bull-header-icon:42px;--bull-header-logo-height:42px}}

@media(max-width:760px),(orientation:landscape) and (max-height:620px){html body .mp-app{grid-template-rows:calc(var(--bull-header-height) + env(safe-area-inset-top,0px)) auto auto minmax(0,1fr)!important}}
html body .unified-header .portfolio-back{display:grid;place-items:center;font-size:24px;line-height:1}
html body .unified-header .portfolio-back span{display:none}
@media(max-width:560px){
 html[data-split-pane="true"] body :is(.stock-header,.board-switch-bar).unified-header{grid-template-columns:76px minmax(0,1fr) auto!important;gap:4px!important;padding-left:max(8px,env(safe-area-inset-left,0px))!important;padding-right:max(8px,env(safe-area-inset-right,0px))!important}
 html[data-split-pane="true"] body .unified-header :is(.stockbull-switch-link,.bitbull-switch-link){width:76px!important;padding-inline:4px!important}
 html[data-split-pane="true"] body .unified-header :is(.stockbull-switch-link,.bitbull-switch-link) img{width:56px!important}
}
/* The owner page has a signature instead of a centered public wordmark. */
html body .admin-owner-header.unified-header{grid-template-columns:minmax(0,1fr) auto!important;margin:0!important;border-radius:0!important}
html body .admin-owner-header.unified-header #owner-bar{grid-column:1;min-height:0}
html body .admin-owner-header.unified-header .owner-mark-compact{width:var(--bull-header-button);height:var(--bull-header-button)}
html body .admin-owner-header.unified-header .header-theme-toggle{grid-column:2}

/* Reserve a safe initial center until the measured side controls are ready. */
@media(max-width:759px){html body .unified-header{--bull-header-available:calc(100vw - 202px)}}
html[data-split-pane="true"] body .unified-header{--bull-header-available:calc(100vw - 292px)}

/* The BitBull animation uses slices positioned as percentages of the original
   2172 x 724 artwork. Keep that same canvas ratio for both static and animated
   states, including when the center shrinks beside navigation controls. */
html body .unified-header .current-board-brand .brand-logo{
 position:absolute;left:var(--bull-brand-icon-fit);margin:0;max-width:none;
 width:min(calc(100% - var(--bull-brand-icon-fit)),calc(var(--bull-header-logo-height) * 3))!important;
 height:auto!important;max-height:var(--bull-header-logo-height)!important;aspect-ratio:2172 / 724!important;
 top:50%;translate:0 -50%;
}

/* Bring the BitBull mascot and wordmark closer without moving their center. */
html body .unified-header :is(.current-board-brand,.pulse-brand)>:is(.current-board-icon,.pulse-brand-icon){left:1cqw}
html body .unified-header :is(.current-board-brand .brand-logo,.pulse-brand>img:not(.pulse-brand-icon)){left:calc(var(--bull-brand-icon-fit) - 1cqw)}

/* Keep the pair centered while closing the visible gap on small screens. */
@media(max-width:720px){
 html body .unified-header .current-board-brand img.current-board-icon{left:3cqw}
 html body .unified-header .current-board-brand .brand-logo{left:calc(var(--bull-brand-icon-fit) - 3cqw)}
 html body .unified-header .pulse-brand img.pulse-brand-icon{left:3cqw}
 html body .unified-header .pulse-brand>img:not(.pulse-brand-icon){left:calc(var(--bull-brand-icon-fit) - 3cqw)}
}

/* StockBull owns its intro transform; keep the other brand containers fixed. */
html body .unified-header :is(.current-board-brand,.pulse-brand,.mp-brand){transform:none!important}
