/* Shared monochrome category tiles; preserve original dropdown triggers. */
.ap-top-chrome :is([data-create-options], .ap-top-chrome__browse-menu) {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:4px;
  width:min(288px,calc(100vw - 24px));
  box-sizing:border-box;
}
.ap-top-chrome :is([data-create-options], .ap-top-chrome__browse-menu) > .ap-top-chrome__account-item {
  flex-direction:column;
  justify-content:center;
  gap:5px;
  padding:6px 4px;
  min-height:72px;
  text-align:center;
  white-space:normal;
}
.ap-nav-tile-icon {
  display:flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  border-radius:8px;
  background:transparent;
  color:inherit;
}
.ap-top-chrome :is([data-create-options], .ap-top-chrome__browse-menu) .ap-nav-tile-icon :is(.bi,.ap-bi-svg) {
  width:20px;height:20px;flex:0 0 20px;font-size:20px;color:inherit;
}

/* Primary menus remain available even with older custom shortcut selections.
   Keep selected additional shortcuts and the existing navigation mode. */
html[data-ap-nav-shortcuts] .ap-top-chrome [data-ap-nav-shortcut="browse"],
html[data-ap-nav-shortcuts] .ap-top-chrome [data-ap-nav-shortcut="create"] {
  display:inline-flex !important;
}

/* Reuse the original switches inside the existing Layout dialog. */
#ap-navigation-layout-picker-modal .ap-layout-appearance {
  margin-top:16px;
  padding-top:12px;
  border-top:1px solid #d3d3d3;
}
#ap-navigation-layout-picker-modal .ap-layout-appearance > div {
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:8px;
  padding:6px 0;
  cursor:default;
  color:inherit !important;
}
#ap-navigation-layout-picker-modal .ap-top-chrome__cards-toggle,
#ap-navigation-layout-picker-modal .ap-top-chrome__font-toggle {flex-wrap:wrap}
#ap-navigation-layout-picker-modal .ap-top-chrome__cards-toggle button:disabled {opacity:.45;cursor:default}

/* Only flexible story/archive grids follow these preferences.
   Fixed homepage shelves and the hero remain unchanged. */
@media (min-width:768px) {
  body.cards-3 .ap-year-archive-feed,
  body.cards-3 #story-cards-row:not([data-ap-fixed-cards]) {
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  }
}
@media (min-width:1440px) {
  body.cards-6 .ap-year-archive-feed,
  body.cards-6 #story-cards-row:not([data-ap-fixed-cards]) {
    grid-template-columns:repeat(6,minmax(0,1fr)) !important;
  }
  body.cards-6 .story-cards-container {max-width:none !important}
}
