/* Keep ’Em Coming Back — Deploy 5.1 display stabilization
   Corrects contrast, mobile clipping, fixed-control collisions, and shared navigation consistency. */

:root{
  --ds-navy:#10233f;
  --ds-navy-deep:#09172a;
  --ds-rust:#9c2b2b;
  --ds-paper:#fffdf9;
  --ds-ink:#1f2933;
  --ds-muted:#53606b;
  --ds-line:#cfc7bc;
  --ds-gold:#f0c96e;
}

/* 1. One consistent high-contrast global header. */
.site-header,
.site-header-v3,
.site-header-v3.site-header-simple{
  background:linear-gradient(135deg,var(--ds-navy),#1a3358)!important;
  color:#fff!important;
  border-bottom:1px solid rgba(255,255,255,.16)!important;
  box-shadow:0 7px 20px rgba(16,35,63,.22)!important;
}
.site-header .brand,
.site-header-v3 .brand,
.site-header .brand strong,
.site-header-v3 .brand strong{color:#fff!important}
.site-header .brand small,
.site-header-v3 .brand small{color:#ded8ce!important}
.site-header .brand-mark,
.site-header-v3 .brand-mark{
  border-color:rgba(255,255,255,.34)!important;
  background:var(--ds-rust)!important;
  color:#fff!important;
}
.site-header :is(.main-nav,.main-nav-v3)>a,
.site-header :is(.main-nav,.main-nav-v3)>button,
.site-header :is(.main-nav,.main-nav-v3)>details>summary,
.site-header .nav-menu-toggle,
.site-header .search-toggle,
.site-header .account-utility{
  color:#f8f3eb!important;
  background:transparent!important;
  border-color:rgba(255,255,255,.32)!important;
}
.site-header :is(.main-nav,.main-nav-v3)>a:hover,
.site-header :is(.main-nav,.main-nav-v3)>a:focus-visible,
.site-header :is(.main-nav,.main-nav-v3)>button:hover,
.site-header :is(.main-nav,.main-nav-v3)>button:focus-visible,
.site-header :is(.main-nav,.main-nav-v3)>details>summary:hover,
.site-header :is(.main-nav,.main-nav-v3)>details>summary:focus-visible{
  color:#fff!important;background:#263e61!important;
}
.site-header :is(.main-nav,.main-nav-v3) .active,
.site-header :is(.main-nav,.main-nav-v3) [aria-current="page"],
.site-header :is(.main-nav,.main-nav-v3) details[open]>summary{
  color:#ffe2a3!important;background:rgba(240,201,110,.16)!important;
}
.site-header .nav-more-menu{
  background:var(--ds-navy)!important;
  border-color:rgba(255,255,255,.18)!important;
  box-shadow:0 16px 32px rgba(0,0,0,.28)!important;
}
.site-header .nav-more-menu a{color:#f8f3eb!important;background:transparent!important}
.site-header .nav-more-menu a:hover,.site-header .nav-more-menu a:focus-visible{color:#fff!important;background:#263e61!important}
.site-header .account-utility:hover,.site-header .account-utility:focus-visible{background:#fff!important;color:var(--ds-navy)!important}
.site-header .nav-news{gap:.28rem!important}

/* 2. Homepage fast actions: explicit semantic colors, independent of global variables. */
.home-fast-lane a,.home-fast-lane button{
  background:#fff!important;color:var(--ds-navy)!important;border-color:#c9c1b6!important;
  box-shadow:0 7px 18px rgba(16,35,63,.08)!important;
}
.home-fast-lane a strong,.home-fast-lane button strong{color:var(--ds-navy)!important}
.home-fast-lane a span,.home-fast-lane button span{color:#4f5b65!important}
.home-fast-lane a:first-child{
  background:linear-gradient(135deg,#9b3b2b,#6f241e)!important;
  border-color:#c56b53!important;color:#fff!important;
}
.home-fast-lane a:first-child strong{color:#fff!important}
.home-fast-lane a:first-child span{color:#f7e8de!important}
.home-fast-lane a:hover,.home-fast-lane button:hover{border-color:#9b6b3c!important;box-shadow:0 10px 24px rgba(16,35,63,.13)!important}

/* 3. Priority favorite controls must remain compact on every breakpoint. */
.priority-tool-card{position:relative!important}
.priority-favorite{
  width:36px!important;min-width:36px!important;max-width:36px!important;
  height:36px!important;min-height:36px!important;max-height:36px!important;
  padding:0!important;display:grid!important;place-items:center!important;
  border-radius:50%!important;line-height:1!important;flex:0 0 36px!important;
}

/* 4. The Bar hero retains its photographic atmosphere with readable foreground text. */
.theme-speakeasy .spx-hero{
  position:relative!important;
  background-position:center!important;background-size:cover!important;
  color:#fff!important;
}
.theme-speakeasy .spx-hero:before{
  display:block!important;content:""!important;position:absolute!important;inset:0!important;
  background:linear-gradient(90deg,rgba(8,20,35,.92),rgba(8,20,35,.68) 62%,rgba(8,20,35,.38)),linear-gradient(0deg,rgba(8,20,35,.62),transparent 62%)!important;
  pointer-events:none!important;
}
.theme-speakeasy .spx-hero>div{position:relative!important;z-index:1!important}
.theme-speakeasy .spx-hero :is(h1,h2,p,strong,span){color:#fff!important}
.theme-speakeasy .spx-hero .spx-kicker{color:#f3d184!important}
.theme-speakeasy .spx-hero .spx-button{background:var(--ds-rust)!important;color:#fff!important;border-color:var(--ds-rust)!important}
.theme-speakeasy .spx-hero .spx-button.secondary{background:rgba(8,20,35,.24)!important;color:#fff!important;border-color:rgba(255,255,255,.72)!important}
.theme-speakeasy .spx-hero .spx-stat{background:rgba(8,20,35,.45)!important;border-color:rgba(255,255,255,.22)!important}

/* 5. Horizontal section navigation must remain swipeable. */
@media(max-width:980px){
  .culture-subnav,.spx-subnav,.bar2-subnav,.k2-subnav{
    overflow-x:auto!important;overflow-y:hidden!important;
    flex-wrap:nowrap!important;-webkit-overflow-scrolling:touch!important;
    overscroll-behavior-x:contain!important;scrollbar-width:thin!important;
  }
  .culture-subnav>a,.spx-subnav>a,.bar2-subnav>a,.k2-subnav>a{flex:0 0 auto!important;white-space:nowrap!important}
}

/* 6. Do not stack the Ask Riley launcher on top of priority-tool actions. */
@media(max-width:760px){
  body.priority-tool-page .ask-riley-launcher{display:none!important}
}

/* 7. Correct nested viewport widths and mobile clipping. */
.page-editorial .visual-hero-content,
.page-editorial .section-visual-hero>div{
  width:100%!important;max-width:var(--kecb-content,1180px)!important;
  padding-left:clamp(1rem,3vw,2rem)!important;padding-right:clamp(1rem,3vw,2rem)!important;
}
@media(max-width:760px){
  .system-section{padding-left:1rem!important;padding-right:1rem!important}
  .system-section>.system-wrap,
  .system-section .system-wrap,
  .tonight-command .system-wrap,
  main>.system-wrap{
    width:100%!important;max-width:1180px!important;margin-left:auto!important;margin-right:auto!important;
  }
  .page-editorial main.wrap.page-main{width:100%!important;max-width:none!important}
  .page-editorial main.wrap.page-main>.section-visual-hero,
  .page-editorial main.wrap.page-main>.visual-hero{width:100%!important;max-width:none!important}
}

/* 8. Manager navigation is visible immediately and behaves consistently. */
.mobile-dock{display:none}
@media(max-width:760px){
  .mobile-dock{
    position:fixed!important;display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;
    left:.35rem!important;right:.35rem!important;bottom:max(.35rem,env(safe-area-inset-bottom))!important;
    z-index:9500!important;padding:.28rem!important;border:1px solid rgba(255,255,255,.16)!important;border-radius:16px!important;
    background:rgba(16,35,63,.97)!important;box-shadow:0 14px 36px rgba(0,0,0,.3)!important;backdrop-filter:blur(16px)!important;
  }
  .mobile-dock a,.mobile-dock button{color:#fff!important;background:transparent!important;border:0!important}
  body.page-operational.mobile-dock-at-top .mobile-dock,
  body.shift-desk-page.mobile-dock-at-top .mobile-dock,
  body.theme-tools.mobile-dock-at-top .mobile-dock,
  body.theme-speakeasy.mobile-dock-at-top .mobile-dock{
    transform:none!important;opacity:1!important;pointer-events:auto!important;
  }
}

/* 9. Action colors: enforce readable primary/secondary combinations. */
body :is(a.button.primary,button.button.primary,.button.primary,.btn-primary){background:var(--ds-navy)!important;color:#fff!important;border-color:var(--ds-navy)!important}
body :is(a.button.secondary,button.button.secondary,.button.secondary,.button.ghost,.btn-secondary){background:#fff!important;color:var(--ds-navy)!important;border-color:var(--ds-navy)!important}
body :is(a.button.secondary,button.button.secondary,.button.secondary,.button.ghost,.btn-secondary):hover,
body :is(a.button.secondary,button.button.secondary,.button.secondary,.button.ghost,.btn-secondary):focus-visible{background:#edf1f5!important;color:var(--ds-navy-deep)!important}
.page-editorial :is(.visual-hero,.section-visual-hero) .button.secondary{background:rgba(8,20,35,.32)!important;color:#fff!important;border-color:rgba(255,255,255,.78)!important}

/* 10. Strengthen common dark surfaces without recoloring light cards within them. */
.site-footer,.site-footer-v3{background:var(--ds-navy-deep)!important;color:#eef2f5!important}
.site-footer :is(p,small,span){color:#d5dde4!important}
.site-footer :is(a,strong){color:#fff!important}
.system-hero{background:linear-gradient(135deg,var(--ds-navy),#1a3358)!important;color:#fff!important}
.system-hero :is(h1,h2,h3,p,strong,span,small){color:#fff!important}

/* 11. Safer narrow-screen controls. */
@media(max-width:420px){
  .priority-tool-dock-actions button{min-width:46px!important}
  .priority-tool-live-summary{max-width:42vw!important}
  .priority-tool-live-summary strong{white-space:normal!important;display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important}
}

@media(prefers-reduced-motion:reduce){
  .home-fast-lane a,.home-fast-lane button{transform:none!important;transition:none!important}
}
@media print{.mobile-dock,.ask-riley-launcher{display:none!important}}

/* Success/system compact heroes use a light secondary action, not the primary rust fill. */
body:not(.page-editorial) .visual-hero .visual-hero-actions a.button.secondary,
body:not(.page-editorial) .compact-hero .visual-hero-actions a.button.secondary{
  background:#fff!important;color:var(--ds-navy)!important;border-color:var(--ds-navy)!important;
}
