/* 21-r227-polish.css — v1.19.227 layout polish for both themes (Arvix + Silk) */

/* home: no lonely tile on its own row. Shortcuts: at most 6 per row (12 tiles = 2 full rows);
   numbers: at most 5 per row so the five cards sit together */
.dh-grid{ grid-template-columns:repeat(auto-fill,minmax(max(108px,calc((100% - 50px)/6)),1fr)); }
#pg-dashboard .stats-row{ grid-template-columns:repeat(auto-fit,minmax(max(128px,calc((100% - 56px)/5)),1fr)); }
@media (max-width:768px){
  .dh-grid{ grid-template-columns:repeat(2,1fr); }
  #pg-dashboard .stats-row{ grid-template-columns:repeat(2,1fr); }
  #pg-dashboard .stats-row > :last-child:nth-child(odd),
  .dh-grid > :last-child:nth-child(odd){ grid-column:1 / -1; }
}

/* Silk: the shortcut tag on the selected item sits on the light pill, so it gets an ink tint, not grey */
html.silk .ni.on .sh-badge{ background:rgba(10,11,13,.07); border:1px solid rgba(10,11,13,.14); color:rgba(10,11,13,.72); }

/* any stats row: five or six cards share the width evenly instead of leaving one card alone on a second line */
@media (min-width:769px){
  .stats-row:has(> :nth-child(5):last-child){ grid-template-columns:repeat(5,minmax(0,1fr)); }
  .stats-row:has(> :nth-child(6):last-child){ grid-template-columns:repeat(3,minmax(0,1fr)); }
  .stats-row:has(> :nth-child(7):last-child),
  .stats-row:has(> :nth-child(8):last-child){ grid-template-columns:repeat(4,minmax(0,1fr)); }
}
@media (max-width:768px){
  .stats-row > :last-child:nth-child(odd){ grid-column:1 / -1; }
}
@media (min-width:769px){
  #pg-products .stats-row.r3-stats:has(> :nth-child(5):last-child){ grid-template-columns:repeat(5,minmax(0,1fr)); }
}
