/* 5.19.407 — controles dentro del header, alineados como LPF y en todas las ligas.
   Una estructura, sin selectores heredados que recentren en tablet/celular. */
html body .ms-competition-profile header.ms-competition-hero:has(> .ms-hero-controls){
 display:grid!important;grid-template-columns:56px minmax(0,1fr) auto!important;
 grid-template-rows:auto!important;gap:10px 12px!important;align-items:center!important;
 min-height:0!important;padding:14px 16px!important;overflow:visible!important;
}
html body .ms-competition-profile header.ms-competition-hero:has(> .ms-hero-controls)>div:first-child{
 grid-column:1!important;grid-row:1!important;min-width:0!important;margin:0!important;
}
html body .ms-competition-profile header.ms-competition-hero:has(> .ms-hero-controls)>div:nth-child(2){
 grid-column:2!important;grid-row:1!important;min-width:0!important;text-align:left!important;margin:0!important;
}
html body .ms-competition-profile header.ms-competition-hero .ms-hero-controls{
 grid-column:3!important;grid-row:1!important;display:flex!important;flex-wrap:nowrap!important;
 align-items:flex-end!important;justify-content:flex-end!important;gap:9px!important;
 position:relative!important;z-index:40!important;width:max-content!important;min-width:0!important;max-width:100%!important;
 margin:0!important;padding:0!important;transform:none!important;justify-self:end!important;
}
html body .ms-competition-profile header.ms-competition-hero .ms-hero-controls>.ms-calc-tools-menu{
 position:relative!important;flex:0 0 auto!important;width:auto!important;min-width:0!important;
 align-self:flex-end!important;margin:0!important;transform:none!important;z-index:100!important;
}
html body .ms-competition-profile header.ms-competition-hero .ms-hero-controls>.ms-calc-tools-menu>summary.ms-calc-tools-toggle{
 min-height:34px!important;min-width:0!important;padding:6px 9px!important;font-size:.72rem!important;
 line-height:1.15!important;white-space:nowrap!important;
}
html body .ms-competition-profile header.ms-competition-hero .ms-hero-controls>form{
 position:relative!important;flex:0 0 106px!important;width:106px!important;max-width:106px!important;
 margin:0!important;min-width:0!important;align-self:flex-end!important;transform:none!important;
}
html body .ms-competition-profile header.ms-competition-hero .ms-hero-controls>form label{
 display:grid!important;gap:4px!important;margin:0!important;min-width:0!important;font-size:.62rem!important;
}
html body .ms-competition-profile header.ms-competition-hero .ms-hero-controls>form select{
 min-width:0!important;width:100%!important;height:35px!important;padding:5px 9px!important;
}
html body .ms-competition-profile header.ms-competition-hero .ms-hero-controls .ms-calc-access-list{
 z-index:250!important;right:0!important;left:auto!important;
}
@media(max-width:740px){
 html body .ms-competition-profile header.ms-competition-hero:has(> .ms-hero-controls){
  grid-template-columns:50px minmax(0,1fr)!important;grid-template-rows:auto auto!important;
  gap:12px 9px!important;align-items:center!important;
 }
 html body .ms-competition-profile header.ms-competition-hero:has(> .ms-hero-controls)>div:first-child{
  grid-column:1!important;grid-row:1!important;min-width:0!important;width:auto!important;max-width:50px!important;
 }
 html body .ms-competition-profile header.ms-competition-hero:has(> .ms-hero-controls)>div:nth-child(2){
  grid-column:2!important;grid-row:1!important;width:auto!important;max-width:100%!important;text-align:left!important;
 }
 html body .ms-competition-profile header.ms-competition-hero .ms-hero-controls{
  grid-column:1/-1!important;grid-row:2!important;justify-self:stretch!important;
  width:100%!important;max-width:100%!important;justify-content:space-between!important;
  align-items:flex-end!important;gap:10px!important;margin:0!important;
 }
 html body .ms-competition-profile header.ms-competition-hero .ms-hero-controls>.ms-calc-tools-menu{
  flex:0 1 auto!important;align-self:flex-end!important;
 }
 html body .ms-competition-profile header.ms-competition-hero .ms-hero-controls>form{
  flex:0 1 160px!important;width:min(44%,160px)!important;max-width:160px!important;min-width:96px!important;
 }
 html body .ms-competition-profile header.ms-competition-hero .ms-hero-controls>.ms-calc-tools-menu>summary.ms-calc-tools-toggle{
  font-size:.70rem!important;padding:7px 9px!important;
 }
}
@media(max-width:340px){
 html body .ms-competition-profile header.ms-competition-hero .ms-hero-controls>form{
  flex-basis:112px!important;min-width:98px!important;width:112px!important;
 }
 html body .ms-competition-profile header.ms-competition-hero .ms-hero-controls>.ms-calc-tools-menu>summary.ms-calc-tools-toggle{
  font-size:.64rem!important;
 }
}

/* Reválida en móvil: el árbol utiliza el mismo ritmo compacto que LPF,
   con rondas plegadas y conexiones visibles sin alturas heredadas. */
@media(max-width:720px){
 html body .ms-fa26-revalida .ms-fa403-views[data-fa403-mode="tree"] .ms-fa403-mobile-tree:not([hidden]){
   gap:9px!important;padding:8px 0 20px!important;
 }
 html body .ms-fa26-revalida .ms-fa403-mobile-tree .ms-fa403-stage{
   min-height:0!important;height:auto!important;margin:0!important;padding:3px 0 7px!important;
 }
 html body .ms-fa26-revalida .ms-fa403-mobile-tree .ms-fa403-stage-cards{
   min-height:0!important;height:auto!important;align-content:start!important;gap:9px!important;
 }
 html body .ms-fa26-revalida .ms-fa403-mobile-tree .ms-fa404-seed-group{
   justify-content:flex-start!important;align-self:start!important;
 }
 html body .ms-fa26-revalida .ms-fa403-mobile-tree .ms-fa403-stage h3{
   margin:4px 0 9px!important;font:900 .82rem/1.2 Nunito,sans-serif!important;
 }
 html body .ms-fa26-revalida .ms-fa403-mobile-tree .ms-fa405-fold-toggle{
   width:91%!important;min-height:52px!important;margin:4px auto!important;
 }
 /* El botón del árbol y Copiar enlace se apilan, nunca en la misma horizontal. */
 html body .ms-fa26-revalida .ms-fa403-mode-toggle,
 html body .ms-universal-bracket-ui .ms-mobile-bracket-mode-toggle{
   position:fixed!important;right:14px!important;
   bottom:calc(90px + env(safe-area-inset-bottom,0px))!important;
   z-index:699!important;
 }
}

/* Federal A usa las mismas pestañas de rondas del visor LPF. */
.ms-fa406-round-tabs{display:none}
@media(max-width:720px){
 .ms-fa26-revalida .ms-fa406-round-tabs{display:flex!important;align-items:center!important;gap:7px!important;
   margin:5px 0 12px!important;overflow-x:auto!important;scrollbar-width:none!important;padding:4px 0!important;}
 .ms-fa26-revalida .ms-fa406-round-tabs button{flex:0 0 auto!important;border:1px solid transparent!important;
   background:transparent!important;color:var(--fa-muted,#67758a)!important;border-radius:999px!important;
   padding:9px 13px!important;min-height:38px!important;font:850 .73rem Nunito,sans-serif!important;}
 .ms-fa26-revalida .ms-fa406-round-tabs button[aria-current="true"]{background:var(--ms-card,#fff)!important;
   color:var(--fa-ink,#162335)!important;border-color:var(--fa-border,#d8e0eb)!important;
   box-shadow:0 2px 6px #23332425!important;}
}


/* 5.19.416 — SOLO encabezado móvil: compacto, sin tocar PC ni su grilla. */
@media (max-width:740px){
 html body .ms-competition-profile header.ms-competition-hero:has(> .ms-hero-controls){
   grid-template-columns:40px minmax(0,1fr)!important;
   grid-template-rows:min-content min-content!important;
   align-items:center!important;align-content:start!important;
   column-gap:8px!important;row-gap:4px!important;
   box-sizing:border-box!important;min-height:0!important;height:auto!important;
   padding:10px 12px!important;
 }
 html body .ms-competition-profile header.ms-competition-hero:has(> .ms-hero-controls)>div:first-child{
   grid-column:1!important;grid-row:1!important;width:40px!important;max-width:40px!important;
 }
 html body .ms-competition-profile header.ms-competition-hero:has(> .ms-hero-controls)>div:nth-child(2){
   grid-column:2!important;grid-row:1!important;min-height:0!important;align-self:center!important;
 }
 html body .ms-competition-profile header.ms-competition-hero .ms-hero-controls{
   grid-column:1/-1!important;grid-row:2!important;
   justify-self:end!important;align-self:end!important;
   display:inline-flex!important;align-items:flex-end!important;
   justify-content:flex-end!important;flex-wrap:nowrap!important;
   gap:6px!important;width:max-content!important;max-width:100%!important;
   min-height:0!important;margin:0!important;padding:0!important;
 }
 html body .ms-competition-profile header.ms-competition-hero .ms-hero-controls>.ms-calc-tools-menu{
   flex:0 1 auto!important;max-width:calc(100vw - 120px)!important;min-width:0!important;
 }
 html body .ms-competition-profile header.ms-competition-hero .ms-hero-controls>.ms-calc-tools-menu>summary.ms-calc-tools-toggle{
   min-height:32px!important;padding:5px 8px!important;font-size:.70rem!important;
 }
 html body .ms-competition-profile header.ms-competition-hero .ms-hero-controls>form{
   flex:0 0 88px!important;width:88px!important;max-width:88px!important;min-width:0!important;
 }
 html body .ms-competition-profile header.ms-competition-hero .ms-hero-controls>form label{
   font-size:.58rem!important;gap:2px!important;
 }
 html body .ms-competition-profile header.ms-competition-hero .ms-hero-controls>form select{
   box-sizing:border-box!important;width:88px!important;height:32px!important;
   min-width:0!important;max-width:88px!important;padding:4px 6px!important;font-size:.70rem!important;
 }
}
@media(max-width:360px){
 html body .ms-competition-profile header.ms-competition-hero .ms-hero-controls>form,
 html body .ms-competition-profile header.ms-competition-hero .ms-hero-controls>form select{
   flex-basis:78px!important;width:78px!important;max-width:78px!important;
 }
 html body .ms-competition-profile header.ms-competition-hero .ms-hero-controls>.ms-calc-tools-menu>summary.ms-calc-tools-toggle{
   padding:4px 6px!important;font-size:.66rem!important;
 }
}


/* 5.19.419 — LPF 2026: escudo, título/ranking y controles en UNA FILA.
   Reemplaza la regla 5.19.417 que fijaba controles en la parte inferior.
   Sólo la LPF, solamente móvil; no altera la cabecera de otras competencias. */
@media (max-width:740px){
 html body .ms-competition-profile header.ms-competition-hero.ms-lpf-compact-hero:has(> .ms-hero-controls){
  position:relative!important;display:grid!important;
  grid-template-columns:30px minmax(0,1fr) 158px!important;
  grid-template-rows:auto!important;
  gap:6px!important;align-items:center!important;
  box-sizing:border-box!important;min-height:0!important;height:auto!important;
  padding:9px 9px!important;overflow:visible!important;
 }
 html body .ms-competition-profile header.ms-competition-hero.ms-lpf-compact-hero>div:first-child{
  position:relative!important;display:block!important;grid-column:1!important;grid-row:1!important;
  width:30px!important;max-width:30px!important;min-width:0!important;
  align-self:center!important;justify-self:center!important;margin:0!important;padding:0!important;
 }
 html body .ms-competition-profile header.ms-competition-hero.ms-lpf-compact-hero>div:first-child .ms-crest,
 html body .ms-competition-profile header.ms-competition-hero.ms-lpf-compact-hero>div:first-child .ms-crest-fallback{
  width:29px!important;max-width:29px!important;height:29px!important;object-fit:contain!important;
 }
 html body .ms-competition-profile header.ms-competition-hero.ms-lpf-compact-hero>div:nth-child(2){
  position:relative!important;display:block!important;grid-column:2!important;grid-row:1!important;
  min-width:0!important;max-width:100%!important;align-self:center!important;
  width:auto!important;min-height:0!important;flex:none!important;margin:0!important;padding:0!important;
 }
 html body .ms-competition-profile header.ms-competition-hero.ms-lpf-compact-hero>div:nth-child(2) .ms-eyebrow{
  display:block!important;font-size:9px!important;line-height:1.1!important;margin:0!important;
 }
 html body .ms-competition-profile header.ms-competition-hero.ms-lpf-compact-hero>div:nth-child(2) h1{
  font-size:clamp(11.5px,3.4vw,14px)!important;line-height:1.12!important;
  margin:2px 0 3px!important;max-width:100%!important;
  overflow-wrap:normal!important;word-break:normal!important;white-space:normal!important;
 }
 html body .ms-competition-profile header.ms-competition-hero.ms-lpf-compact-hero .ms-competition-ranking-link{
  display:inline-flex!important;width:max-content!important;max-width:100%!important;
  min-height:20px!important;font-size:9px!important;
  padding:2px 4px!important;white-space:nowrap!important;margin:0!important;
 }
 html body .ms-competition-profile header.ms-competition-hero.ms-lpf-compact-hero>.ms-hero-controls{
  position:relative!important;grid-column:3!important;grid-row:1!important;
  inset:auto!important;top:auto!important;bottom:auto!important;left:auto!important;right:auto!important;
  display:flex!important;flex-flow:row nowrap!important;align-items:flex-end!important;
  justify-content:flex-end!important;justify-self:end!important;align-self:center!important;
  width:158px!important;min-width:0!important;max-width:158px!important;
  min-height:0!important;gap:5px!important;margin:0!important;padding:0!important;
  transform:none!important;z-index:40!important;
 }
 html body .ms-competition-profile header.ms-competition-hero.ms-lpf-compact-hero>.ms-hero-controls>.ms-calc-tools-menu{
  flex:0 0 87px!important;min-width:0!important;max-width:87px!important;width:87px!important;
  margin:0!important;align-self:flex-end!important;
 }
 html body .ms-competition-profile header.ms-competition-hero.ms-lpf-compact-hero>.ms-hero-controls>.ms-calc-tools-menu>summary.ms-calc-tools-toggle{
  box-sizing:border-box!important;width:87px!important;max-width:87px!important;min-width:0!important;
  min-height:30px!important;padding:4px 3px!important;font:800 9.4px/1.1 Nunito,sans-serif!important;
  gap:2px!important;white-space:nowrap!important;
 }
 html body .ms-competition-profile header.ms-competition-hero.ms-lpf-compact-hero>.ms-hero-controls .ms-calc-tools-icon{
  display:none!important;
 }
 html body .ms-competition-profile header.ms-competition-hero.ms-lpf-compact-hero>.ms-hero-controls .ms-calc-tools-chevron{
  width:12px!important;height:12px!important;flex:0 0 12px!important;
 }
 html body .ms-competition-profile header.ms-competition-hero.ms-lpf-compact-hero>.ms-hero-controls>form{
  box-sizing:border-box!important;flex:0 0 66px!important;width:66px!important;
  max-width:66px!important;min-width:0!important;margin:0!important;padding:0!important;
  align-self:flex-end!important;
 }
 html body .ms-competition-profile header.ms-competition-hero.ms-lpf-compact-hero>.ms-hero-controls>form label{
  display:grid!important;gap:2px!important;margin:0!important;font-size:9px!important;line-height:1.1!important;
 }
 html body .ms-competition-profile header.ms-competition-hero.ms-lpf-compact-hero>.ms-hero-controls>form select{
  box-sizing:border-box!important;width:66px!important;max-width:66px!important;min-width:0!important;
  height:30px!important;min-height:30px!important;padding:3px 5px!important;
  font-size:10.5px!important;margin:0!important;
 }
 html body .ms-competition-profile header.ms-competition-hero.ms-lpf-compact-hero .ms-calc-tools-menu .ms-calc-access-list{
  position:absolute!important;right:0!important;left:auto!important;top:100%!important;z-index:400!important;
 }
}
@media(max-width:355px){
 html body .ms-competition-profile header.ms-competition-hero.ms-lpf-compact-hero:has(> .ms-hero-controls){
  grid-template-columns:24px minmax(0,1fr) 150px!important;column-gap:4px!important;
  padding:8px 6px!important;
 }
 html body .ms-competition-profile header.ms-competition-hero.ms-lpf-compact-hero>div:first-child,
 html body .ms-competition-profile header.ms-competition-hero.ms-lpf-compact-hero>div:first-child .ms-crest,
 html body .ms-competition-profile header.ms-competition-hero.ms-lpf-compact-hero>div:first-child .ms-crest-fallback{
  width:24px!important;max-width:24px!important;height:24px!important;
 }
 html body .ms-competition-profile header.ms-competition-hero.ms-lpf-compact-hero>.ms-hero-controls{
  width:150px!important;max-width:150px!important;gap:4px!important;
 }
 html body .ms-competition-profile header.ms-competition-hero.ms-lpf-compact-hero>.ms-hero-controls>.ms-calc-tools-menu,
 html body .ms-competition-profile header.ms-competition-hero.ms-lpf-compact-hero>.ms-hero-controls>.ms-calc-tools-menu>summary.ms-calc-tools-toggle{
  flex-basis:82px!important;max-width:82px!important;width:82px!important;
 }
 html body .ms-competition-profile header.ms-competition-hero.ms-lpf-compact-hero>.ms-hero-controls>form,
 html body .ms-competition-profile header.ms-competition-hero.ms-lpf-compact-hero>.ms-hero-controls>form select{
  flex-basis:64px!important;width:64px!important;max-width:64px!important;
 }
}
