/* V54: one visual rhythm for the four existing website header systems.
   Does not alter any page bodies, lessons, cube physics or catalog data. */
@media(min-width:821px){
 body.portal-home .portal-topbar .topbar-inner{
  min-height:70px!important;height:70px!important;
 }
 body.portal-home .portal-topbar .brand img{
  width:168px!important;height:46px!important;max-width:168px!important;
  object-fit:contain!important;
 }
 .global-site-header .gsh-inner{
  min-height:70px!important;height:70px!important;
 }
 .global-site-header .gsh-brand img{
  width:168px!important;height:46px!important;
 }
 body.rubik-hub-page .rubik-top-inner{
  min-height:70px!important;height:70px!important;
  flex-wrap:nowrap!important;gap:8px!important;
 }
 body.rubik-hub-page .rubik-brand,
 body.rubik-hub-page .rubik-brand img{
  max-width:168px!important;width:168px!important;
 }
 body.rubik-hub-page .rubik-brand img{height:46px!important;max-height:46px!important}
 body.rubik-guide-page .top .wrap{
  min-height:70px!important;height:70px!important;
  padding-block:0!important;
 }
}
body.rubik-hub-page .rubik-topbar,
body.rubik-guide-page .top{position:sticky;top:0;z-index:1500}
body.portal-home .portal-nav a,
.global-site-header .gsh-nav a,
body.rubik-hub-page .rubik-top-inner>nav:first-of-type a,
body.rubik-hub-page .rubik-top-inner #rubikTopicNav button,
body.rubik-guide-page .top .nav a{
 min-height:38px!important;box-sizing:border-box!important;
 font-size:13px!important;font-weight:800!important;line-height:1.25!important;
 display:inline-flex!important;align-items:center!important;justify-content:center!important;
 white-space:nowrap!important;letter-spacing:0!important;
}
body.rubik-hub-page .rubik-top-inner>nav:first-of-type a{
 padding:7px 9px!important;
}
body.rubik-hub-page .rubik-top-inner #rubikTopicNav{
 gap:3px!important;flex:1 1 auto!important;max-width:none!important;
 min-width:0!important;overflow-x:auto!important;scrollbar-width:thin;
}
body.rubik-hub-page .rubik-top-inner #rubikTopicNav button{
 flex:0 0 auto!important;padding:7px 8px!important;width:auto!important;
 background:transparent;min-width:0!important;
}
body.rubik-hub-page .rubik-top-inner #rubikTopicNav button[aria-current=page]{
 background:#e3f2ff;
}
body.rubik-hub-page .rubik-top-inner #rubikTopicNav{position:static!important;top:auto!important}
body.rubik-guide-page .top .wrap{
 max-width:1700px!important;width:min(100% - 64px,1700px)!important;
 gap:12px!important;flex-wrap:nowrap!important;
}
body.rubik-guide-page .top .brand{display:inline-flex;align-items:center;flex:0 0 auto}
body.rubik-guide-page .top .brand img{
 width:168px!important;height:46px!important;display:block;
 object-fit:contain;
}
body.rubik-guide-page .top .nav{
 display:flex;align-items:center;gap:5px!important;flex:1 1 auto;
 min-width:0;overflow-x:auto;scrollbar-width:thin;flex-wrap:nowrap;
}
body.rubik-guide-page .top .nav a{
 text-decoration:none;border:1px solid transparent;border-radius:10px;
 padding:7px 10px!important;color:#35618d;
}
body.rubik-guide-page .top .nav a:hover{background:#e9f3ff;border-color:#c1d9ee}
body.rubik-hub-page .rubik-site-actions,
body.rubik-guide-page .rubik-site-actions{
 display:flex;align-items:center;gap:5px;position:relative;
 flex:0 0 auto;direction:ltr;
}
body.rubik-hub-page .rubik-site-action,
body.rubik-guide-page .rubik-site-action,
body.rubik-hub-page #rubikLangBtn,
body.rubik-guide-page .guide-language{
 display:inline-flex!important;align-items:center!important;justify-content:center!important;
 gap:5px!important;box-sizing:border-box!important;
 height:38px!important;min-height:38px!important;
 padding:6px 9px!important;border-radius:10px!important;
 border:1px solid #b4cee7!important;background:#f0f7ff!important;
 color:#245985!important;font:800 12px/1.2 system-ui,sans-serif!important;
 text-decoration:none!important;cursor:pointer!important;white-space:nowrap!important;
}
body.rubik-hub-page .rubik-site-action,
body.rubik-guide-page .rubik-site-action{
 width:38px;min-width:38px;padding:4px!important;font-size:18px!important;
}
.rubik-site-flag{width:21px;height:15px;display:block;object-fit:cover;border-radius:2px}
.rubik-site-popover[hidden]{display:none!important}
.rubik-site-popover{
 width:min(330px,calc(100vw - 24px));position:absolute;inset-inline-end:0;top:calc(100% + 9px);
 z-index:2600;direction:inherit;text-align:start;
 display:grid;gap:12px;padding:16px;background:#fff;color:#214567;
 border:1px solid #c9d9ed;border-radius:15px;box-shadow:0 16px 35px #18375830;
 font:13px/1.6 system-ui,'Segoe UI',sans-serif;
}
.rubik-site-pop-title{font-size:16px;color:#194c77}
.rubik-site-pop-desc{margin:0;color:#58738b}
.rubik-site-appearance-row,.rubik-site-motion-row{display:grid;gap:6px}
.rubik-site-appearance-title,.rubik-site-motion-title{font-weight:800}
.rubik-site-motion-buttons{display:flex;gap:5px;flex-wrap:wrap}
.rubik-site-motion-buttons button,.rubik-site-theme-choice{
 font:800 12px/1.2 system-ui;border:1px solid #bad0e6;border-radius:9px;
 padding:9px 12px;background:#edf5ff;color:#245985;cursor:pointer
}
.rubik-site-motion-buttons button[aria-pressed=true]{
 background:#c9e5ff;border-color:#3584bf;color:#154b79
}
.rubik-site-action:focus-visible,.rubik-site-popover button:focus-visible,
body.rubik-hub-page #rubikLangBtn:focus-visible,
body.rubik-guide-page .guide-language:focus-visible{
 outline:3px solid #f8b942;outline-offset:2px
}
@media(max-width:820px){
 body.portal-home .portal-topbar .topbar-inner,
 .global-site-header .gsh-inner{max-height:none!important}
 body.rubik-hub-page .rubik-top-inner{
  display:grid!important;grid-template-columns:auto 1fr auto!important;
  grid-template-areas:"brand filler actions" "chooser chooser select"!important;
  gap:5px 8px!important;min-height:0!important;height:auto!important;
  padding:7px 0!important;align-items:center!important;
 }
 body.rubik-hub-page .rubik-brand{grid-area:brand!important;justify-self:start}
 body.rubik-hub-page .rubik-brand,
 body.rubik-hub-page .rubik-brand img{width:132px!important;max-width:132px!important}
 body.rubik-hub-page .rubik-brand img{height:38px!important;max-height:38px!important}
 body.rubik-hub-page .rubik-top-inner>nav:first-of-type{
  grid-area:chooser!important;order:initial!important;display:flex!important;
  width:auto!important;flex:1!important;min-width:0!important;
  overflow-x:auto!important;white-space:nowrap!important;gap:4px!important;
  flex-wrap:nowrap!important;
 }
 body.rubik-hub-page .rubik-top-inner>nav:first-of-type a{
  min-height:34px!important;font-size:11px!important;flex:0 0 auto!important;
  padding:5px 8px!important
 }
 body.rubik-hub-page .rubik-top-inner #rubikTopicNav{
  display:none!important
 }
 body.rubik-hub-page .rubik-mobile-section-label{display:none!important}
 body.rubik-hub-page .rubik-mobile-section{
  grid-area:select!important;display:block!important;min-width:90px!important;
  width:102px!important;max-width:36vw!important;min-height:34px!important;
  padding:5px!important;font:800 11px system-ui!important;
 }
 body.rubik-hub-page .rubik-site-actions{grid-area:actions!important;justify-self:end}
 body.rubik-guide-page .top .wrap{
  width:calc(100% - 24px)!important;
  padding:7px 0!important;min-height:0!important;height:auto!important;
  display:grid!important;grid-template-columns:auto 1fr auto!important;
  grid-template-areas:"brand blank actions" "nav nav nav"!important;
  gap:6px!important;
 }
 body.rubik-guide-page .top .brand{grid-area:brand!important}
 body.rubik-guide-page .top .brand img{width:132px!important;height:38px!important}
 body.rubik-guide-page .top .nav{grid-area:nav!important;width:100%!important;
  justify-content:center;gap:4px!important;min-height:32px!important;
 }
 body.rubik-guide-page .top .nav a{min-height:32px!important;
  padding:5px 8px!important;font-size:12px!important;
 }
 body.rubik-guide-page .rubik-site-actions{grid-area:actions!important;justify-self:end}
}
@media(max-width:450px){
 body.rubik-hub-page .rubik-brand,body.rubik-hub-page .rubik-brand img{
  width:111px!important;max-width:111px!important;
 }
 body.rubik-guide-page .top .brand img{width:111px!important}
 body.rubik-hub-page #rubikLangBtn,
 body.rubik-guide-page .guide-language{
  padding:4px 6px!important;font-size:11px!important;height:34px!important;min-height:34px!important;
 }
 body.rubik-hub-page .rubik-site-action,
 body.rubik-guide-page .rubik-site-action{
  width:34px!important;min-width:34px!important;height:34px!important;min-height:34px!important;
 }
 body.rubik-hub-page .rubik-site-actions,body.rubik-guide-page .rubik-site-actions{gap:3px}
}
@media(prefers-reduced-motion:reduce){
 .rubik-site-action,.rubik-site-popover{transition:none!important}
}
/* The user chooses dark mode explicitly. Keep cube stickers colored and readable. */
body.rubik-hub-page.dark,body.rubik-guide-page.dark{
 color-scheme:dark;background:#0f1928!important;color:#e4edfa!important;
 --rubik-ink:#e2ecff;--rubik-blue:#85bdff;--rubik-border:#465875;
}
body.rubik-hub-page.dark .rubik-topbar,body.rubik-guide-page.dark .top{
 background:#19263a!important;border-color:#45536a!important;
}
body.rubik-hub-page.dark .rubik-top-inner>nav:first-of-type a,
body.rubik-hub-page.dark #rubikTopicNav button,
body.rubik-guide-page.dark .top .nav a{
 color:#e4edff!important;border-color:#3e5677!important;
}
body.rubik-hub-page.dark .rubik-top-inner>nav:first-of-type a[aria-current],
body.rubik-hub-page.dark #rubikTopicNav button[aria-current],
body.rubik-guide-page.dark .top .nav a:hover{
 background:#315073!important;color:#fff!important;
}
body.rubik-hub-page.dark .rubik-site-action,
body.rubik-guide-page.dark .rubik-site-action,
body.rubik-hub-page.dark #rubikLangBtn,
body.rubik-guide-page.dark .guide-language{
 background:#253e5a!important;border-color:#5a759b!important;color:#f1f7ff!important;
}
body.rubik-hub-page.dark .rubik-site-popover,
body.rubik-guide-page.dark .rubik-site-popover{
 background:#1e304a!important;color:#ecf4ff!important;border-color:#57708d!important;
}
body.rubik-hub-page.dark .rubik-site-pop-title,
body.rubik-guide-page.dark .rubik-site-pop-title{color:#edf6ff!important}
body.rubik-hub-page.dark .rubik-site-pop-desc,
body.rubik-guide-page.dark .rubik-site-pop-desc{color:#b6cbe6!important}
body.rubik-hub-page.dark .rubik-site-popover button,
body.rubik-guide-page.dark .rubik-site-popover button{
 background:#304968;color:#ecf4ff;border-color:#5a7397
}
body.rubik-hub-page.dark .rubik-site-motion-buttons button[aria-pressed=true],
body.rubik-guide-page.dark .rubik-site-motion-buttons button[aria-pressed=true]{
 background:#365f8e!important;border-color:#90bdf2!important
}
body.rubik-hub-page.dark :is(.rubik-landing-hero,.rubik-path-card,.rubik-lesson-card,
 .rubik-size-card,.rubik-case-card,.rubik-card,.rubik-study-practice,
 .rubik-practice-column,.rubik-topic-nav,.rubik-section-header,
 .rubik-study-layout,.rubik-workspace,.rubik-studio-view,
 .rubik-studio-control-rail,.rubik-notation-live){
 background:#1e3049!important;border-color:#425a78!important;color:#ecf4ff!important;
}
body.rubik-hub-page.dark :is(h1,h2,h3,h4,strong,.rubik-section-header h2,
 .rubik-landing-hero h1,.rubik-path-card strong,.rubik-lesson-card strong){color:#f1f6ff!important}
body.rubik-hub-page.dark :is(p,small,.rubik-landing-hero p,.rubik-section-header p,
 .rubik-path-card small){color:#bcd1ea!important}
body.rubik-hub-page.dark .rubik-hero-owner-extension,
body.rubik-hub-page.dark .rubik-hub-footer{color:#dfecff}
body.rubik-guide-page.dark :is(h1,h2,h3,h4,strong){color:#eef5ff!important}
body.rubik-guide-page.dark :is(.card,.rubik-card,.rubik-lesson-application,
 .rubik-workspace-note,.rubik-page-nav,.rubik-lesson-explanation .rubik-card,
 .rubik-lesson-simulator,.rubik-algorithm){
 background:#1f3046!important;color:#ecf4ff!important;border-color:#506582!important;
}
body.rubik-guide-page.dark :is(p,.lede,.rubik-lesson-app-head p,
 .rubik-workspace-note){color:#c2d3ec!important}
body.rubik-guide-page.dark .rubik-page-nav a,
body.rubik-guide-page.dark .rubik-lesson-alg-list button{
 background:#2a4462!important;color:#e4f1ff!important;border-color:#5b789a!important
}
body.rubik-guide-page.dark .rubik-lesson-alg-list button[aria-pressed=true]{
 background:#3a6291!important
}
/* Keep the cube/net facelet diagrams with their intended reference colors. */
body.rubik-hub-page.dark :is(.rubik-net-view,.rubik-full-view,.rubik-overlay-cube-view),
body.rubik-guide-page.dark :is(.rubik-net-view,.rubik-full-view){
 background:#fff!important;color:#173e68!important;
}
body.rubik-hub-page.reduce-motion *,body.rubik-guide-page.reduce-motion *{
 transition-duration:.05s!important;scroll-behavior:auto!important;
}
body.rubik-hub-page.disable-motion *,body.rubik-guide-page.disable-motion *{
 transition-duration:0s!important;scroll-behavior:auto!important;
}
@media print{
 body.rubik-guide-page .rubik-site-actions{display:none!important}
}
/* Mobile Arabic labels must scroll in one row, not create a third header line. */
@media(max-width:700px){
 body.portal-home .portal-topbar .portal-nav{
  display:flex!important;flex-wrap:nowrap!important;
  flex-direction:row!important;justify-content:flex-start!important;
  min-height:34px!important;max-height:36px!important;
  overflow-x:auto!important;overflow-y:hidden!important;
  width:100%!important;min-width:0!important;scrollbar-width:none;
 }
 body.portal-home .portal-topbar .portal-nav a{
  flex:0 0 auto!important;white-space:nowrap!important;
  min-height:32px!important;height:32px!important;
  font-size:12px!important;padding:6px 9px!important;
 }
 body.portal-home .portal-topbar .portal-nav::-webkit-scrollbar{display:none}
}

/* Contrast protection: badges and caption strips must never be white-on-white. */
body.rubik-hub-page.dark .rubik-summary-stats span{
 background:#294663!important;border-color:#5f83ab!important;
}
body.rubik-hub-page.dark .rubik-summary-stats strong{
 color:#f3f8ff!important;
}
body.rubik-hub-page.dark .rubik-summary-stats small{
 color:#c9ddf8!important;
}
body.rubik-hub-page.dark :is(.rubik-net-view,.rubik-full-view) h4,
body.rubik-guide-page.dark :is(.rubik-net-view,.rubik-full-view) h4{
 color:#245a88!important;
}
body.rubik-hub-page.dark :is(.rubik-net-view,.rubik-full-view) small,
body.rubik-guide-page.dark :is(.rubik-net-view,.rubik-full-view) small{
 color:#436483!important;
}
